This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] s390 -pie.
- From: Martin Schwidefsky <schwidefsky at de dot ibm dot com>
- To: binutils at sources dot redhat dot com
- Date: Fri, 27 Feb 2004 13:35:54 +0100
- Subject: [PATCH] s390 -pie.
Hi,
this patch for the s390* bfds is a long outstanding fix from Jakub.
I finally added this.
blue skies,
Martin.
2004-02-27 Jakub Jelinek <jakub@redhat.com>
* elf32-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL
for pc relative relocs.
(elf_s390_relocate_section): Likewise.
* elf64-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL
for pc relative relocs.
(elf_s390_relocate_section): Likewise.
diff -urN src/bfd/elf32-s390.c src-s390/bfd/elf32-s390.c
--- src/bfd/elf32-s390.c 2004-02-27 10:22:29.000000000 +0100
+++ src-s390/bfd/elf32-s390.c 2004-01-16 15:01:11.000000000 +0100
@@ -1884,9 +1884,7 @@
if (info->shared)
{
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
- && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0
- || info->symbolic))
+ if (SYMBOL_REFERENCES_LOCAL (info, h))
{
struct elf_s390_dyn_relocs **pp;
@@ -2562,10 +2560,7 @@
&& r_type != R_390_PC32DBL
&& r_type != R_390_PC32)
|| (h != NULL
- && h->dynindx != -1
- && (! info->symbolic
- || (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR) == 0))))
+ && !SYMBOL_REFERENCES_LOCAL (info, h))))
|| (ELIMINATE_COPY_RELOCS
&& !info->shared
&& h != NULL
diff -urN src/bfd/elf64-s390.c src-s390/bfd/elf64-s390.c
--- src/bfd/elf64-s390.c 2004-02-27 10:22:31.000000000 +0100
+++ src-s390/bfd/elf64-s390.c 2004-01-16 15:07:47.000000000 +0100
@@ -1855,9 +1855,7 @@
if (info->shared)
{
- if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
- && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0
- || info->symbolic))
+ if (SYMBOL_REFERENCES_LOCAL (info, h))
{
struct elf_s390_dyn_relocs **pp;
@@ -2540,10 +2538,7 @@
&& r_type != R_390_PC32DBL
&& r_type != R_390_PC64)
|| (h != NULL
- && h->dynindx != -1
- && (! info->symbolic
- || (h->elf_link_hash_flags
- & ELF_LINK_HASH_DEF_REGULAR) == 0))))
+ && !SYMBOL_REFERENCES_LOCAL (info, h))))
|| (ELIMINATE_COPY_RELOCS
&& !info->shared
&& h != NULL