diff options
author | Alan Modra <amodra@gmail.com> | 2005-03-21 13:56:57 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2005-03-21 13:56:57 +0000 |
commit | 644285efefa72ddbfe22ba868d7b11a302ad8f42 (patch) | |
tree | 412027c3b48045eae71e390bc8a2934fe5280c6b /bfd/elf32-ppc.c | |
parent | c9a2f3330b420cd61589846c369e20deaf44da27 (diff) | |
download | gdb-644285efefa72ddbfe22ba868d7b11a302ad8f42.zip gdb-644285efefa72ddbfe22ba868d7b11a302ad8f42.tar.gz gdb-644285efefa72ddbfe22ba868d7b11a302ad8f42.tar.bz2 |
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.
Diffstat (limited to 'bfd/elf32-ppc.c')
-rw-r--r-- | bfd/elf32-ppc.c | 15 |
1 files changed, 11 insertions, 4 deletions
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) |