aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-02-23 05:18:43 -0800
committerH.J. Lu <hjl.tools@gmail.com>2016-02-23 05:19:03 -0800
commit6b3b0ab89663306d17927d630304dbbd36e84570 (patch)
treeeecbc3d7e2d224602ea525556436a5fa5645d0a2 /bfd
parent17733f5be961baa7a47fdf1471aa6948372293d6 (diff)
downloadgdb-6b3b0ab89663306d17927d630304dbbd36e84570.zip
gdb-6b3b0ab89663306d17927d630304dbbd36e84570.tar.gz
gdb-6b3b0ab89663306d17927d630304dbbd36e84570.tar.bz2
Make linker assigned symbol dynamic only for shared object
Linker assigned symbols should be made dynamic by default only when creating shared object or relocatable executable. bfd/ * elflink.c (bfd_elf_record_link_assignment): Check for shared library, instead of PIC, and don't check PDE when making linker assigned symbol dynamic. ld/ * testsuite/ld-frv/fdpic-pie-6.d: Updated. * testsuite/ld-mips-elf/pie-n32.d: Likewise. * testsuite/ld-mips-elf/pie-n64.d: Likewise. * testsuite/ld-mips-elf/pie-o32.d: Likewise.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elflink.c5
2 files changed, 8 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index d7bc5fa..0ed70b4 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2016-02-23 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elflink.c (bfd_elf_record_link_assignment): Check for shared
+ library, instead of PIC, and don't check PDE when making linker
+ assigned symbol dynamic.
+
2016-02-23 Faraz Shahbazker <faraz.shahbazker@imgtec.com>
* bfd/elfxx-mips.c (_bfd_mips_post_process_headers): Increment
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 89a6dea..7d565f5 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -632,9 +632,8 @@ bfd_elf_record_link_assignment (bfd *output_bfd,
if ((h->def_dynamic
|| h->ref_dynamic
- || bfd_link_pic (info)
- || (bfd_link_pde (info)
- && elf_hash_table (info)->is_relocatable_executable))
+ || bfd_link_dll (info)
+ || elf_hash_table (info)->is_relocatable_executable)
&& h->dynindx == -1)
{
if (! bfd_elf_link_record_dynamic_symbol (info, h))