aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf32-ppc.c15
2 files changed, 17 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 014759d..fd44c07 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2005-03-22 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-ppc.c (ppc_elf_add_symbol_hook): Make htab->sbss
+ SEC_LINKER_CREATED. Attach to dynobj.
+ (ppc_elf_size_dynamic_sections): Strip htab->sbss if zero size.
+
2005-03-21 Alan Modra <amodra@bigpond.net.au>
* elf32-ppc.c (struct elf_linker_section): Remove sym_hash and
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 2e9b549..a80cfa4 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -2381,11 +2381,14 @@ ppc_elf_add_symbol_hook (bfd *abfd,
htab = ppc_elf_hash_table (info);
if (htab->sbss == NULL)
{
- flagword flags = SEC_IS_COMMON;
+ flagword flags = SEC_IS_COMMON | SEC_LINKER_CREATED;
- htab->sbss = bfd_make_section_anyway (abfd, ".sbss");
+ if (!htab->elf.dynobj)
+ htab->elf.dynobj = abfd;
+
+ htab->sbss = bfd_make_section_anyway (htab->elf.dynobj, ".sbss");
if (htab->sbss == NULL
- || ! bfd_set_section_flags (abfd, htab->sbss, flags))
+ || ! bfd_set_section_flags (htab->elf.dynobj, htab->sbss, flags))
return FALSE;
}
@@ -4053,7 +4056,8 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
continue;
if (s == htab->plt
- || s == htab->got)
+ || s == htab->got
+ || s == htab->sbss)
{
/* Strip this section if we don't need it; see the
comment below. */
@@ -4099,6 +4103,9 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
continue;
}
+ if (s == htab->sbss)
+ continue;
+
/* Allocate memory for the section contents. */
s->contents = bfd_zalloc (htab->elf.dynobj, s->size);
if (s->contents == NULL)