[PATCH] D41635: Align SHT_NOBITS sections is they are the first on a PT_LOAD

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 29 16:04:52 PST 2017


Dimitry Andric via Phabricator <reviews at reviews.llvm.org> writes:

> dim added a comment.
>
> This makes libelf (and thus ctfmerge and elftoolchain objcopy) accept the lld-linked kernel, and building succeeds.  GNU objcopy still shows that it is adjusting sections:
>
>   $ /usr/local/bin/objcopy /usr/obj/share/dim/src/freebsd/clang600-import/amd64.amd64/sys/GENERIC/kernel.full kernel.test
>   /usr/local/bin/objcopy: kernel.test: section .init_array lma 0x1734000 adjusted to 0x17340f0
>   /usr/local/bin/objcopy: kernel.test: section .fini_array lma 0x1734000 adjusted to 0x17340f0
>   /usr/local/bin/objcopy: kernel.test: section .data.rel.ro lma 0x1734000 adjusted to 0x17340f0
>   /usr/local/bin/objcopy: kernel.test: section .preinit_array lma 0x1734000 adjusted to 0x17340f0
>
> However, that may be some quirk of GNU binutils's ELF handling...

Yes, it is something to do with empty sections, but I couldn't quite
figure out what just by changing the testcase. That is just a warning,
right? Once the actual lld bug is fixed I can report a bug on the gnu
objcopy.

Cheers,
Rafael


More information about the llvm-commits mailing list