[PATCH] D41619: [llvm-objcopy] Use physical instead of virtual address when aligning and placing sections in binary

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 10:46:25 PST 2018


jakehehrlich added inline comments.


================
Comment at: test/tools/llvm-objcopy/binary-paddr.test:35
+    Flags: [ PF_R, PF_W ]
+    VAddr: 0x2000
+    PAddr: 0x1008
----------------
jhenderson wrote:
> owenpshaw wrote:
> > jakehehrlich wrote:
> > > We don't know where the .data section will end up only that it will have 4-byte alignment It's possible (even quite likely) for the the offset of the .data section (which decides the offset of the program header unfortunately, not the other way around) to be such that the p_offset % p_align != p_vaddr % p_align. This is still not a valid ELF file (at least it isn't assured).
> > I guess I'm missing something with this alignment stuff.  Having possibly invalid values in the elf doesn't seem to affect what we're testing, but I agree it'd be good to use proper input if possible.  What values would make it valid?
> Maybe try PAddr 0x4000 and PVaddr 0x2000, and then use .data AddrAlign of 0x1000?
That would work.


https://reviews.llvm.org/D41619





More information about the llvm-commits mailing list