[llvm] [llvm-objcopy] Add --change-section-address (PR #98664)
Eleanor Bonnici via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 19 11:07:31 PDT 2024
================
@@ -303,6 +303,15 @@ them.
Shift LMA of non-zero-sized segments by ``<val>``.
+.. option:: --change-section-address <sectionpattern>{=+-}<val>, --adjust-section-vma
+
+ Change the address of ``<sectionpattern>`` to the specified value, or apply
+ offset to the current value. Can be specified multiple times to specify multiple
+ patterns. Each section is only modified by one --change-section-address
+ argument. Changes apply from the right of the command line. If a section name
+ matches multiple patterns, the rightmost change applies. Object file needs to be
+ relocatable.
----------------
eleanor-arm wrote:
> Is simply saying "needs to be an ET_REL object" or something to that effect okay?
Strictly speaking the object file type currently needs to match:
```
MustBeRelocatable |= isa<RelocationSection>(*Ptr);
bool isRelocatable() const {
return (Type != ELF::ET_DYN && Type != ELF::ET_EXEC) || MustBeRelocatable;
}
```
but the change probably only makes sense on ET_REL file. So I shall change this in the code before updating the description.
https://github.com/llvm/llvm-project/pull/98664
More information about the llvm-commits
mailing list