aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-06-07 10:21:53 +0000
committerAlan Modra <amodra@gmail.com>2002-06-07 10:21:53 +0000
commit3fad3c7c229b6bd595eb5a562ca866600e905389 (patch)
tree3c18776f4d6974f17aa891b79600d15434ba29c9
parentf13a54248a537855d39530db63db0e31316c583c (diff)
downloadgdb-3fad3c7c229b6bd595eb5a562ca866600e905389.zip
gdb-3fad3c7c229b6bd595eb5a562ca866600e905389.tar.gz
gdb-3fad3c7c229b6bd595eb5a562ca866600e905389.tar.bz2
* elf64-ppc.c (ppc64_elf_relocate_section): Allow unresolved
relocs in opd for non-shared too.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf64-ppc.c25
2 files changed, 20 insertions, 10 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f72607c..e5a9074 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2002-06-07 Alan Modra <amodra@bigpond.net.au>
+
+ * elf64-ppc.c (ppc64_elf_relocate_section): Allow unresolved
+ relocs in opd for non-shared too.
+
2002-06-06 Jeffrey Law <law@redhat.com
* elf32-h8300.c (elf32_h8_relax_section): Ignore uninteresting
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index d8ac56e..106fafc 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -1736,7 +1736,7 @@ ppc64_elf_merge_private_bfd_data (ibfd, obfd)
elf_elfheader (obfd)->e_flags &= ~EF_PPC_RELOCATABLE_LIB;
/* The output is -mrelocatable iff it can't be -mrelocatable-lib,
- but each input file is either -mrelocatable or -mrelocatable-lib. */
+ but each input file is either -mrelocatable or -mrelocatable-lib. */
if (! (elf_elfheader (obfd)->e_flags & EF_PPC_RELOCATABLE_LIB)
&& (new_flags & (EF_PPC_RELOCATABLE_LIB | EF_PPC_RELOCATABLE))
&& (old_flags & (EF_PPC_RELOCATABLE_LIB | EF_PPC_RELOCATABLE)))
@@ -2708,14 +2708,14 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs)
case R_PPC64_PLT32:
case R_PPC64_PLT64:
/* This symbol requires a procedure linkage table entry. We
- actually build the entry in adjust_dynamic_symbol,
- because this might be a case of linking PIC code without
- linking in any dynamic objects, in which case we don't
- need to generate a procedure linkage table after all. */
+ actually build the entry in adjust_dynamic_symbol,
+ because this might be a case of linking PIC code without
+ linking in any dynamic objects, in which case we don't
+ need to generate a procedure linkage table after all. */
if (h == NULL)
{
/* It does not make sense to have a procedure linkage
- table entry for a local symbol. */
+ table entry for a local symbol. */
bfd_set_error (bfd_error_bad_value);
return false;
}
@@ -5614,12 +5614,17 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
relocate = true;
if (r_type == R_PPC64_ADDR64 || r_type == R_PPC64_TOC)
{
- if (is_opd && h != NULL && info->shared)
+ if (is_opd && h != NULL)
{
/* Lie about opd entries. This case occurs
when building shared libraries and we
reference a function in another shared
- lib. In that case we won't use the opd
+ lib. The same thing happens for a weak
+ definition in an application that's
+ overridden by a strong definition in a
+ shared lib. (I believe this is a generic
+ bug in binutils handling of weak syms.)
+ In these cases we won't use the opd
entry in this lib; We ought to edit the
opd section to remove unused entries. */
unresolved_reloc = false;
@@ -5877,7 +5882,7 @@ ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
Elf64_External_Rela *loc;
/* This symbol has an entry in the procedure linkage table. Set
- it up. */
+ it up. */
if (htab->splt == NULL
|| htab->srelplt == NULL
@@ -5904,7 +5909,7 @@ ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
Elf64_External_Rela *loc;
/* This symbol has an entry in the global offset table. Set it
- up. */
+ up. */
if (htab->sgot == NULL || htab->srelgot == NULL)
abort ();