about summary refs log tree commit diff
path: root/elf/tst-secondarymod.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-06-30 12:53:04 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-09-15 08:56:05 -0700
commit1c810396a130fc4cc8ad0bb7d7438b58bbac6e78 (patch)
treeec708ae4de0493275fece0ef0e92f34cede3d284 /elf/tst-secondarymod.c
parent2ec11c2b6e92b3622f0dc0a970634156b286ccd8 (diff)
downloadglibc-1c810396a130fc4cc8ad0bb7d7438b58bbac6e78.tar.gz
glibc-1c810396a130fc4cc8ad0bb7d7438b58bbac6e78.tar.xz
glibc-1c810396a130fc4cc8ad0bb7d7438b58bbac6e78.zip
Add STB_SECONDARY support to ld.so
Enable STB_SECONDARY if it is supported by binutils.  Add 3 STB_SECONDARY
tests.

	* config.h.in: Add HAVE_ASM_SECONDARY_DIRECTIVE.
	* config.make.in (have-secondary): New macro.
	* configure.in: Check if STB_SECONDARY is supported by as/ld.
	Define HAVE_ASM_SECONDARY_DIRECTIVE and set have-secondary to yes
	if the .secondary assembly directive works.
	* configure: Regenerated.
	* elf/Makefile (tests): Add tst-secondary1 tst-secondary2
	tst-secondary3 if STB_SECONDARY is supported by as/ld.
	(modules-names): Add tst-secondarymod tst-secondary1mod
	tst-secondary2mod tst-secondary3mod if STB_SECONDARY is supported
	by as/ld.
	(LDFLAGS-tst-secondarymod.so): New macro.
	($(objpfx)tst-secondary1): New rule.
	($(objpfx)tst-secondary2): Likewise.
	($(objpfx)tst-secondary3): Likewise.
	* elf/dl-addr.c (determine_info): Also check STB_SECONDARY.
	* elf/dl-lookup.c (do_lookup_x): Handle STB_SECONDARY.
	(_dl_lookup_symbol_x): Likewise.
	* elf/sprof.c (read_symbols): Likewise.
	* elf/elf.h (STB_SECONDARY): New.
	(STB_NUM): Updated.
	* elf/tst-secondary.h: New file.
	* elf/tst-secondary1.c: Likewise.
	* elf/tst-secondary1mod.c: Likewise.
	* elf/tst-secondary2.c: Likewise.
	* elf/tst-secondary2mod.c: Likewise.
	* elf/tst-secondary3.c: Likewise.
	* elf/tst-secondary3mod.c: Likewise.
	* elf/tst-secondarymod.c: Likewise.
Diffstat (limited to 'elf/tst-secondarymod.c')
-rw-r--r--elf/tst-secondarymod.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/elf/tst-secondarymod.c b/elf/tst-secondarymod.c
new file mode 100644
index 0000000000..5363e99654
--- /dev/null
+++ b/elf/tst-secondarymod.c
@@ -0,0 +1,9 @@
+#include "tst-secondary.h"
+
+asm (".secondary bar");
+
+int
+bar (void)
+{
+  return SECONDARY;
+}