aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-06-07 14:57:11 +0000
committerAlan Modra <amodra@gmail.com>2002-06-07 14:57:11 +0000
commit1126897b369207e6242a9e0f5bbee00c10831ded (patch)
treea51cb804cd3ea7de2b31e0884486922384336f4e /bfd/elflink.h
parente0076ab3140185bf116c79564b976d455942a984 (diff)
downloadgdb-1126897b369207e6242a9e0f5bbee00c10831ded.zip
gdb-1126897b369207e6242a9e0f5bbee00c10831ded.tar.gz
gdb-1126897b369207e6242a9e0f5bbee00c10831ded.tar.bz2
* elf-bfd.h (struct bfd_elf_section_data <group_name>): Replace with
"group" union. (elf_group_name): Update. (elf_group_id): Define. (bfd_elf_set_group_contents): Declare. * elf.c (elf_fake_sections): Qualify use of elf_group_name. (set_group_contents): Rename to bfd_elf_set_group_contents. Remove ATTRIBUTE_UNUSED from failedptrarg. If elf_group_id is set, use that sym for the signature. (_bfd_elf_compute_section_file_positions): Don't call set_group_contents for "ld -r" case. (swap_out_syms): Use bfd_zalloc. * elflink.h (elf_link_add_archive_symbols): Likewise. (NAME(bfd_elf,size_dynamic_sections)): Likewise. (elf_bfd_final_link): Call bfd_elf_set_group_contents.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r--bfd/elflink.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index e80e867..30ba4c1 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -313,12 +313,10 @@ elf_link_add_archive_symbols (abfd, info)
return true;
amt = c;
amt *= sizeof (boolean);
- defined = (boolean *) bfd_malloc (amt);
- included = (boolean *) bfd_malloc (amt);
+ defined = (boolean *) bfd_zmalloc (amt);
+ included = (boolean *) bfd_zmalloc (amt);
if (defined == (boolean *) NULL || included == (boolean *) NULL)
goto error_return;
- memset (defined, 0, (size_t) amt);
- memset (included, 0, (size_t) amt);
symdefs = bfd_ardata (abfd)->symdefs;
@@ -3665,10 +3663,9 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
BFD_ASSERT (s != NULL);
hash_entry_size = elf_section_data (s)->this_hdr.sh_entsize;
s->_raw_size = ((2 + bucketcount + dynsymcount) * hash_entry_size);
- s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size);
+ s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->_raw_size);
if (s->contents == NULL)
return false;
- memset (s->contents, 0, (size_t) s->_raw_size);
bfd_put (8 * hash_entry_size, output_bfd, (bfd_vma) bucketcount,
s->contents);
@@ -5811,6 +5808,15 @@ elf_bfd_final_link (abfd, info)
}
}
+ if (info->relocateable)
+ {
+ boolean failed = false;
+
+ bfd_map_over_sections (abfd, bfd_elf_set_group_contents, &failed);
+ if (failed)
+ goto error_return;
+ }
+
/* If we have optimized stabs strings, output them. */
if (elf_hash_table (info)->stab_info != NULL)
{