aboutsummaryrefslogtreecommitdiff
path: root/bfd/linker.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2007-07-27 01:04:29 +0000
committerMichael Snyder <msnyder@vmware.com>2007-07-27 01:04:29 +0000
commita6626e8c3089ee949fcb177dc0a3253a8c3b9c58 (patch)
tree73155bba76985dfbec7517fff24015b4d4296985 /bfd/linker.c
parent36e44abdc26c5063b225e7204127de5473d91ac3 (diff)
downloadgdb-a6626e8c3089ee949fcb177dc0a3253a8c3b9c58.zip
gdb-a6626e8c3089ee949fcb177dc0a3253a8c3b9c58.tar.gz
gdb-a6626e8c3089ee949fcb177dc0a3253a8c3b9c58.tar.bz2
2007-07-26 Michael Snyder <msnyder@svkmacdonelllnx>
* linker.c (bfd_section_already_linked_table_insert): Change return type from void to boolean. Return FALSE on failure. (_bfd_generic_section_already_linked): Test return value of bfd_section_already_linked_table_insert, call fatal on error. * elflink.c (_bfd_elf_section_already_linked): Test return value of bfd_section_already_linked_table_insert, call fatal on error. * libbfd-in.h (bfd_section_already_linked_table_insert): Update return type to bfd_boolean. * libbfd.h: Regenerate.
Diffstat (limited to 'bfd/linker.c')
-rw-r--r--bfd/linker.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/bfd/linker.c b/bfd/linker.c
index a679a32..fb293cc 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -2923,7 +2923,7 @@ bfd_section_already_linked_table_lookup (const char *name)
TRUE, FALSE));
}
-void
+bfd_boolean
bfd_section_already_linked_table_insert
(struct bfd_section_already_linked_hash_entry *already_linked_list,
asection *sec)
@@ -2933,9 +2933,12 @@ bfd_section_already_linked_table_insert
/* Allocate the memory from the same obstack as the hash table is
kept in. */
l = bfd_hash_allocate (&_bfd_section_already_linked_table, sizeof *l);
+ if (l == NULL)
+ return FALSE;
l->sec = sec;
l->next = already_linked_list->entry;
already_linked_list->entry = l;
+ return TRUE;
}
static struct bfd_hash_entry *
@@ -2947,7 +2950,7 @@ already_linked_newfunc (struct bfd_hash_entry *entry ATTRIBUTE_UNUSED,
bfd_hash_allocate (table, sizeof *ret);
if (ret == NULL)
- return ret;
+ return NULL;
ret->entry = NULL;
@@ -2973,7 +2976,7 @@ bfd_section_already_linked_table_free (void)
void
_bfd_generic_section_already_linked (bfd *abfd, asection *sec,
- struct bfd_link_info *info ATTRIBUTE_UNUSED)
+ struct bfd_link_info *info)
{
flagword flags;
const char *name;
@@ -3074,7 +3077,8 @@ _bfd_generic_section_already_linked (bfd *abfd, asection *sec,
}
/* This is the first section with this name. Record it. */
- bfd_section_already_linked_table_insert (already_linked_list, sec);
+ if (! bfd_section_already_linked_table_insert (already_linked_list, sec))
+ info->callbacks->einfo (_("%F%P: already_linked_table: %E"));
}
/* Convert symbols in excluded output sections to use a kept section. */