summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2008-08-12 13:12:47 +0000
committerAlan Modra <amodra@bigpond.net.au>2008-08-12 13:12:47 +0000
commit8055949247a73c4238eecc209a5a951b44fac81a (patch)
tree209d7e77bcafd7081695654b104eec6caade8a22 /bfd
parentaefedd0878acbfb4ea24cf64d44352247bb68f2c (diff)
downloadgdb-8055949247a73c4238eecc209a5a951b44fac81a.tar.gz
* elf32-ppc.c (allocate_dynrelocs): Ignore dyn_relocs when
!dynamic_sections_created. Don't make symbols with got references dynamic if !dynamic_sections_created. * elf64-ppc.c (allocate_dynrelocs): Likewise. Alloc dynamic relocs on undefined symbols. (ppc64_elf_relocate_section): Allow dynamic relocs on undefined symbols.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog10
-rw-r--r--bfd/elf32-ppc.c6
-rw-r--r--bfd/elf64-ppc.c8
3 files changed, 18 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4d8b0c66682..4e2baac79b0 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,13 @@
+2008-08-12 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-ppc.c (allocate_dynrelocs): Ignore dyn_relocs when
+ !dynamic_sections_created. Don't make symbols with got
+ references dynamic if !dynamic_sections_created.
+ * elf64-ppc.c (allocate_dynrelocs): Likewise. Alloc dynamic
+ relocs on undefined symbols.
+ (ppc64_elf_relocate_section): Allow dynamic relocs on
+ undefined symbols.
+
2008-08-11 Alan Modra <amodra@bigpond.net.au>
* elf64-ppc.c (toc_adjusting_stub_needed): Any call via the plt
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index a93a7065e5e..84e72b8a041 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -4993,7 +4993,8 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
{
/* Make sure this symbol is output as a dynamic symbol. */
if (eh->elf.dynindx == -1
- && !eh->elf.forced_local)
+ && !eh->elf.forced_local
+ && htab->elf.dynamic_sections_created)
{
if (!bfd_elf_link_record_dynamic_symbol (info, &eh->elf))
return FALSE;
@@ -5041,7 +5042,8 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
else
eh->elf.got.offset = (bfd_vma) -1;
- if (eh->dyn_relocs == NULL)
+ if (eh->dyn_relocs == NULL
+ || !htab->elf.dynamic_sections_created)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 3ee3f69e287..86fe3c3de84 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -7891,7 +7891,8 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
Undefined weak syms won't yet be marked as dynamic,
nor will all TLS symbols. */
if (h->dynindx == -1
- && !h->forced_local)
+ && !h->forced_local
+ && htab->elf.dynamic_sections_created)
{
if (! bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
@@ -7925,7 +7926,8 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
else
gent->got.offset = (bfd_vma) -1;
- if (eh->dyn_relocs == NULL)
+ if (eh->dyn_relocs == NULL
+ || !htab->elf.dynamic_sections_created)
return TRUE;
/* In the shared -Bsymbolic case, discard space allocated for
@@ -7982,7 +7984,6 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
dynamic. */
if (!h->non_got_ref
- && h->def_dynamic
&& !h->def_regular)
{
/* Make sure this symbol is output as a dynamic symbol.
@@ -11251,7 +11252,6 @@ ppc64_elf_relocate_section (bfd *output_bfd,
&& h != NULL
&& h->elf.dynindx != -1
&& !h->elf.non_got_ref
- && h->elf.def_dynamic
&& !h->elf.def_regular))
{
Elf_Internal_Rela outrel;