[PATCH] D150276: [llvm-objcopy] -O binary: do not align physical addresses

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 13 10:03:29 PDT 2023


MaskRay accepted this revision.
MaskRay added a comment.

LGTM, will be great to have a sign-up from @jhenderson



================
Comment at: llvm/test/tools/llvm-objcopy/ELF/binary-paddr.test:258
+
+## Test that sections do not move relative to their physical addresses if
+## the physical address is not aligned. This behavior matches GNU objcopy
----------------
I think the comment can be simplified.

" The loader typically will copy this image using a start symbol created by the linker. Since copying is
done by memcpy, the source alignment is not important but the symbol
address must match the initial image location." seems unnecessary to me.

Perhaps just use this:

Without converting the type of a NOBITS section, don't align the offset.
This matches GNU objcopy when the physical address of a section is not aligned.


================
Comment at: llvm/test/tools/llvm-objcopy/ELF/binary-paddr.test:310
+    Content:         BDACCDAB
+
----------------
Delete the trailing blank line.


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

https://reviews.llvm.org/D150276



More information about the llvm-commits mailing list