aboutsummaryrefslogtreecommitdiff
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/elflink.c
parentIncrement the ABIVERSION to 5 for MIPS objects with non-executable stacks. (diff)
downloadbinutils-gdb-6b3b0ab89663306d17927d630304dbbd36e84570.tar.gz
binutils-gdb-6b3b0ab89663306d17927d630304dbbd36e84570.tar.bz2
binutils-gdb-6b3b0ab89663306d17927d630304dbbd36e84570.zip
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/elflink.c')
-rw-r--r--bfd/elflink.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 89a6dea7614..7d565f5d152 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))