[llvm-bugs] [Bug 37257] New: Significant binary section size differences between ld.lld and ld.bfd
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Apr 26 11:12:13 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=37257
Bug ID: 37257
Summary: Significant binary section size differences between
ld.lld and ld.bfd
Product: lld
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: ELF
Assignee: unassignedbugs at nondot.org
Reporter: ppadevski at gmail.com
CC: llvm-bugs at lists.llvm.org
Hi,
I'm not a linker expert but I tried replacing ld.bfd with ld.lld today and
noticed a couple of differences.
For executables there isn't much difference
text data bss dec hex filename
25679274 1969696 240249 27889219 1a98e43 exe+ld.bfd
25716658 1963032 238542 27918232 1a9ff98 exe+ld.lld
+37384 -6664 -1707 +29013
For shared libraries, however, the difference is
text data bss dec hex filename
31035525 3179176 46736 34261437 20ac9bd so+ld.bfd
31419721 3185072 46736 34651529 210bd89 so+ld.lld
+384196 +5896 0 +390092
If we take a look at both libraries via 'size -A', we'll see two differences.
so+ld.lld
section size
.hash 746520
.rela.plt 427296
so+ld.bfd
section size
.hash 504348
Both libraries and executables are linked with full RELRO (z relro, z now).
If I omit 'z now' when linking with the shared library with ld.bfd I can see
so+ld.bfd
section size
.hash 504348
.rela.plt 427272
I have two questions:
1. Is there a way for the .hash section produced by lld to get smaller or is it
more efficient this way?
2. Is there a way to get rid of the .rela.plt section when linking with lld or
is it really needed?
--
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/20180426/216223ca/attachment.html>
More information about the llvm-bugs
mailing list