[PATCH] D58173: [llvm-objcopy] Add --set-start, --change-start, --adjust-start

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 25 14:52:00 PST 2019


rupprecht accepted this revision.
rupprecht added a comment.

Two differences we're making from GNU objcopy:

1. --set-start and --change-start are now order dependent, e.g.

--set-start 0x100 --change-start 0x4 => both GNU objcopy and llvm-objcopy agree the start is 0x104
--change-start 0x4 --set-start 0x100 => GNU objcopy starts at 0x104, llvm-objcopy starts at 0x100 (i.e. --set-start overrides previous values)

2. --change-start is cumulative, e.g.

--set-start 0x100 --change-start 0x4 --change-start 0x2 => GNU objcopy starts at 0x102 (last value of --change-start wins), llvm-objcopy starts at 0x106 (both values are added together)

I'm ok with both of these changes (if anyone is relying on this... that's scary), but it'd be nice to call this out in the help string (or man pages if we had those).



================
Comment at: tools/llvm-objcopy/ObjcopyOpts.td:241
 
+defm set_start : Eq<"set-start", "Set the start address to <addr>">,
+                 MetaVarName<"addr">;
----------------
Add to the help string: Overrides any previous --change-start or --adjust-start values


================
Comment at: tools/llvm-objcopy/ObjcopyOpts.td:243
+                 MetaVarName<"addr">;
+defm change_start : Eq<"change-start", "Add <incr> to the start address">,
+                    MetaVarName<"incr">;
----------------
Add to the help string: Can be specified multiple times, all values will be applied cumulatively.

(I'm not sure if that's the best wording)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58173/new/

https://reviews.llvm.org/D58173





More information about the llvm-commits mailing list