From 5d2b5f6f49486256b78085ea978766ffc133a713 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 21 Mar 2005 13:56:47 +0000 Subject: [PATCH] bfd/ * 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. ld/ * scripttempl/elf.sc (SBSS): Don't provide sbss start and end syms. ld/testsuite/ * ld-powerpc/tlsexe32.r: Update. * ld-powerpc/tlsso32.d: Update. * ld-powerpc/tlsso32.g: Update. * ld-powerpc/tlsso32.r: Update. --- bfd/ChangeLog | 6 ++++++ bfd/elf32-ppc.c | 15 +++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 014759d46c..fd44c075cf 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2005-03-22 Alan Modra + + * 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 * elf32-ppc.c (struct elf_linker_section): Remove sym_hash and diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 2e9b549017..a80cfa440a 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) -- 2.11.0