[llvm-bugs] [Bug 35766] New: After r320437, lld links FreeBSD kernel incorrectly

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Dec 28 03:34:22 PST 2017


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: unassignedbugs at nondot.org
          Reporter: dimitry at andric.com
                CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171228/1ac48857/attachment.html>


More information about the llvm-bugs mailing list