aboutsummaryrefslogtreecommitdiff
path: root/bfd/linker.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1994-02-28 00:32:14 +0000
committerJeff Law <law@redhat.com>1994-02-28 00:32:14 +0000
commit6e58a4e5db91941cf8c0845a8a8e7329a5b8281a (patch)
treee90a8a8e39ee96cee4bab0f76586fa22a205889e /bfd/linker.c
parent2e39abdb9621a5985ac86f08a6a96df8466628e9 (diff)
downloadgdb-6e58a4e5db91941cf8c0845a8a8e7329a5b8281a.zip
gdb-6e58a4e5db91941cf8c0845a8a8e7329a5b8281a.tar.gz
gdb-6e58a4e5db91941cf8c0845a8a8e7329a5b8281a.tar.bz2
* elf32-hppa.h (hppa_look_for_stub_in_section): Fix typo. Delete
unused symbols argument. * elf32-hppa.c (hppa_elf_stub_reloc): Accept asymbol ** rather than asymbol * for original target symbol. All callers changed. Set reloc->sym_ptr_ptr appropriately. (hppa_elf_build_linker_stub): Set reloc->sym_ptr_ptr correctly. (hppa_elf_look_for_stubs_in_section): No longer need symbols argument. Use the output symbols when canonicalizing the relocs, creating them if necessary. * linker.c (_bfd_generic_link_output_symbols): Do not rebuild/clobber the output symbols if they already exist.
Diffstat (limited to 'bfd/linker.c')
-rw-r--r--bfd/linker.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/bfd/linker.c b/bfd/linker.c
index 612190e..0e2c31b 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -1619,15 +1619,19 @@ _bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc)
asymbol **sym_ptr;
asymbol **sym_end;
- symsize = get_symtab_upper_bound (input_bfd);
- input_bfd->outsymbols = (asymbol **) bfd_alloc (input_bfd, symsize);
- if (!input_bfd->outsymbols)
+ /* Do not clobber outsymbols if they have already been created. */
+ if (input_bfd->outsymbols == NULL)
{
- bfd_set_error (bfd_error_no_memory);
- return false;
+ symsize = get_symtab_upper_bound (input_bfd);
+ input_bfd->outsymbols = (asymbol **) bfd_alloc (input_bfd, symsize);
+ if (!input_bfd->outsymbols)
+ {
+ bfd_set_error (bfd_error_no_memory);
+ return false;
+ }
+ input_bfd->symcount = bfd_canonicalize_symtab (input_bfd,
+ input_bfd->outsymbols);
}
- input_bfd->symcount = bfd_canonicalize_symtab (input_bfd,
- input_bfd->outsymbols);
/* Create a filename symbol if we are supposed to. */
if (info->create_object_symbols_section != (asection *) NULL)