aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog9
-rw-r--r--bfd/elf32-i386.c7
-rw-r--r--bfd/elf64-x86-64.c7
3 files changed, 17 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 2bb0cc1..740fd44 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,14 @@
2016-03-15 H.J. Lu <hongjiu.lu@intel.com>
+ PR ld/19827
+ * elf32-i386.c (elf_i386_check_relocs): Bind defined symbol
+ locally in PIE.
+ (elf_i386_relocate_section): Likewise.
+ * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
+ (elf_x86_64_relocate_section): Likewise.
+
+2016-03-15 H.J. Lu <hongjiu.lu@intel.com>
+
PR ld/19807
* elf64-x86-64.c (elf_x86_64_relocate_section): Check
no_reloc_overflow_check to diable R_X86_64_32/R_X86_64_32S
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index ac3c2f4..1ebb615 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -1874,7 +1874,8 @@ do_size:
&& (sec->flags & SEC_ALLOC) != 0
&& (r_type != R_386_PC32
|| (h != NULL
- && (! SYMBOLIC_BIND (info, h)
+ && (! (bfd_link_pie (info)
+ || SYMBOLIC_BIND (info, h))
|| h->root.type == bfd_link_hash_defweak
|| !h->def_regular))))
|| (ELIMINATE_COPY_RELOCS
@@ -4431,8 +4432,8 @@ r_386_got32:
else if (h != NULL
&& h->dynindx != -1
&& (r_type == R_386_PC32
- || !bfd_link_pic (info)
- || !SYMBOLIC_BIND (info, h)
+ || !(bfd_link_executable (info)
+ || SYMBOLIC_BIND (info, h))
|| !h->def_regular))
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
else
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 31b1f87..dc7738a 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -2073,7 +2073,8 @@ do_size:
&& (sec->flags & SEC_ALLOC) != 0
&& (! IS_X86_64_PCREL_TYPE (r_type)
|| (h != NULL
- && (! SYMBOLIC_BIND (info, h)
+ && (! (bfd_link_pie (info)
+ || SYMBOLIC_BIND (info, h))
|| h->root.type == bfd_link_hash_defweak
|| !h->def_regular))))
|| (ELIMINATE_COPY_RELOCS
@@ -4830,8 +4831,8 @@ direct:
else if (h != NULL
&& h->dynindx != -1
&& (IS_X86_64_PCREL_TYPE (r_type)
- || ! bfd_link_pic (info)
- || ! SYMBOLIC_BIND (info, h)
+ || !(bfd_link_executable (info)
+ || SYMBOLIC_BIND (info, h))
|| ! h->def_regular))
{
if ((r_type != R_X86_64_PC64 && r_type != R_X86_64_64)