From 54d7dae59a2239720c848985a7d50a0a8b3319eb Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 18 Jul 2019 08:01:45 -0700 Subject: ld -r: Don't merge with member of output section group When doing a relocatable link, members of input section group are placed in their own output sections. We need to make sure that no input sections are merged with member of output section group. PR ld/24819 * emultempl/elf32.em (elf_orphan_compatible): Return FALSE for member of output section group when doing a relocatable link. * testsuite/ld-elf/pr24819.d: New file. * testsuite/ld-elf/pr24819.s: Likewise. --- ld/testsuite/ld-elf/pr24819.d | 8 ++++++++ ld/testsuite/ld-elf/pr24819.s | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 ld/testsuite/ld-elf/pr24819.d create mode 100644 ld/testsuite/ld-elf/pr24819.s (limited to 'ld/testsuite') diff --git a/ld/testsuite/ld-elf/pr24819.d b/ld/testsuite/ld-elf/pr24819.d new file mode 100644 index 0000000..0a82b63 --- /dev/null +++ b/ld/testsuite/ld-elf/pr24819.d @@ -0,0 +1,8 @@ +#ld: -r +#readelf: -S --wide + +#... + \[[ 0-9]+\] \.data\.foo[ \t]+PROGBITS[ \t0-9a-f]+WAG .* +#... + \[[ 0-9]+\] \.data\.foo[ \t]+PROGBITS[ \t0-9a-f]+WA .* +#pass diff --git a/ld/testsuite/ld-elf/pr24819.s b/ld/testsuite/ld-elf/pr24819.s new file mode 100644 index 0000000..08ba2b8 --- /dev/null +++ b/ld/testsuite/ld-elf/pr24819.s @@ -0,0 +1,4 @@ + .section .data.foo,"awG",%progbits,.group1,comdat + .byte 0 + .section .data.foo,"aw",%progbits + .byte 0 -- cgit v1.1