aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-10-04 17:48:07 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-10-04 17:59:44 -0700
commit1d777e99588be047ec4d7650f048b043d6e52da0 (patch)
treec6155fb3f8b3d9f6218942bbce293bab355d2bf8 /src/Compilation.zig
parentda596b7e4febc95ec5249c9f489166944fbe69b9 (diff)
downloadzig-1d777e99588be047ec4d7650f048b043d6e52da0.tar.gz
zig-1d777e99588be047ec4d7650f048b043d6e52da0.zip
add --image-base support
Based on #6121 by Jay Petacat.
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 16a475b2fc..1085e2d779 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -378,6 +378,7 @@ pub const InitOptions = struct {
is_compiler_rt_or_libc: bool = false,
parent_compilation_link_libc: bool = false,
stack_size_override: ?u64 = null,
+ image_base_override: ?u64 = null,
self_exe_path: ?[]const u8 = null,
version: ?std.builtin.Version = null,
libc_installation: ?*const LibCInstallation = null,
@@ -452,6 +453,7 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation {
options.link_emit_relocs or
options.output_mode == .Lib or
options.lld_argv.len != 0 or
+ options.image_base_override != null or
options.linker_script != null or options.version_script != null)
{
break :blk true;
@@ -772,6 +774,7 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation {
.z_nodelete = options.linker_z_nodelete,
.z_defs = options.linker_z_defs,
.stack_size_override = options.stack_size_override,
+ .image_base_override = options.image_base_override,
.linker_script = options.linker_script,
.version_script = options.version_script,
.gc_sections = options.linker_gc_sections,