elf: Don't merge sections with different SHF_LINK_ORDER
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 30 Aug 2023 17:24:56 +0000 (10:24 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 31 Aug 2023 00:17:31 +0000 (17:17 -0700)
commit68a2d9bf874643da970fe945a9c60c397f6882ad
tree60eaddb169ea2d0e6e51cdcfc05b3e8200fefc8c
parentbac5753ca24bbbd601b6be93faa40e9458d8baa5
elf: Don't merge sections with different SHF_LINK_ORDER

For relocatable link, don't merge 2 SHF_LINK_ORDER sections if output
sections of their linked to sections are different.

* ldelf.c (elf_orphan_compatible): Don't merge sections with
different SHF_LINK_ORDER.
* testsuite/ld-elf/pr30791a.d: New file.
* testsuite/ld-elf/pr30791a.s: Likewise.
* testsuite/ld-elf/pr30791b.d: Likewise.
* testsuite/ld-elf/pr30791b.s: Likewise.
* testsuite/ld-elf/pr30791c.s: Likewise.
* testsuite/ld-elf/pr30791d.s: Likewise.
ld/ldelf.c
ld/testsuite/ld-elf/pr30791a.d [new file with mode: 0644]
ld/testsuite/ld-elf/pr30791a.s [new file with mode: 0644]
ld/testsuite/ld-elf/pr30791b.d [new file with mode: 0644]
ld/testsuite/ld-elf/pr30791b.s [new file with mode: 0644]
ld/testsuite/ld-elf/pr30791c.s [new file with mode: 0644]
ld/testsuite/ld-elf/pr30791d.s [new file with mode: 0644]