binutils-gdb/ld/testsuite/ld-loongarch-elf/pie_discard.d
Jinyang He fb266c9083 Avoid unused space in .rela.dyn if sec was discarded
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.
2024-02-27 11:58:33 +08:00

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