[llvm-bugs] [Bug 35439] New: lld produces more dynamic relocations in executable than gold

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 27 11:15:17 PST 2017


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

            Bug ID: 35439
           Summary: lld produces more dynamic relocations in executable
                    than gold
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: rafael.espindola at gmail.com
                CC: llvm-bugs at lists.llvm.org

Producing an executable with

.global _start
_start:
retq
.section        .data.rel.ro,"aw", at progbits
.quad foo
.quad foo

Where foo is defined to be a function in a .so, lld will produce

0000000000202000  0000000100000001 R_X86_64_64 0000000000000000 foo + 0
0000000000202008  0000000100000001 R_X86_64_64 0000000000000000 foo + 0

gold will produce

0000000000402000  0000000100000007 R_X86_64_JUMP_SLOT 0000000000400220 foo + 0

That is, gold uses the plt hack even when the relocation is applied to a rw
section.

I don't think lld should do this by default as now there is an unnecessary plt.
I am reporting the bug mostly to document a case where lld's output is bigger.

We would consider a command line option if someone really needs the size
saving.

-- 
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/20171127/4aa7d002/attachment-0001.html>


More information about the llvm-bugs mailing list