2007-07-27 Michael Snyder <msnyder@access-company.com>
* cofflink.c (coff_link_add_symbols): Return if count is zero.
This commit is contained in:
parent
50a39e971e
commit
d63388ff70
2 changed files with 8 additions and 3 deletions
|
@ -1,5 +1,7 @@
|
||||||
2007-07-27 Michael Snyder <msnyder@access-company.com>
|
2007-07-27 Michael Snyder <msnyder@access-company.com>
|
||||||
|
|
||||||
|
* cofflink.c (coff_link_add_symbols): Return if count is zero.
|
||||||
|
|
||||||
* coff-i386.c (coff_i386_rtype_to_howto): Off by one error.
|
* coff-i386.c (coff_i386_rtype_to_howto): Off by one error.
|
||||||
|
|
||||||
* aoutx.h (slurp_symbol_table): Return if count == 0.
|
* aoutx.h (slurp_symbol_table): Return if count == 0.
|
||||||
|
|
|
@ -302,6 +302,11 @@ coff_link_add_symbols (bfd *abfd,
|
||||||
bfd_byte *esym_end;
|
bfd_byte *esym_end;
|
||||||
bfd_size_type amt;
|
bfd_size_type amt;
|
||||||
|
|
||||||
|
symcount = obj_raw_syment_count (abfd);
|
||||||
|
|
||||||
|
if (symcount == 0)
|
||||||
|
return TRUE; /* Nothing to do. */
|
||||||
|
|
||||||
/* Keep the symbols during this function, in case the linker needs
|
/* Keep the symbols during this function, in case the linker needs
|
||||||
to read the generic symbols in order to report an error message. */
|
to read the generic symbols in order to report an error message. */
|
||||||
keep_syms = obj_coff_keep_syms (abfd);
|
keep_syms = obj_coff_keep_syms (abfd);
|
||||||
|
@ -312,13 +317,11 @@ coff_link_add_symbols (bfd *abfd,
|
||||||
else
|
else
|
||||||
default_copy = TRUE;
|
default_copy = TRUE;
|
||||||
|
|
||||||
symcount = obj_raw_syment_count (abfd);
|
|
||||||
|
|
||||||
/* We keep a list of the linker hash table entries that correspond
|
/* We keep a list of the linker hash table entries that correspond
|
||||||
to particular symbols. */
|
to particular symbols. */
|
||||||
amt = symcount * sizeof (struct coff_link_hash_entry *);
|
amt = symcount * sizeof (struct coff_link_hash_entry *);
|
||||||
sym_hash = bfd_zalloc (abfd, amt);
|
sym_hash = bfd_zalloc (abfd, amt);
|
||||||
if (sym_hash == NULL && symcount != 0)
|
if (sym_hash == NULL)
|
||||||
goto error_return;
|
goto error_return;
|
||||||
obj_coff_sym_hashes (abfd) = sym_hash;
|
obj_coff_sym_hashes (abfd) = sym_hash;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue