aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-04-21 12:00:55 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-04-21 12:01:05 -0700
commit3c5fce9bc29b216af7d10f8d6e4d8c3f11a48359 (patch)
tree94a9137c5a3cfabb589c090994f03fd98704ed66 /bfd
parent0d4c07afb1e5e37e8e296858f8b14a3b4adf950b (diff)
downloadgdb-3c5fce9bc29b216af7d10f8d6e4d8c3f11a48359.zip
gdb-3c5fce9bc29b216af7d10f8d6e4d8c3f11a48359.tar.gz
gdb-3c5fce9bc29b216af7d10f8d6e4d8c3f11a48359.tar.bz2
Require --no-dynamic-linker with -static -E/--dynamic-list
When -static -E/--dynamic-list are passed to linker, linker may create executable with dynamic sections which aren't supported by run-time. We require --no-dynamic-linker together with -static -E/--dynamic-list before adding dynamic symbol table to static executable. bfd/ PR ld/19617 PR ld/21086 * elflink.c (elf_link_add_object_symbols): Require --no-dynamic-linker with -E/--dynamic-list when creating dynamic sections. ld/ PR ld/19617 PR ld/21086 * testsuite/ld-elf/pr19617a.d: Pass --no-dynamic-linker to ld. * testsuite/ld-elf/pr19617b.d: Likewise. * testsuite/ld-elf/pr19617c.d: Likewise. *testsuite/ld-i386/pr19636-4d.d: Likewise. * testsuite/ld-elf/readelf.exp: Pass --no-dynamic-linker to ld with --export-dynamic. * testsuite/ld-elf/shared.exp: Pass --no-dynamic-linker to ld with -E.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/elflink.c1
2 files changed, 9 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ac80a44..4576020 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,11 @@
+2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/19617
+ PR ld/21086
+ * elflink.c (elf_link_add_object_symbols): Require
+ --no-dynamic-linker with -E/--dynamic-list when creating
+ dynamic sections.
+
2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
* elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 330fad7..0d42c4c 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -3851,6 +3851,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
if (!just_syms
&& (bfd_link_pic (info)
|| (!bfd_link_relocatable (info)
+ && info->nointerp
&& (info->export_dynamic || info->dynamic)))
&& is_elf_hash_table (htab)
&& info->output_bfd->xvec == abfd->xvec