https://bugs.llvm.org/show_bug.cgi?id=43997
Bug ID: 43997
Summary: [LLD/ELF] LLD change inflates elf binary size when
linked with no-rosegment
Product: lld
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: ELF
Assignee: unassignedb...@nondot.org
Reporter: de...@google.com
CC: llvm-bugs@lists.llvm.org, peter.sm...@linaro.org
Created attachment 22811
--> https://bugs.llvm.org/attachment.cgi?id=22811&action=edit
qemu reproducible tarball
The problem was discovered when the elf binary size of some packages after llvm
toolchain update has drastically increased.
The binaries were built with ld.lld --no-rosegment.
For example qemu_x86_64 elf binary size changed from 4MB to 1.6GB.
After bisection I located the commit which introduced the problem:
06bb7dfbd445fe928b0ae0263ba9df1acd861c41
[ELF] Map the ELF header at imageBase
Here is the difference of readelf before and after the commit:
BEFORE:
-------------------------
$ readelf --sections --wide qemu-x86_64
Section Headers:
[Nr] Name Type Address Off Size ES Flg
Lk Inf Al
[ 0] NULL 0000000000000000 000000 000000 00
0 0 0
[ 1] .text PROGBITS 0000000060000000 001000 245dc6 00 AX
0 0 32
AFTER:
-------------------------
$ readelf --sections qemu-x86_64
Section Headers:
[Nr] Name Type Address Off Size ES Flg
Lk Inf Al
[ 0] NULL 0000000000000000 000000 000000 00
0 0 0
[ 1] .text PROGBITS 0000000060000000 5fe00000 245dc6 00
AX 0 0 32
Steps to reproduce:
tar -axf qemu.tar && cd qemu
ld.lld @response.txt
ls -lh qemu-x86_64
readelf --sections --wide qemu-x86_64
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs