+2015-01-11 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/17827
+ * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): For PIE,
+ only discard space for pc-relative relocs symbols which turn
+ out to need copy relocs.
+
2015-01-09 Nick Clifton <nickc@redhat.com>
* tekhex.c (getvalue): Fix thinko in test for correct extraction
&& ! bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
}
- /* For PIE, discard space for relocs against symbols which
- turn out to need copy relocs. */
+ /* For PIE, discard space for pc-relative relocs against
+ symbols which turn out to need copy relocs. */
else if (info->executable
&& (h->needs_copy || eh->needs_copy)
&& h->def_dynamic
&& !h->def_regular)
- eh->dyn_relocs = NULL;
+ {
+ struct elf_dyn_relocs **pp;
+
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
+ {
+ if (p->pc_count != 0)
+ *pp = p->next;
+ else
+ pp = &p->next;
+ }
+ }
}
}
else if (ELIMINATE_COPY_RELOCS)
+2015-01-11 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/17827
+ * ld-x86-64/pr17689.out: Updated.
+ * ld-x86-64/pr17689b.S: Likewise.
+
+ * ld-x86-64/pr17827.rd: New file.
+
+ * ld-x86-64/x86-64.exp: Run PR ld/17827 test.
+
2015-01-08 Jan Beulich <jbeulich@suse.com>
* ld-x86-64/pr14207.d: Adjust expecations to cover the
subq $8, %rsp
movq bar_alias(%rip), %rdi
call foo@PLT
+ movq ptr(%rip), %rax
+ movq (%rax), %rdi
+ call foo@PLT
xorl %eax, %eax
addq $8, %rsp
ret
.size main, .-main
+ .globl ptr
+ .section .data.rel,"aw",@progbits
+ .align 8
+ .type ptr, @object
+ .size ptr, 8
+ptr:
+ .quad bar_alias
.section .note.GNU-stack,"",@progbits
--- /dev/null
+#failif
+#...
+[0-9a-f ]+R_X86_64_NONE.*
+#...
{{readelf {-Wr} pr17689.rd}} \
"pr17689" \
] \
+ [list \
+ "Build pr17827 with PIE without -fPIE" \
+ "tmpdir/pr17689.so -pie" \
+ "" \
+ { pr17689b.S } \
+ {{readelf {-Wr} pr17827.rd}} \
+ "pr17827" \
+ ] \
]
run_ld_link_exec_tests [] [list \