[all-commits] [llvm/llvm-project] 7c03b7: [llvm-objcopy][ELF] Allow --set-section-flags src=...

Fangrui Song via All-commits all-commits at lists.llvm.org
Mon Jul 11 09:04:59 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7c03b7d668dcc0c6937d41e131fa0a07b62f907b
      https://github.com/llvm/llvm-project/commit/7c03b7d668dcc0c6937d41e131fa0a07b62f907b
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-07-11 (Mon, 11 Jul 2022)

  Changed paths:
    M llvm/docs/ReleaseNotes.rst
    M llvm/lib/ObjCopy/ELF/ELFObjcopy.cpp
    A llvm/test/tools/llvm-objcopy/ELF/rename-section-and-update.test
    A llvm/test/tools/llvm-objcopy/ELF/set-section-attr-and-rename.test
    R llvm/test/tools/llvm-objcopy/ELF/set-section-flags-and-rename.test
    M llvm/tools/llvm-objcopy/ObjcopyOptions.cpp

  Log Message:
  -----------
  [llvm-objcopy][ELF] Allow --set-section-flags src=... and --rename-section src=tst

* GNU objcopy supports --set-section-flags src=... --rename-section src=tst and --set-section-flags runs first.
* GNU objcopy processes --update-section before --rename-section.

To match the two behaviors, postpone --rename-section and allow its use together
with --set-section-flags.

As a side effect, --rename-section=.foo1=.foo2 --add-section=.foo1=/dev/null
leads to .foo2 while GNU objcopy surprisingly produces .foo1 (so
--set-section-flags --add-section --rename-section do not form a total order).
I think the deviation is fine as a total order makes more sense.

Rename set-section-flags-and-rename.test to
set-section-attr-and-rename.test and additionally test --set-section-alignment

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D129336




More information about the All-commits mailing list