summaryrefslogtreecommitdiff
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
commitdc93bc4ab9bca784855dc7f9f98d75dd79f2b58d (patch)
tree6dc6f8339a807bfabaafcfb391e8315c790d6b48
parent3158703a3eab4fa013db98a3fcae759f5d5b5274 (diff)
downloadgdb-dc93bc4ab9bca784855dc7f9f98d75dd79f2b58d.tar.gz
* elf32-ppc.c (allocate_dynrelocs): Create dynsym for undef weak
symbols used in PIE relocs.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-ppc.c12
2 files changed, 17 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f820b9a07f3..6ce32465833 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2004-02-20 Jakub Jelinek <jakub@redhat.com>
+
+ * elf32-ppc.c (allocate_dynrelocs): Create dynsym for undef weak
+ symbols used in PIE relocs.
+
2004-02-19 Jakub Jelinek <jakub@redhat.com>
* elf32-sparc.c (elf32_sparc_finish_dynamic_sections): Clear
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 4467eec5d97..8bd7115bf90 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)
{