[llvm-bugs] [Bug 39587] New: lld elf/-bstatic creates crashing executable

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Nov 8 03:10:18 PST 2018


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

            Bug ID: 39587
           Summary: lld elf/-bstatic creates crashing executable
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: ck at remobjects.com
                CC: llvm-bugs at lists.llvm.org, peter.smith at linaro.org

Trying to use lld to create a -Bstatic executable for linux raspberrypi (armv7)
 creates an invalid executable that crashes at run & fails to open in gdb.

The commandline was 
lld -flavor gnu "ConsoleApplication907.a" "ConsoleApplication907.o" "Island.a" 
"libgc.a" libgcc.a libgcc_eh.a libpthread.a librt.a libc.a --eh-frame-hdr
-Bstatic -o ConsoleApplication907

If I compile Island.a from bitcode to obj and use gnu ld it does work and run:

ld   -\( Island.a  "libgc.a" libgcc.a libgcc_eh.a libpthread.a librt.a libc.a
-\) ConsoleApplication907.o ConsoleApplication907.a Island.a --eh-frame-hdr
-Bstatic -o ConsoleApplication907

Neither linux nor anything else gives an indication of what is wrong, but ld
has no problem statically linking libc. The qemu linux emulator seems to jump
(blx) to _dl_hwcap which is a BSS symbol.

LLD repro file: https://1drv.ms/u/s!Au2nm7P_hgmawnGfF6vCLE7JGT21 (too big to
attach)

-- 
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/20181108/60710995/attachment.html>


More information about the llvm-bugs mailing list