#define _bfd_generic_link_get_symbols(abfd) ((abfd)->outsymbols)
#define _bfd_generic_link_get_symcount(abfd) ((abfd)->symcount)
-/* Add the symbols of input_bfd to the symbols being built for
- output_bfd. */
-extern bool _bfd_generic_link_output_symbols
- (bfd *, bfd *, struct bfd_link_info *, size_t *);
-
-/* This structure is used to pass information to
- _bfd_generic_link_write_global_symbol, which may be called via
- _bfd_generic_link_hash_traverse. */
-
-struct generic_write_global_symbol_info
-{
- struct bfd_link_info *info;
- bfd *output_bfd;
- size_t *psymalloc;
-};
-
-/* Write out a single global symbol. This is expected to be called
- via _bfd_generic_link_hash_traverse. The second argument must
- actually be a struct generic_write_global_symbol_info *. */
-extern bool _bfd_generic_link_write_global_symbol
- (struct generic_link_hash_entry *, void *);
-
-/* Generic link hash table entry creation routine. */
-struct bfd_hash_entry *_bfd_generic_link_hash_newfunc
- (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
-
#endif
file at the end of <<NAME(aout,final_link)>>.
*/
+/* This structure is used to pass information to
+ _bfd_generic_link_write_global_symbol, which may be called via
+ _bfd_generic_link_hash_traverse. */
+
+struct generic_write_global_symbol_info
+{
+ struct bfd_link_info *info;
+ bfd *output_bfd;
+ size_t *psymalloc;
+ bool failed;
+};
+
static bool generic_link_add_object_symbols
(bfd *, struct bfd_link_info *);
static bool generic_link_check_archive_element
static bool default_indirect_link_order
(bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *,
bool);
+static bool _bfd_generic_link_output_symbols
+ (bfd *, bfd *, struct bfd_link_info *, size_t *);
+static bool _bfd_generic_link_write_global_symbol
+ (struct generic_link_hash_entry *, void *);
/* The link hash table structure is defined in bfdlink.h. It provides
a base hash table which the backend specific hash tables are built
\f
/* Routine to create an entry in a generic link hash table. */
-struct bfd_hash_entry *
+static struct bfd_hash_entry *
_bfd_generic_link_hash_newfunc (struct bfd_hash_entry *entry,
struct bfd_hash_table *table,
const char *string)
wginfo.info = info;
wginfo.output_bfd = abfd;
wginfo.psymalloc = &outsymalloc;
+ wginfo.failed = false;
_bfd_generic_link_hash_traverse (_bfd_generic_hash_table (info),
_bfd_generic_link_write_global_symbol,
&wginfo);
+ if (wginfo.failed)
+ return false;
/* Make sure we have a trailing NULL pointer on OUTSYMBOLS. We
shouldn't really need one, since we have SYMCOUNT, but some old
/* Handle the symbols for an input BFD. */
-bool
+static bool
_bfd_generic_link_output_symbols (bfd *output_bfd,
bfd *input_bfd,
struct bfd_link_info *info,
/* Write out a global symbol, if it hasn't already been written out.
This is called for each symbol in the hash table. */
-bool
+static bool
_bfd_generic_link_write_global_symbol (struct generic_link_hash_entry *h,
void *data)
{
- struct generic_write_global_symbol_info *wginfo =
- (struct generic_write_global_symbol_info *) data;
+ struct generic_write_global_symbol_info *wginfo = data;
asymbol *sym;
if (h->written)
{
sym = bfd_make_empty_symbol (wginfo->output_bfd);
if (!sym)
- return false;
+ {
+ wginfo->failed = true;
+ return false;
+ }
sym->name = h->root.root.string;
sym->flags = 0;
}
if (! generic_add_output_symbol (wginfo->output_bfd, wginfo->psymalloc,
sym))
{
- /* FIXME: No way to return failure. */
- abort ();
+ wginfo->failed = true;
+ return false;
}
return true;