[PATCH] D60324: [llvm-objcopy] Add switch to allow removing referenced sections

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 5 09:27:13 PDT 2019


jhenderson created this revision.
jhenderson added reviewers: jakehehrlich, rupprecht, alexshap, grimar.
Herald added subscribers: MaskRay, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

llvm-objcopy currently emits an error if a section to be removed is referenced by another section. This is a reasonable thing to do, but is different to GNU objcopy. We should allow users who know what they are doing to have a way to produce the invalid ELF. This change adds a new switch --allow-broken-dependencies to do precisely that. The corresponding Link field is then set to 0 instead of an error being emitted.


Repository:
  rL LLVM

https://reviews.llvm.org/D60324

Files:
  test/tools/llvm-objcopy/ELF/dynsym-error-remove-strtab.test
  test/tools/llvm-objcopy/ELF/reloc-error-remove-symtab.test
  test/tools/llvm-objcopy/ELF/remove-linked-section.test
  test/tools/llvm-objcopy/ELF/symtab-error-on-remove-strtab.test
  tools/llvm-objcopy/COFF/COFFObjcopy.cpp
  tools/llvm-objcopy/CopyConfig.cpp
  tools/llvm-objcopy/CopyConfig.h
  tools/llvm-objcopy/ELF/ELFObjcopy.cpp
  tools/llvm-objcopy/ELF/Object.cpp
  tools/llvm-objcopy/ELF/Object.h
  tools/llvm-objcopy/ObjcopyOpts.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60324.193899.patch
Type: text/x-patch
Size: 16675 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190405/ff5362e7/attachment.bin>


More information about the llvm-commits mailing list