llvm-project/llvm/tools/llvm-objcopy/ELF
Igor Kudrin 7b424b9333 [llvm-objcopy] Rename relocation sections together with their targets.
As for now, llvm-objcopy renames only sections that are specified
explicitly in --rename-section, while GNU objcopy keeps names of
relocation sections in sync with their targets. For example:

> readelf -S test.o
...
  [ 1] .foo      PROGBITS
  [ 2] .rela.foo RELA

> objcopy --rename-section .foo=.bar test.o gnu.o
> readelf -S gnu.o
...
  [ 1] .bar      PROGBITS
  [ 2] .rela.bar RELA

> llvm-objcopy --rename-section .foo=.bar test.o llvm.o
> readelf -S llvm.o
...
  [ 1] .bar      PROGBITS
  [ 2] .rela.foo RELA

This patch makes llvm-objcopy to match the behavior of GNU objcopy better.

Differential Revision: https://reviews.llvm.org/D110352
2021-09-29 16:36:37 +07:00
..
ELFConfig.h [llvm-objcopy][NFC] Refactor CopyConfig structure - categorize options. 2021-09-08 19:16:38 +03:00
ELFObjcopy.cpp [llvm-objcopy] Rename relocation sections together with their targets. 2021-09-29 16:36:37 +07:00
ELFObjcopy.h [llvm-objcopy] Refactor CopyConfig structure. 2021-05-20 13:14:51 +03:00
Object.cpp [llvm-objcopy][NFC] Add a helper method RelocationSectionBase::getNamePrefix() 2021-09-24 22:02:36 +07:00
Object.h [llvm-objcopy][NFC] Add a helper method RelocationSectionBase::getNamePrefix() 2021-09-24 22:02:36 +07:00