[llvm] [llvm-objcopy] Add change-section-lma *+/-offset (PR #95431)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 26 01:06:46 PDT 2024


================
@@ -670,6 +670,13 @@ static Error handleArgs(const CommonConfig &Config, const ELFConfig &ELFConfig,
     }
   }
 
+  if (Config.ChangeSectionLMAValAll != 0) {
+    for (Segment &Seg : Obj.segments()) {
+      if (Seg.FileSize > 0)
+        Seg.PAddr += Config.ChangeSectionLMAValAll;
----------------
jh7370 wrote:

What should happen if PAddr wraps, e.g. adjusting an address of 0x10 by -0x20?

https://github.com/llvm/llvm-project/pull/95431


More information about the llvm-commits mailing list