[llvm-bugs] [Bug 43552] New: ld -export-dynamic -r should probably ignore the -export-dynamic

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 3 18:53:21 PDT 2019


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

            Bug ID: 43552
           Summary: ld  -export-dynamic -r should probably ignore the
                    -export-dynamic
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: rafael at espindo.la
                CC: llvm-bugs at lists.llvm.org, peter.smith at linaro.org

The dpdk build system gets its flags confused and passes -export-dynamic to "ld
-r".

It looks like bfd ignores -export-dynamic when used with -r, but lld doesn't.
The output produced by lld is relocatable, but has a .dynsym.

If that file is then passed to lld, it gets confused and produces a program
that crashes at startup.

$ cat test.s
.globl _start
_start:
          mov $60, %rax
          mov $0, %rdi
          syscall

$ clang -c test.s
$ ld.lld -export-dynamic -r -o lld.o test.o
$ ld.lld -dynamic-linker /lib64/ld-linux-x86-64.so.2 /lib64/libgcc_s.so.1 lld.o
-o test.lld
$ ./test.lld
./run.sh: line 10: 106569 Segmentation fault      (core dumped) ./test.lld

-- 
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/20191004/5ce5953a/attachment.html>


More information about the llvm-bugs mailing list