aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-11-25 16:14:13 -0800
committerH.J. Lu <hjl.tools@gmail.com>2020-11-25 16:14:29 -0800
commit58349d00f461904f20dae88d48c1fda11cbb47bc (patch)
treeabac11dad512c2375cb95d025c470b7e2099f833 /ld
parent93bbe484a4fd41832383d4d781140d8cb5b18e76 (diff)
downloadgdb-58349d00f461904f20dae88d48c1fda11cbb47bc.zip
gdb-58349d00f461904f20dae88d48c1fda11cbb47bc.tar.gz
gdb-58349d00f461904f20dae88d48c1fda11cbb47bc.tar.bz2
elf: Get the real kept section
When mixing linkonce and comdat sections, we need to keep searching to get the real kept section. bfd/ PR ld/26936 * elflink.c (_bfd_elf_check_kept_section): Get the real kept section. ld/ PR ld/26936 * testsuite/ld-elf/pr26936.d: New file. * testsuite/ld-elf/pr26936a.s: Likewise. * testsuite/ld-elf/pr26936b.s: Likewise. * testsuite/ld-elf/pr26936c.s: Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/testsuite/ld-elf/pr26936.d12
-rw-r--r--ld/testsuite/ld-elf/pr26936a.s6
-rw-r--r--ld/testsuite/ld-elf/pr26936b.s11
-rw-r--r--ld/testsuite/ld-elf/pr26936c.s6
5 files changed, 43 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index d7280ef..005d54e 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,11 @@
+2020-11-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/26936
+ * testsuite/ld-elf/pr26936.d: New file.
+ * testsuite/ld-elf/pr26936a.s: Likewise.
+ * testsuite/ld-elf/pr26936b.s: Likewise.
+ * testsuite/ld-elf/pr26936c.s: Likewise.
+
2020-11-25 Alan Modra <amodra@gmail.com>
* ldlang.c (lang_output_section_statement_lookup): Change "create"
diff --git a/ld/testsuite/ld-elf/pr26936.d b/ld/testsuite/ld-elf/pr26936.d
new file mode 100644
index 0000000..b007e83
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr26936.d
@@ -0,0 +1,12 @@
+#source: pr26936a.s
+#source: pr26936b.s
+#source: pr26936c.s
+#as: -g
+#ld: -z noseparate-code -Ttext-segment 0x10000 -z max-page-size=0x1000
+#readelf: -wL
+
+#...
+CU: .*/pr26936c.s:
+File name +Line number +Starting address +View +Stmt
+pr26936c.s +6 +0x10[0-9a-f][0-9a-f][0-9a-f] +x
+#pass
diff --git a/ld/testsuite/ld-elf/pr26936a.s b/ld/testsuite/ld-elf/pr26936a.s
new file mode 100644
index 0000000..24b90da
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr26936a.s
@@ -0,0 +1,6 @@
+ .section .gnu.linkonce.t.__x86.get_pc_thunk.bx,"ax",%progbits
+ .globl __x86.get_pc_thunk.bx
+ .hidden __x86.get_pc_thunk.bx
+ .type __x86.get_pc_thunk.bx, %function
+__x86.get_pc_thunk.bx:
+ .nop
diff --git a/ld/testsuite/ld-elf/pr26936b.s b/ld/testsuite/ld-elf/pr26936b.s
new file mode 100644
index 0000000..433528c
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr26936b.s
@@ -0,0 +1,11 @@
+ .text
+ .globl _start
+_start:
+ .type _start, %function
+ .nop
+ .section .text.__x86.get_pc_thunk.bx,"axG",%progbits,__x86.get_pc_thunk.bx,comdat
+ .globl __x86.get_pc_thunk.bx
+ .hidden __x86.get_pc_thunk.bx
+ .type __x86.get_pc_thunk.bx, %function
+__x86.get_pc_thunk.bx:
+ .nop
diff --git a/ld/testsuite/ld-elf/pr26936c.s b/ld/testsuite/ld-elf/pr26936c.s
new file mode 100644
index 0000000..379cb71
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr26936c.s
@@ -0,0 +1,6 @@
+ .section .text.__x86.get_pc_thunk.bx,"axG",%progbits,__x86.get_pc_thunk.bx,comdat
+ .globl __x86.get_pc_thunk.bx
+ .hidden __x86.get_pc_thunk.bx
+ .type __x86.get_pc_thunk.bx, %function
+__x86.get_pc_thunk.bx:
+ .nop