[PATCH] D128961: [llvm-objcopy] -O binary: align sh_offset for section changed from SHT_NOBITS
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 30 21:41:30 PDT 2022
MaskRay created this revision.
MaskRay added reviewers: jhenderson, pattop.
Herald added subscribers: StephenFan, abrachet, hiraditya, emaste.
Herald added a reviewer: alexander-shaposhnikov.
Herald added a reviewer: rupprecht.
Herald added a project: All.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
For a SHT_NOBITS section like .bss, its sh_offset is typically not
aligned by sh_addralign. If it is converted to SHT_PROGBITS by
`--set-section-flags .bss=alloc,contents`, we should conceptually align
it when computing the output size for -O binary. Otherwise the output
size may be smaller than GNU objcopy produced output.
- binary-no-paddr.test has a case with non-sensical p_paddr=1 which has a changed behavior. Update it.
Close https://github.com/llvm/llvm-project/issues/55246
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D128961
Files:
llvm/lib/ObjCopy/ELF/ELFObject.cpp
llvm/test/tools/llvm-objcopy/ELF/binary-no-paddr.test
llvm/test/tools/llvm-objcopy/ELF/binary-paddr.test
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128961.441584.patch
Type: text/x-patch
Size: 3936 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220701/dcde6a20/attachment.bin>
More information about the llvm-commits
mailing list