aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-ppc.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2004-02-20 17:36:36 +0000
committerJakub Jelinek <jakub@redhat.com>2004-02-20 17:36:36 +0000
commita876ecf9beafc358b801fc6976b95d67706252ff (patch)
tree834d82f7eaf256f414a15d8508d93a56137203b5 /bfd/elf32-ppc.c
parente866a2571a7e3fa835ee3915ff723b0482e4c2d6 (diff)
downloadgdb-a876ecf9beafc358b801fc6976b95d67706252ff.zip
gdb-a876ecf9beafc358b801fc6976b95d67706252ff.tar.gz
gdb-a876ecf9beafc358b801fc6976b95d67706252ff.tar.bz2
* elf32-ppc.c (allocate_dynrelocs): Create dynsym for undef weak
symbols used in PIE relocs.
Diffstat (limited to 'bfd/elf32-ppc.c')
-rw-r--r--bfd/elf32-ppc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 4467eec..8bd7115 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -3189,6 +3189,18 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
&& h->root.type == bfd_link_hash_undefweak)
eh->dyn_relocs = NULL;
+
+ /* Make sure undefined weak symbols are output as a dynamic symbol
+ in PIEs. */
+ if (info->pie
+ && eh->dyn_relocs != NULL
+ && h->dynindx == -1
+ && h->root.type == bfd_link_hash_undefweak
+ && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
+ {
+ if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
}
else if (ELIMINATE_COPY_RELOCS)
{