summaryrefslogtreecommitdiffstats
path: root/contrib/binutils/bfd/elf32-ppc.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2000-11-15 20:52:56 +0000
committerobrien <obrien@FreeBSD.org>2000-11-15 20:52:56 +0000
commit58a790571531103aac1af77ce3ede9485ee1798d (patch)
tree0c15e6d73e6b72e4827681b4de1c8e83e2c90f5d /contrib/binutils/bfd/elf32-ppc.c
parent7c4d7cfec1e42798f40e828b4f7a6350815ad9b7 (diff)
downloadFreeBSD-src-58a790571531103aac1af77ce3ede9485ee1798d.zip
FreeBSD-src-58a790571531103aac1af77ce3ede9485ee1798d.tar.gz
Import of GNU Binutils version 2.10.1.
Believe it or not, this is heavily stripped down.
Diffstat (limited to 'contrib/binutils/bfd/elf32-ppc.c')
-rw-r--r--contrib/binutils/bfd/elf32-ppc.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/contrib/binutils/bfd/elf32-ppc.c b/contrib/binutils/bfd/elf32-ppc.c
index 242cfb7..b405fea 100644
--- a/contrib/binutils/bfd/elf32-ppc.c
+++ b/contrib/binutils/bfd/elf32-ppc.c
@@ -2687,6 +2687,13 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
/* Mark the symbol as undefined, rather than as defined in
the .plt section. Leave the value alone. */
sym->st_shndx = SHN_UNDEF;
+ /* If the symbol is weak, we do need to clear the value.
+ Otherwise, the PLT entry would provide a definition for
+ the symbol even if the symbol wasn't defined anywhere,
+ and so the symbol would never be NULL. */
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK)
+ == 0)
+ sym->st_value = 0;
}
}
@@ -3101,7 +3108,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
}
else if (h->root.type == bfd_link_hash_undefweak)
relocation = 0;
- else if (info->shared && !info->symbolic && !info->no_undefined)
+ else if (info->shared && !info->symbolic
+ && !info->no_undefined
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
relocation = 0;
else
{
@@ -3111,7 +3120,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
input_section,
rel->r_offset,
(!info->shared
- || info->no_undefined)))
+ || info->no_undefined
+ || ELF_ST_VISIBILITY (h->other))))
return false;
relocation = 0;
}
OpenPOWER on IntegriCloud