aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2021-04-28 11:49:09 +0100
committerNick Clifton <nickc@redhat.com>2021-04-28 11:49:09 +0100
commit24aebc79b16a82faef4736f4abdc7e4d95d4cc67 (patch)
treeea49e9d39592b298a0ed0297a2163a77b98cbc1e /ld
parentedeaceda7b2f33b2c3bf78c732e67f3188e7f0b9 (diff)
downloadgdb-24aebc79b16a82faef4736f4abdc7e4d95d4cc67.zip
gdb-24aebc79b16a82faef4736f4abdc7e4d95d4cc67.tar.gz
gdb-24aebc79b16a82faef4736f4abdc7e4d95d4cc67.tar.bz2
Stop the BFD library from treating annobin symbols as potential function symbols.
bfd * elf.c (_bfd_elf_maybe_function_sym): Do not accept annobin symbols as potential function symbols. * elfnn-aarch64.c (elfNN_aarch64_maybe_function_sym): Likewise. * elf64-ppc.c (ppc64_elf_maybe_function_sym): Likewise. * elf32-arm.c (elf32_arm_maybe_function_sym): Likewise. ld * testsuite/ld-elf/anno-sym.s: New test source file. * testsuite/ld-elf/anno-sym.d: New test driver. * testsuite/ld-elf/anno-sym.l: New test error output.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog6
-rw-r--r--ld/testsuite/ld-elf/anno-sym.d5
-rw-r--r--ld/testsuite/ld-elf/anno-sym.l4
-rw-r--r--ld/testsuite/ld-elf/anno-sym.s13
4 files changed, 28 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 9bb178e..3c4bec5 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2021-04-28 Nick Clifton <nickc@redhat.com>
+
+ * testsuite/ld-elf/anno-sym.s: New test source file.
+ * testsuite/ld-elf/anno-sym.d: New test driver.
+ * testsuite/ld-elf/anno-sym.l: New test error output.
+
2021-04-26 Jan Beulich <jbeulich@suse.com>
* testsuite/ld-i386/pcrel16-2.s, testsuite/ld-i386/pcrel16-2.d,
diff --git a/ld/testsuite/ld-elf/anno-sym.d b/ld/testsuite/ld-elf/anno-sym.d
new file mode 100644
index 0000000..9e53c4a
--- /dev/null
+++ b/ld/testsuite/ld-elf/anno-sym.d
@@ -0,0 +1,5 @@
+# Check that linking anno-sym.o produces an undefined reference message referring to '_start' and not 'annobin_hello.c'
+#ld: -e _start
+#error_output: anno-sym.l
+# The mips-irix6 target fails this test because it does not find any function symbols. Not sure why.
+#skip: *-*-irix*
diff --git a/ld/testsuite/ld-elf/anno-sym.l b/ld/testsuite/ld-elf/anno-sym.l
new file mode 100644
index 0000000..ee9611a
--- /dev/null
+++ b/ld/testsuite/ld-elf/anno-sym.l
@@ -0,0 +1,4 @@
+#...
+.*: in function `(|_)start':
+.*: undefined reference to `foo'
+#pass
diff --git a/ld/testsuite/ld-elf/anno-sym.s b/ld/testsuite/ld-elf/anno-sym.s
new file mode 100644
index 0000000..0e4b5aa
--- /dev/null
+++ b/ld/testsuite/ld-elf/anno-sym.s
@@ -0,0 +1,13 @@
+ .text
+
+ .hidden .annobin_hello.c
+ .type .annobin_hello.c, STT_NOTYPE
+ .equiv .annobin_hello.c, .
+ .size .annobin_hello.c, 0
+
+ .global _start
+_start:
+ .nop
+ .align 4
+ .dc.a foo
+