+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.
+
2007-07-26 Adam Nemet <anemet@caviumnetworks.com>
* archive.c (do_slurp_bsd_armap, do_slurp_coff_armap,
}
/* 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"));
}
bfd_boolean
extern struct bfd_section_already_linked_hash_entry *
bfd_section_already_linked_table_lookup (const char *);
-extern void bfd_section_already_linked_table_insert
+extern bfd_boolean bfd_section_already_linked_table_insert
(struct bfd_section_already_linked_hash_entry *, asection *);
extern void bfd_section_already_linked_table_traverse
(bfd_boolean (*) (struct bfd_section_already_linked_hash_entry *,
extern struct bfd_section_already_linked_hash_entry *
bfd_section_already_linked_table_lookup (const char *);
-extern void bfd_section_already_linked_table_insert
+extern bfd_boolean bfd_section_already_linked_table_insert
(struct bfd_section_already_linked_hash_entry *, asection *);
extern void bfd_section_already_linked_table_traverse
(bfd_boolean (*) (struct bfd_section_already_linked_hash_entry *,
TRUE, FALSE));
}
-void
+bfd_boolean
bfd_section_already_linked_table_insert
(struct bfd_section_already_linked_hash_entry *already_linked_list,
asection *sec)
/* 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 *
bfd_hash_allocate (table, sizeof *ret);
if (ret == NULL)
- return ret;
+ return NULL;
ret->entry = NULL;
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;
}
/* 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. */