]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Avoid unused space in .rela.dyn if sec was discarded
authorJinyang He <hejinyang@loongson.cn>
Fri, 15 Sep 2023 03:52:14 +0000 (11:52 +0800)
committerliuzhensong <liuzhensong@loongson.cn>
Tue, 27 Feb 2024 03:58:33 +0000 (11:58 +0800)
commitfb266c9083b42d6287b2fe93a82ffe663d8f4640
tree99ee60765091fa516de8a18701a148cdcd6fa253
parentb98da8583a500419c976bcfd56b80b02b1afceff
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.
bfd/elfnn-loongarch.c
ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp
ld/testsuite/ld-loongarch-elf/pie_discard.d [new file with mode: 0644]
ld/testsuite/ld-loongarch-elf/pie_discard.s [new file with mode: 0644]
ld/testsuite/ld-loongarch-elf/pie_discard.t [new file with mode: 0644]