[PATCH] D150859: [llvm-objcopy][ELF] Preserve sh_link to .symtab when applicable

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 11:07:44 PDT 2023


MaskRay added inline comments.


================
Comment at: llvm/test/tools/llvm-objcopy/ELF/symtab-link.test:9
 # RUN: llvm-readobj --sections %t3 | FileCheck %s
+## Add symbol.
+# RUN: llvm-objcopy --add-symbol=another=.text:0,function %t %t4
----------------
Perhaps add a comment to cover all the symbol index affecting operations, something like:

A section with sh_link referencing SHT_SYMTAB indicates that its content may use the old symbol indices.
If symbol indices changed, reset sh_link to 0 to inform tools like linkers that the link is invalidated.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150859/new/

https://reviews.llvm.org/D150859



More information about the llvm-commits mailing list