aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elf
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-10-08 04:39:09 -0700
committerH.J. Lu <hjl.tools@gmail.com>2018-10-08 04:39:21 -0700
commitf3e660db14a0a95f3953496d8beb7c58ef34c6d5 (patch)
treedf7402d14aa35bc2245827c6969bf1450d789be8 /ld/testsuite/ld-elf
parent64029e93683a266c38d19789e780f3748bd6a188 (diff)
downloadgdb-f3e660db14a0a95f3953496d8beb7c58ef34c6d5.zip
gdb-f3e660db14a0a95f3953496d8beb7c58ef34c6d5.tar.gz
gdb-f3e660db14a0a95f3953496d8beb7c58ef34c6d5.tar.bz2
ELF: Properly group and place orphan note sections
Properly group orphan note sections. When placing orphan note section as the first note section, place it after the section before all note sections. PR ld/23658 * ldlang.c (lang_insert_orphan): Properly group and place orphan note sections. Properly handle orphan note section before all note sections. * testsuite/ld-elf/pr23658-1.d: Renamed to ... * testsuite/ld-elf/pr23658-1a.d: This. Updated. * testsuite/ld-elf/pr23658-1b.d: New test. * testsuite/ld-elf/pr23658-1c.d: Likewise.
Diffstat (limited to 'ld/testsuite/ld-elf')
-rw-r--r--ld/testsuite/ld-elf/pr23658-1a.d (renamed from ld/testsuite/ld-elf/pr23658-1.d)6
-rw-r--r--ld/testsuite/ld-elf/pr23658-1b.d16
-rw-r--r--ld/testsuite/ld-elf/pr23658-1c.d13
3 files changed, 34 insertions, 1 deletions
diff --git a/ld/testsuite/ld-elf/pr23658-1.d b/ld/testsuite/ld-elf/pr23658-1a.d
index e21206b..5cfc7d2 100644
--- a/ld/testsuite/ld-elf/pr23658-1.d
+++ b/ld/testsuite/ld-elf/pr23658-1a.d
@@ -7,8 +7,12 @@
#readelf: -l --wide
# Since generic linker targets don't place SHT_NOTE sections as orphan,
# SHT_NOTE sections aren't grouped nor sorted.
-#xfail: cr16-* crx-* d30v-* dlx-* fr30-* frv-* ft32-* iq2000-*
+#xfail: d30v-* dlx-* fr30-* frv-*-elf ft32-* iq2000-*
#xfail: m68hc12-* mn10200-* moxie-* mt-* msp430-* pj-* xgate-*
+# The following targets don't support --build-id.
+#xfail: cr16-* crx-* visium-* xc16x-*
+# The following targets place .note.gnu.build-id in unusual places.
+#xfail: pru-*
#...
+[0-9]+ +\.note\.4 \.note\.1 +
diff --git a/ld/testsuite/ld-elf/pr23658-1b.d b/ld/testsuite/ld-elf/pr23658-1b.d
new file mode 100644
index 0000000..a8e7d16
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr23658-1b.d
@@ -0,0 +1,16 @@
+#source: pr23658-1a.s
+#source: pr23658-1b.s
+#source: pr23658-1c.s
+#source: pr23658-1d.s
+#source: start.s
+#ld:
+#readelf: -l --wide
+# Since generic linker targets don't place SHT_NOTE sections as orphan,
+# SHT_NOTE sections aren't grouped nor sorted.
+#xfail: d30v-* dlx-* fr30-* frv-*-elf ft32-* iq2000-*
+#xfail: mn10200-* moxie-* mt-* msp430-* pj-* xgate-*
+
+#...
+ +[0-9]+ +\.note\.4 \.note\.1( .note.gnu.property|) +
+ +[0-9]+ +\.note\.2 .note\.3( .note.gnu.property|) +
+#pass
diff --git a/ld/testsuite/ld-elf/pr23658-1c.d b/ld/testsuite/ld-elf/pr23658-1c.d
new file mode 100644
index 0000000..6d8fd7e
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr23658-1c.d
@@ -0,0 +1,13 @@
+#source: pr23658-1a.s
+#source: pr23658-1b.s
+#source: pr23658-1c.s
+#source: pr23658-1d.s
+#source: start.s
+#ld: --build-id -shared
+#readelf: -l --wide
+#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi
+
+#...
+ +[0-9]+ +\.note\.4 \.note\.1 +
+ +[0-9]+ +\.note.gnu.build-id \.note\.2 .note\.3 +
+#pass