public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] elf: Check symbol version without any symbols
@ 2022-01-31 20:18 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2022-01-31 20:18 UTC (permalink / raw)
  To: binutils; +Cc: Paul Pluzhnikov, Florian Weimer

VER_FLG_WEAK doesn't indicate that all symbol references of the symbol
version have STB_WEAK.  VER_FLG_WEAK indicates a weak symbol version
definition with no symbols associated with it.  It is used to verify
the existence of a particular implementation without any symbol references
to the weak symbol version.

	PR ld/24718
	* testsuite/ld-elf/pr24718-1.d: New file.
	* testsuite/ld-elf/pr24718-1.s: Likewise.
	* testsuite/ld-elf/pr24718-1.t: Likewise.
---
 ld/testsuite/ld-elf/pr24718-1.d | 13 +++++++++++++
 ld/testsuite/ld-elf/pr24718-1.s |  7 +++++++
 ld/testsuite/ld-elf/pr24718-1.t |  4 ++++
 3 files changed, 24 insertions(+)
 create mode 100644 ld/testsuite/ld-elf/pr24718-1.d
 create mode 100644 ld/testsuite/ld-elf/pr24718-1.s
 create mode 100644 ld/testsuite/ld-elf/pr24718-1.t

diff --git a/ld/testsuite/ld-elf/pr24718-1.d b/ld/testsuite/ld-elf/pr24718-1.d
new file mode 100644
index 00000000000..d8257f56f77
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr24718-1.d
@@ -0,0 +1,13 @@
+#ld: -shared -version-script pr24718-1.t
+#readelf: -V
+#target: [check_shared_lib_support]
+#xfail: hppa64-*-* tic6x-*-*
+# hppa64 uses dot-symbols, tic6x requires a non-default emulation.
+
+#...
+Version definition section '\.gnu\.version_d' contains 3 entries:
+ +Addr: 0x[0-9a-f]+ +Offset: 0x[0-9a-f]+ +Link: [0-9]+ \(\.dynstr\)
+ +000000: Rev: 1 +Flags: BASE +Index: 1 +Cnt: 1 +Name: dump
+ +0x001c: Rev: 1 +Flags: WEAK +Index: 2 +Cnt: 1 +Name: FOO_DEP
+ +0x0038: Rev: 1 +Flags: none +Index: 3 +Cnt: 1 +Name: FOO
+#pass
diff --git a/ld/testsuite/ld-elf/pr24718-1.s b/ld/testsuite/ld-elf/pr24718-1.s
new file mode 100644
index 00000000000..c7c9ee2d5bf
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr24718-1.s
@@ -0,0 +1,7 @@
+	.text
+	.globl foo
+	.globl foo
+	.type foo,%function
+foo:
+	.byte 0
+	.size foo, 1
diff --git a/ld/testsuite/ld-elf/pr24718-1.t b/ld/testsuite/ld-elf/pr24718-1.t
new file mode 100644
index 00000000000..fcbeed6e6a8
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr24718-1.t
@@ -0,0 +1,4 @@
+FOO_DEP { };
+FOO {
+  foo;
+};
-- 
2.34.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-31 20:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-31 20:18 [PATCH] elf: Check symbol version without any symbols H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).