[PATCH] D112116: [llvm-objcopy] Add --update-section

Leonard Chan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 19 18:43:39 PDT 2021


leonardchan created this revision.
leonardchan added reviewers: phosek, jhenderson, evgeny777, rupprecht, AsafFisher, pcc.
leonardchan added a project: LLVM.
Herald added subscribers: abrachet, emaste.
Herald added a reviewer: alexander-shaposhnikov.
leonardchan requested review of this revision.
Herald added a subscriber: MaskRay.

This is another attempt at D59351 <https://reviews.llvm.org/D59351> which attempted to add `--update-section`, but with some heuristics for adjusting segment/section offsets/sizes in the event the data copied into the section is larger than the original size of the section. We are opting to not support this case. GNU's objcopy was able to do this because the linker and objcopy are tightly coupled enough that segment reformatting was simpler. This is not the case with llvm-objcopy and lld where they like to be separated.

This will attempt to copy data into the section without changing any other properties of the section (or parent segment).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112116

Files:
  llvm/test/tools/llvm-objcopy/ELF/update-section.test
  llvm/tools/llvm-objcopy/CommonConfig.h
  llvm/tools/llvm-objcopy/ConfigManager.cpp
  llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp
  llvm/tools/llvm-objcopy/ELF/Object.cpp
  llvm/tools/llvm-objcopy/ELF/Object.h
  llvm/tools/llvm-objcopy/ObjcopyOpts.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112116.380839.patch
Type: text/x-patch
Size: 13754 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211020/a435692f/attachment.bin>


More information about the llvm-commits mailing list