Skip to content

Commit

Permalink
elf: handle --relocatable as alias for -r
Browse files Browse the repository at this point in the history
  • Loading branch information
kubkon committed Nov 16, 2023
1 parent cbb0aae commit fb386d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Elf/Options.zig
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const usage =
\\--print-gc-sections List removed unused sections to stderr
\\--push-state Save the current state of --as-needed, -static and --whole-archive
\\-r Create a relocatable object file
\\ --relocatable
\\--relax Optimize instructions (default)
\\ --no-relax
\\--rpath=[value], -R [value] Specify runtime path
Expand Down Expand Up @@ -153,7 +154,7 @@ pub fn parse(arena: Allocator, args: []const []const u8, ctx: anytype) !Options
try search_dirs.put(dir, {});
} else if (p.arg1("o")) |path| {
opts.emit.sub_path = path;
} else if (p.flag1("r")) {
} else if (p.flag1("r") or p.flagAny("relocatable")) {
opts.relocatable = true;
} else if (p.arg1("image-base")) |value| {
opts.image_base = std.fmt.parseInt(u64, value, 0) catch
Expand Down

0 comments on commit fb386d5

Please sign in to comment.