aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-xtensa
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2019-03-28 17:03:57 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2019-03-29 10:02:10 -0700
commit2487ef07c28b961c6e2b8c51161f88f93b181d07 (patch)
treeb1e5e978b0105e99f0cc2d3d5a15dad4ed1bef42 /ld/testsuite/ld-xtensa
parent5f33607b284323ac71fb5b6864ce2fa671379dfc (diff)
downloadgdb-2487ef07c28b961c6e2b8c51161f88f93b181d07.zip
gdb-2487ef07c28b961c6e2b8c51161f88f93b181d07.tar.gz
gdb-2487ef07c28b961c6e2b8c51161f88f93b181d07.tar.bz2
bfd: xtensa: fix shrink_dynamic_reloc_sections for export-dynamic
shrink_dynamic_reloc_sections must remove PLT entry that was created for an undefined weak symbol in the presence of --export-dynamic option when relaxation coalesces literals pointing to that symbol. This fixes the following assertion: ld: BFD (GNU Binutils) 2.31.1 internal error, aborting at elf32-xtensa.c:3292 in elf_xtensa_finish_dynamic_sections 2019-03-29 Max Filippov <jcmvbkbc@gmail.com> bfd/ * elf32-xtensa.c (shrink_dynamic_reloc_sections): Add info->export_dynamic to the conditional. ld/ * testsuite/ld-xtensa/relax-undef-weak-pie-export-dynamic.d: New test definition. * testsuite/ld-xtensa/xtensa.exp (relax-undef-weak-pie-export-dynamic): Add new test.
Diffstat (limited to 'ld/testsuite/ld-xtensa')
-rw-r--r--ld/testsuite/ld-xtensa/relax-undef-weak-pie-export-dynamic.d14
-rw-r--r--ld/testsuite/ld-xtensa/xtensa.exp1
2 files changed, 15 insertions, 0 deletions
diff --git a/ld/testsuite/ld-xtensa/relax-undef-weak-pie-export-dynamic.d b/ld/testsuite/ld-xtensa/relax-undef-weak-pie-export-dynamic.d
new file mode 100644
index 0000000..e2ff601
--- /dev/null
+++ b/ld/testsuite/ld-xtensa/relax-undef-weak-pie-export-dynamic.d
@@ -0,0 +1,14 @@
+#source: relax-undef-weak.s
+#ld: -pie --export-dynamic
+#readelf: -r
+#...
+Relocation section '\.rela\.dyn' .* 3 .*
+#...
+.*R_XTENSA_RTLD.*
+.*R_XTENSA_RTLD.*
+.*R_XTENSA_GLOB_DAT.*fd.*
+#...
+Relocation section '\.rela\.plt' .* 1 .*
+#...
+.*R_XTENSA_JMP_SLOT.*fd.*
+#...
diff --git a/ld/testsuite/ld-xtensa/xtensa.exp b/ld/testsuite/ld-xtensa/xtensa.exp
index 91b2314..d800c64 100644
--- a/ld/testsuite/ld-xtensa/xtensa.exp
+++ b/ld/testsuite/ld-xtensa/xtensa.exp
@@ -34,6 +34,7 @@ run_dump_test "relax-static-shared"
run_dump_test "relax-static-local-shared"
run_dump_test "relax-undef-weak-pie"
+run_dump_test "relax-undef-weak-pie-export-dynamic"
run_dump_test "relax-undef-weak-local-pie"
run_dump_test "relax-undef-weak-shared"
run_dump_test "relax-undef-weak-local-shared"