https://bugs.llvm.org/show_bug.cgi?id=35766

            Bug ID: 35766
           Summary: After r320437, lld links FreeBSD kernel incorrectly
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedb...@nondot.org
          Reporter: dimi...@andric.com
                CC: llvm-bugs@lists.llvm.org

Linking the FreeBSD kernel with recent lld, I noticed complaints from ctfmerge:

ERROR: ctfmerge: kernel.full.ctf: Cannot finalize temp file: Layout constraint
violation

Running GNU objcopy on such a kernel image shows:

/usr/local/bin/objcopy: kernel.test: section .init_array lma 0x1733000 adjusted
to 0x17330f0
/usr/local/bin/objcopy: kernel.test: section .fini_array lma 0x1733000 adjusted
to 0x17330f0
/usr/local/bin/objcopy: kernel.test: section .data.rel.ro lma 0x1733000
adjusted to 0x17330f0
/usr/local/bin/objcopy: kernel.test: section .preinit_array lma 0x1733000
adjusted to 0x17330f0

I bisected and found https://reviews.llvm.org/rL320437 ("[ELF] Change default
output section type to SHT_NOBITS") to be the cause.

Maybe it is due to the linker script the FreeBSD kernel uses?  I will attach or
upload the reproduction files.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to