
The relsec size is still increased although sec is discarded, which cause a lot of unused space allocated. Avoid size increased if sec was discarded. bfd/ChangeLog: * bfd/elfnn-loongarch.c: (allocate_dynrelocs): Do not increase sreloc size when discarded_section. ld/ChangeLog: * ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp: Add test. * ld/testsuite/ld-loongarch-elf/pie_discard.d: New test. * ld/testsuite/ld-loongarch-elf/pie_discard.s: New test. * ld/testsuite/ld-loongarch-elf/pie_discard.t: New test.
10 lines
149 B
Makefile
10 lines
149 B
Makefile
#source: pie_discard.s
|
|
#ld: -pie -e 0 -T pie_discard.t
|
|
#readelf: -rW
|
|
|
|
#...
|
|
Relocation section '\.rela\.dyn' .* 1 .*
|
|
#...
|
|
.*R_LARCH_RELATIVE.*
|
|
#pass
|
|
|