summaryrefslogtreecommitdiff
path: root/bfd/elf32-s390.c
diff options
context:
space:
mode:
authorAndreas Krebbel <Andreas.Krebbel@de.ibm.com>2009-03-20 12:57:15 +0000
committerAndreas Krebbel <Andreas.Krebbel@de.ibm.com>2009-03-20 12:57:15 +0000
commit45992ef9b8af2d7429e5d3f2fd90f55619f43762 (patch)
tree00e43cb4e7cd0b56bf329e4aad5bbf1917f3ab7e /bfd/elf32-s390.c
parent60e649ea9255fae132a7249676458b36496f1d8c (diff)
downloadbinutils-redhat-45992ef9b8af2d7429e5d3f2fd90f55619f43762.tar.gz
2009-03-20 Martin Schwidefsky <schwidefsky@de.ibm.com>
Andreas Krebbel <Andreas.Krebbel@de.ibm.com> * elf32-s390.c (elf_s390_check_relocs): Use the SYMBOL_* macros for visibilty and locality checks. (elf_s390_adjust_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (elf_s390_relocate_section): Likewise. (elf_s390_finish_dynamic_symbol): Likewise. * elf64-s390.c (elf_s390_check_relocs): Likewise. (elf_s390_adjust_dynamic_symbol): Likewise. (allocate_dynrelocs): Likewise. (elf_s390_relocate_section): Likewise. (elf_s390_finish_dynamic_symbol): Likewise.
Diffstat (limited to 'bfd/elf32-s390.c')
-rw-r--r--bfd/elf32-s390.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index 7aadadc6ca..14c4cb0c99 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -1261,7 +1261,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
&& ELF32_R_TYPE (rel->r_info) != R_390_PC32DBL
&& ELF32_R_TYPE (rel->r_info) != R_390_PC32)
|| (h != NULL
- && (! info->symbolic
+ && (! SYMBOLIC_BIND (info, h)
|| h->root.type == bfd_link_hash_defweak
|| !h->def_regular))))
|| (ELIMINATE_COPY_RELOCS
@@ -1566,11 +1566,9 @@ elf_s390_adjust_dynamic_symbol (info, h)
|| h->needs_plt)
{
if (h->plt.refcount <= 0
- || (! info->shared
- && !h->def_dynamic
- && !h->ref_dynamic
- && h->root.type != bfd_link_hash_undefweak
- && h->root.type != bfd_link_hash_undefined))
+ || SYMBOL_CALLS_LOCAL (info, h)
+ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+ && h->root.type != bfd_link_hash_undefweak))
{
/* This case can occur if we saw a PLT32 reloc in an input
file, but the symbol was never referred to by a dynamic
@@ -1709,9 +1707,7 @@ allocate_dynrelocs (h, inf)
htab = elf_s390_hash_table (info);
if (htab->elf.dynamic_sections_created
- && h->plt.refcount > 0
- && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak))
+ && h->plt.refcount > 0)
{
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
@@ -1840,7 +1836,7 @@ allocate_dynrelocs (h, inf)
if (info->shared)
{
- if (SYMBOL_REFERENCES_LOCAL (info, h))
+ if (SYMBOL_CALLS_LOCAL (info, h))
{
struct elf_s390_dyn_relocs **pp;
@@ -2364,10 +2360,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
dyn = htab->elf.dynamic_sections_created;
if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
|| (info->shared
- && (info->symbolic
- || h->dynindx == -1
- || h->forced_local)
- && h->def_regular)
+ && SYMBOL_REFERENCES_LOCAL (info, h))
|| (ELF_ST_VISIBILITY (h->other)
&& h->root.type == bfd_link_hash_undefweak))
{
@@ -2537,8 +2530,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
&& r_type != R_390_PC16DBL
&& r_type != R_390_PC32DBL
&& r_type != R_390_PC32)
- || (h != NULL
- && !SYMBOL_REFERENCES_LOCAL (info, h))))
+ || !SYMBOL_CALLS_LOCAL (info, h)))
|| (ELIMINATE_COPY_RELOCS
&& !info->shared
&& h != NULL
@@ -2580,7 +2572,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
|| r_type == R_390_PC32DBL
|| r_type == R_390_PC32
|| !info->shared
- || !info->symbolic
+ || !SYMBOLIC_BIND (info, h)
|| !h->def_regular))
{
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
@@ -3262,11 +3254,10 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
The entry in the global offset table will already have been
initialized in the relocate_section function. */
if (info->shared
- && (info->symbolic
- || h->dynindx == -1
- || h->forced_local)
- && h->def_regular)
+ && SYMBOL_REFERENCES_LOCAL (info, h))
{
+ if (!h->def_regular)
+ return FALSE;
BFD_ASSERT((h->got.offset & 1) != 0);
rela.r_info = ELF32_R_INFO (0, R_390_RELATIVE);
rela.r_addend = (h->root.u.def.value