This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Max pagesize differences between gold and bfd
- From: Steve Vormwald <sdvormwa at cray dot com>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Mon, 11 Mar 2019 20:25:47 +0000
- Subject: Max pagesize differences between gold and bfd
I'm seeing a massive increase in file size for using a large (512M) max page size with gold versus bfd:
$ cat empty.c
int main() {}
$ gcc -Wl,-zmax-page-size=0x20000000,-Ttext-segment=0x20000000 empty.c -o a.out.bfd
$ gcc -Wl,-zmax-page-size=0x20000000,-Ttext-segment=0x20000000 -fuse-ld=gold empty.c -o a.out.gold
$ ls -lh a.out.*
-rwxr-xr-x 1 $USER $GROUP 12K Mar 11 15:01 a.out.bfd
-rwxr-xr-x 1 $USER $GROUP 513M Mar 11 15:01 a.out.gold
Looking at the output files, it looks like gold is inserting a lot of unnecessary padding. Is this intentional? If so, is there any way to avoid that padding and get output similar to that produced by the bfd linker?
Steven Vormwald