[all-commits] [llvm/llvm-project] 7b424b: [llvm-objcopy] Rename relocation sections together...

Igor Kudrin via All-commits all-commits at lists.llvm.org
Wed Sep 29 02:36:58 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7b424b933355c972da006e9afd560d4e534d08f8
      https://github.com/llvm/llvm-project/commit/7b424b933355c972da006e9afd560d4e534d08f8
  Author: Igor Kudrin <ikudrin at accesssoftek.com>
  Date:   2021-09-29 (Wed, 29 Sep 2021)

  Changed paths:
    A llvm/test/tools/llvm-objcopy/ELF/rename-section-relocsec.test
    M llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list