PATCH: Support STT_GNU_IFUNC for .set
H.J. Lu
hongjiu.lu@intel.com
Fri May 22 18:11:00 GMT 2009
Hi,
I am checking in this patch to support STT_GNU_IFUNC for .set as an
obvious fix. Tested on Linux/ia32, Linux/x86-64 and Linux/ia64.
Thanks.
H.J.
---
gas/
2009-05-22 H.J. Lu <hongjiu.lu@intel.com>
* symbols.c (COPIED_SYMFLAGS): Add BSF_GNU_INDIRECT_FUNCTION.
gas/testsuite/gas/
2009-05-22 H.J. Lu <hongjiu.lu@intel.com>
* gas/elf/ifunc-1.d: New.
* gas/elf/ifunc-1.s: Likewise.
* gas/elf/elf.exp: Run ifunc-1.
Index: testsuite/gas/elf/ifunc-1.d
===================================================================
--- testsuite/gas/elf/ifunc-1.d (revision 0)
+++ testsuite/gas/elf/ifunc-1.d (revision 0)
@@ -0,0 +1,7 @@
+#readelf: -s
+#name: .set with IFUNC
+
+#...
+[ ]+[0-9]+:[ ]+[0-9a-f]+[ ]+[0-9]+[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+[1-9] __GI_foo
+[ ]+[0-9]+:[ ]+[0-9a-f]+[ ]+[0-9]+[ ]+IFUNC[ ]+GLOBAL[ ]+DEFAULT[ ]+[1-9] foo
+#pass
Index: testsuite/gas/elf/elf.exp
===================================================================
--- testsuite/gas/elf/elf.exp (revision 5861)
+++ testsuite/gas/elf/elf.exp (working copy)
@@ -125,6 +125,7 @@ if { ([istarget "*-*-*elf*"]
|| [istarget "xscale*-*-*"]} then {
run_elf_list_test "type-noifunc" "" "" "-s" "| grep \"1 \\\[FONTC\\\]\""
} else {
+ run_dump_test ifunc-1
run_elf_list_test "type" "" "" "-s" "| grep \"1 \\\[FIONTC\\\]\""
}
Index: testsuite/gas/elf/ifunc-1.s
===================================================================
--- testsuite/gas/elf/ifunc-1.s (revision 0)
+++ testsuite/gas/elf/ifunc-1.s (revision 0)
@@ -0,0 +1,9 @@
+.globl __GI_foo
+ .set __GI_foo, foo
+ .text
+.globl foo
+ .type foo, %function
+foo:
+ .byte 0x0
+ .size foo, .-foo
+ .type foo, %gnu_indirect_function
Index: symbols.c
===================================================================
--- symbols.c (revision 5861)
+++ symbols.c (working copy)
@@ -1948,7 +1948,8 @@ copy_symbol_attributes (symbolS *dest, s
/* In an expression, transfer the settings of these flags.
The user can override later, of course. */
-#define COPIED_SYMFLAGS (BSF_FUNCTION | BSF_OBJECT)
+#define COPIED_SYMFLAGS (BSF_FUNCTION | BSF_OBJECT \
+ | BSF_GNU_INDIRECT_FUNCTION)
dest->bsym->flags |= src->bsym->flags & COPIED_SYMFLAGS;
#ifdef OBJ_COPY_SYMBOL_ATTRIBUTES
More information about the Libc-alpha
mailing list