
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.
9 lines
253 B
Raku
9 lines
253 B
Raku
SECTIONS
|
|
{
|
|
. = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS;
|
|
.rela.dyn : { *(.rela.*) }
|
|
.text : { *(.text) }
|
|
. = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
|
|
.data : { *(.data) }
|
|
/DISCARD/ : { *(.discard) }
|
|
}
|