aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-06-07 21:18:01 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-06-08 03:53:43 -0700
commit6322e5c5cb7ffe1c26c50f117765503717b0431c (patch)
tree278fe5c87998fc591d6c4c8c81f7c74cc0f1101e /ld
parent51fa2693add9ead8288f475d380f4aec7372fe5a (diff)
downloadgdb-6322e5c5cb7ffe1c26c50f117765503717b0431c.zip
gdb-6322e5c5cb7ffe1c26c50f117765503717b0431c.tar.gz
gdb-6322e5c5cb7ffe1c26c50f117765503717b0431c.tar.bz2
x86: Dump local IFUNC functions in the map file
Dump local IFUNC functions in the map file when generating IRELATIVE relocations if -Map is used. bfd/ * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol name. Use local IFUNC symbol name string to report unsupported non-PIC call to IFUNC function. (elf_i386_relocate_section): Dump local IFUNC name with minfo when generating R_386_IRELATIVE relocation. (elf_i386_finish_dynamic_symbol): Likewise. * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local IFUNC symbol name. (elf_x86_64_relocate_section): Dump local IFUNC name with minfo when generating R_X86_64_IRELATIVE relocation. (elf_x86_64_finish_dynamic_symbol): Likewise. ld/ * testsuite/ld-ifunc/ifunc-1-local-x86.d: Pass "-Map tmpdir/ifunc-1-local-x86.map" to ld and check ifunc-1-local-x86.map. * testsuite/ld-ifunc/ifunc-1-x86.d: Pass "-Map tmpdir/ifunc-1-x86.map" to ld and check ifunc-1-x86.map. * testsuite/ld-ifunc/ifunc-1-local-x86.map: New file. * testsuite/ld-ifunc/ifunc-1-x86.map: Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-1-local-x86.d3
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-1-local-x86.map3
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-1-x86.d3
-rw-r--r--ld/testsuite/ld-ifunc/ifunc-1-x86.map3
4 files changed, 10 insertions, 2 deletions
diff --git a/ld/testsuite/ld-ifunc/ifunc-1-local-x86.d b/ld/testsuite/ld-ifunc/ifunc-1-local-x86.d
index 00bc474..c14cd28 100644
--- a/ld/testsuite/ld-ifunc/ifunc-1-local-x86.d
+++ b/ld/testsuite/ld-ifunc/ifunc-1-local-x86.d
@@ -1,6 +1,7 @@
-#ld: -shared
+#ld: -shared -Map tmpdir/ifunc-1-local-x86.map
#objdump: -dw
#target: x86_64-*-* i?86-*-*
+#map: ifunc-1-local-x86.map
#...
[ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-fq]+<\*ABS\*(\+0x160|\+0x170|\+0x1e0|)@plt>
diff --git a/ld/testsuite/ld-ifunc/ifunc-1-local-x86.map b/ld/testsuite/ld-ifunc/ifunc-1-local-x86.map
new file mode 100644
index 0000000..557a446
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-1-local-x86.map
@@ -0,0 +1,3 @@
+#...
+Local IFUNC function `__GI_foo' in tmpdir/ifunc-1-local-x86.o
+#pass
diff --git a/ld/testsuite/ld-ifunc/ifunc-1-x86.d b/ld/testsuite/ld-ifunc/ifunc-1-x86.d
index f9dee1b..c245758 100644
--- a/ld/testsuite/ld-ifunc/ifunc-1-x86.d
+++ b/ld/testsuite/ld-ifunc/ifunc-1-x86.d
@@ -1,6 +1,7 @@
-#ld: -shared
+#ld: -shared -Map tmpdir/ifunc-1-x86.map
#objdump: -dw
#target: x86_64-*-* i?86-*-*
+#map: ifunc-1-x86.map
#...
[ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-fq]+<\*ABS\*(\+0x170|\+0x190|\+0x210|)@plt>
diff --git a/ld/testsuite/ld-ifunc/ifunc-1-x86.map b/ld/testsuite/ld-ifunc/ifunc-1-x86.map
new file mode 100644
index 0000000..98bbb7a
--- /dev/null
+++ b/ld/testsuite/ld-ifunc/ifunc-1-x86.map
@@ -0,0 +1,3 @@
+#...
+Local IFUNC function `__GI_foo' in tmpdir/ifunc-1-x86.o
+#pass