aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2003-05-05 08:50:43 +0000
committerAndreas Jaeger <aj@suse.de>2003-05-05 08:50:43 +0000
commit4bc6e03a51b7b718a385253d4b7e9fb9ab213880 (patch)
treedbbfc10a83db3aa5709feb9246c0586a8a64f82e /bfd
parent5c7966bf11880ce5fce16f9ec006266bd0683490 (diff)
downloadgdb-4bc6e03a51b7b718a385253d4b7e9fb9ab213880.zip
gdb-4bc6e03a51b7b718a385253d4b7e9fb9ab213880.tar.gz
gdb-4bc6e03a51b7b718a385253d4b7e9fb9ab213880.tar.bz2
* elf64-x86-64.c (allocate_dynrelocs): Don't allocate dynamic
relocation entries for weak undefined symbols with non-default visibility. (elf64_x86_64_relocate_section): Initialize the GOT entries and skip R_386_32/R_386_PC32 for weak undefined symbols with non-default visibility.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog9
-rw-r--r--bfd/elf64-x86-64.c15
2 files changed, 21 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e209e3d..42c07e8 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,12 @@
+2003-05-05 Andreas Jaeger <aj@suse.de>
+
+ * elf64-x86-64.c (allocate_dynrelocs): Don't allocate dynamic
+ relocation entries for weak undefined symbols with non-default
+ visibility.
+ (elf64_x86_64_relocate_section): Initialize the GOT entries and
+ skip R_386_32/R_386_PC32 for weak undefined symbols with
+ non-default visibility.
+
2003-05-04 H.J. Lu <hjl@gnu.org>
* elf32-i386.c (allocate_dynrelocs): Don't allocate dynamic
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 5ed6b51..f8d2a0c 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -1396,7 +1396,9 @@ allocate_dynrelocs (h, inf)
return FALSE;
}
- if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h))
+ if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
+ && WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h))
{
asection *s = htab->splt;
@@ -1478,7 +1480,9 @@ allocate_dynrelocs (h, inf)
htab->srelgot->_raw_size += sizeof (Elf64_External_Rela);
else if (tls_type == GOT_TLS_GD)
htab->srelgot->_raw_size += 2 * sizeof (Elf64_External_Rela);
- else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
+ else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
+ && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
htab->srelgot->_raw_size += sizeof (Elf64_External_Rela);
}
else
@@ -1976,7 +1980,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
&& (info->symbolic
|| h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+ && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+ || (ELF_ST_VISIBILITY (h->other)
+ && h->root.type == bfd_link_hash_undefweak))
{
/* This is actually a static link, or it is a -Bsymbolic
link and the symbol is defined locally, or the symbol
@@ -2095,6 +2101,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
break;
if ((info->shared
+ && (h == NULL
+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
&& ((r_type != R_X86_64_PC8
&& r_type != R_X86_64_PC16
&& r_type != R_X86_64_PC32)