[llvm] [llvm-objcopy] Add --change-section-address (PR #98664)

Eleanor Bonnici via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 19 10:19:42 PDT 2024


eleanor-arm wrote:

> Can I confirm that the behaviour you're following is compatible with GNU? In particular, if you end up with multiple patterns that match the same section, does only the last one apply for certain, but other sections which don't match later patterns are still adjusted by earlier ones?

Yes. That is what GNU does. I copied the behaviour from there, otherwise I would have probably done something else. 

For example, this test produces the same output with aarch64-linux-gnu-objcopy:
```
# RUN: llvm-objcopy --change-section-address *+0x20 --change-section-address .anotherone=0x455 %ti %to
# RUN: llvm-readelf --section-headers %to | FileCheck %s --check-prefix=CHECK-SUPERSET-SET
```

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


More information about the llvm-commits mailing list