aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-gc
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-gc')
-rw-r--r--ld/testsuite/ld-gc/abi-note.d8
-rw-r--r--ld/testsuite/ld-gc/abi-note.s15
-rw-r--r--ld/testsuite/ld-gc/gc.exp3
3 files changed, 25 insertions, 1 deletions
diff --git a/ld/testsuite/ld-gc/abi-note.d b/ld/testsuite/ld-gc/abi-note.d
new file mode 100644
index 0000000..e802fe5
--- /dev/null
+++ b/ld/testsuite/ld-gc/abi-note.d
@@ -0,0 +1,8 @@
+#name: --gc-sections with note section
+#ld: --gc-sections -e _start
+#readelf: -S --wide
+#target: *-*-linux*
+
+#...
+.* .note.ABI-tag[ ]+NOTE.*
+#...
diff --git a/ld/testsuite/ld-gc/abi-note.s b/ld/testsuite/ld-gc/abi-note.s
new file mode 100644
index 0000000..22536c0
--- /dev/null
+++ b/ld/testsuite/ld-gc/abi-note.s
@@ -0,0 +1,15 @@
+ .text
+ .global _start
+_start:
+ .long 1
+
+ .section ".note.ABI-tag", "a"
+ .p2align 2
+ .long 1f - 0f /* name length */
+ .long 3f - 2f /* data length */
+ .long 1 /* note type */
+0: .asciz "GNU" /* vendor name */
+1: .p2align 2
+2: .long 1
+ .long 2
+3: .p2align 2 /* pad out section */
diff --git a/ld/testsuite/ld-gc/gc.exp b/ld/testsuite/ld-gc/gc.exp
index c85d4f2..36df233 100644
--- a/ld/testsuite/ld-gc/gc.exp
+++ b/ld/testsuite/ld-gc/gc.exp
@@ -1,5 +1,5 @@
# Expect script for ld-gc tests
-# Copyright 2008, 2009
+# Copyright 2008, 2009, 2010
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
@@ -90,3 +90,4 @@ test_gc "Check --gc-section/-r/-e" "gcrel" $ld "-r --gc-sections -e main"
test_gc "Check --gc-section/-r/-u" "gcrel" $ld "-r --gc-sections -u used_func"
run_dump_test "noent"
+run_dump_test "abi-note"