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

Dimitry Andric via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 29 15:26:16 PST 2017


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...


https://reviews.llvm.org/D41635





More information about the llvm-commits mailing list