aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-i386
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-07-05 09:24:07 -0700
committerH.J. Lu <hjl.tools@gmail.com>2018-07-05 09:24:18 -0700
commit56ad703d56ffe5dc55d5e719a6ec41fd6cf9bfbe (patch)
tree4c8d32a8c815dff426de709fd8e47f7ff894a188 /ld/testsuite/ld-i386
parentc524414837791938eb5aed58a3334c4f8e04fe4b (diff)
downloadgdb-56ad703d56ffe5dc55d5e719a6ec41fd6cf9bfbe.zip
gdb-56ad703d56ffe5dc55d5e719a6ec41fd6cf9bfbe.tar.gz
gdb-56ad703d56ffe5dc55d5e719a6ec41fd6cf9bfbe.tar.bz2
x86: Remove x86 ISA properties with empty bits
There is no need to generate x86 ISA properties with empty bits in linker output. bfd/ PR ld/23372 * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Remove x86 ISA properties with empty bits. ld/ PR ld/23372 * testsuite/ld-i386/i386.exp: Run pr23372a and pr23372b. * testsuite/ld-i386/pr23372a.d: New file. * testsuite/ld-i386/pr23372a.s: Likewise. * testsuite/ld-i386/pr23372b.d: Likewise. * testsuite/ld-i386/pr23372b.s: Likewise. * testsuite/ld-i386/pr23372c.s: Likewise. * testsuite/ld-x86-64/pr23372a-x32.d: Likewise. * testsuite/ld-x86-64/pr23372a.d: Likewise. * testsuite/ld-x86-64/pr23372a.s: Likewise. * testsuite/ld-x86-64/pr23372b-x32.d: Likewise. * testsuite/ld-x86-64/pr23372b.d: Likewise. * testsuite/ld-x86-64/pr23372b.s: Likewise. * testsuite/ld-x86-64/pr23372c.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr23372a, pr23372a-x32, pr23372b and pr23372b-x32.
Diffstat (limited to 'ld/testsuite/ld-i386')
-rw-r--r--ld/testsuite/ld-i386/i386.exp2
-rw-r--r--ld/testsuite/ld-i386/pr23372a.d5
-rw-r--r--ld/testsuite/ld-i386/pr23372a.s18
-rw-r--r--ld/testsuite/ld-i386/pr23372b.d5
-rw-r--r--ld/testsuite/ld-i386/pr23372b.s18
-rw-r--r--ld/testsuite/ld-i386/pr23372c.s18
6 files changed, 66 insertions, 0 deletions
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index bb91a76..6d794fe 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -460,6 +460,8 @@ run_dump_test "pr22782"
run_dump_test "pr22929"
run_dump_test "pr23189"
run_dump_test "pr23194"
+run_dump_test "pr23372a"
+run_dump_test "pr23372b"
if { !([istarget "i?86-*-linux*"]
|| [istarget "i?86-*-gnu*"]
diff --git a/ld/testsuite/ld-i386/pr23372a.d b/ld/testsuite/ld-i386/pr23372a.d
new file mode 100644
index 0000000..b75523b
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr23372a.d
@@ -0,0 +1,5 @@
+#source: pr23372a.s
+#source: pr23372b.s
+#as: --32
+#ld: -r -m elf_i386
+#readelf: -n
diff --git a/ld/testsuite/ld-i386/pr23372a.s b/ld/testsuite/ld-i386/pr23372a.s
new file mode 100644
index 0000000..9849d62
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr23372a.s
@@ -0,0 +1,18 @@
+ .section ".note.gnu.property", "a"
+ .p2align 2
+ .long 1f - 0f /* name length. */
+ .long 4f - 1f /* data length. */
+ /* NT_GNU_PROPERTY_TYPE_0 */
+ .long 5 /* note type. */
+0:
+ .asciz "GNU" /* vendor name. */
+1:
+ .p2align 2
+ /* GNU_PROPERTY_X86_ISA_1_USED */
+ .long 0xc0000000 /* pr_type. */
+ .long 3f - 2f /* pr_datasz. */
+2:
+ .long 0x0
+3:
+ .p2align 2
+4:
diff --git a/ld/testsuite/ld-i386/pr23372b.d b/ld/testsuite/ld-i386/pr23372b.d
new file mode 100644
index 0000000..a8e9c81
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr23372b.d
@@ -0,0 +1,5 @@
+#source: pr23372a.s
+#source: pr23372c.s
+#as: --32
+#ld: -r -m elf_i386
+#readelf: -n
diff --git a/ld/testsuite/ld-i386/pr23372b.s b/ld/testsuite/ld-i386/pr23372b.s
new file mode 100644
index 0000000..9849d62
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr23372b.s
@@ -0,0 +1,18 @@
+ .section ".note.gnu.property", "a"
+ .p2align 2
+ .long 1f - 0f /* name length. */
+ .long 4f - 1f /* data length. */
+ /* NT_GNU_PROPERTY_TYPE_0 */
+ .long 5 /* note type. */
+0:
+ .asciz "GNU" /* vendor name. */
+1:
+ .p2align 2
+ /* GNU_PROPERTY_X86_ISA_1_USED */
+ .long 0xc0000000 /* pr_type. */
+ .long 3f - 2f /* pr_datasz. */
+2:
+ .long 0x0
+3:
+ .p2align 2
+4:
diff --git a/ld/testsuite/ld-i386/pr23372c.s b/ld/testsuite/ld-i386/pr23372c.s
new file mode 100644
index 0000000..3470dce
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr23372c.s
@@ -0,0 +1,18 @@
+ .section ".note.gnu.property", "a"
+ .p2align 2
+ .long 1f - 0f /* name length. */
+ .long 4f - 1f /* data length. */
+ /* NT_GNU_PROPERTY_TYPE_0 */
+ .long 5 /* note type. */
+0:
+ .asciz "GNU" /* vendor name. */
+1:
+ .p2align 2
+ /* GNU_PROPERTY_X86_ISA_1_NEEDED */
+ .long 0xc0000001 /* pr_type. */
+ .long 3f - 2f /* pr_datasz. */
+2:
+ .long 0x0
+3:
+ .p2align 2
+4: