aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-04-14 13:01:24 +0000
committerJakub Jelinek <jakub@redhat.com>2007-04-14 13:01:24 +0000
commit3fcd97f16cb46d4c493e892f85a188969e0a95e7 (patch)
tree5c54b6bc6e8a187cbcd1460a958c2cbeea532ba5 /bfd/elflink.c
parent25d5ea921bee4a06522b807e33912e2345bb1086 (diff)
downloadgdb-3fcd97f16cb46d4c493e892f85a188969e0a95e7.zip
gdb-3fcd97f16cb46d4c493e892f85a188969e0a95e7.tar.gz
gdb-3fcd97f16cb46d4c493e892f85a188969e0a95e7.tar.bz2
* elflink.c (bfd_elf_final_link): Don't free symbuf for
non-elf input bfds. (bfd_elf_size_dynamic_sections): Don't access elf_section_data for non-elf input bfds.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 228debb..0058002 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -5522,15 +5522,16 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd,
for (sub = info->input_bfds; sub != NULL;
sub = sub->link_next)
- for (o = sub->sections; o != NULL; o = o->next)
- if (elf_section_data (o)->this_hdr.sh_type
- == SHT_PREINIT_ARRAY)
- {
- (*_bfd_error_handler)
- (_("%B: .preinit_array section is not allowed in DSO"),
- sub);
- break;
- }
+ if (bfd_get_flavour (sub) == bfd_target_elf_flavour)
+ for (o = sub->sections; o != NULL; o = o->next)
+ if (elf_section_data (o)->this_hdr.sh_type
+ == SHT_PREINIT_ARRAY)
+ {
+ (*_bfd_error_handler)
+ (_("%B: .preinit_array section is not allowed in DSO"),
+ sub);
+ break;
+ }
bfd_set_error (bfd_error_nonrepresentable_section);
return FALSE;
@@ -9533,7 +9534,8 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
if (!info->reduce_memory_overheads)
{
for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
- if (elf_tdata (sub)->symbuf)
+ if (bfd_get_flavour (sub) == bfd_target_elf_flavour
+ && elf_tdata (sub)->symbuf)
{
free (elf_tdata (sub)->symbuf);
elf_tdata (sub)->symbuf = NULL;