binutils-gdb/bfd/libcoff.h

466 lines
16 KiB
C
Raw Normal View History

/* BFD COFF object file private structure.
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Changes to let BFD return an error indication from get_symtab_upper_bound, bfd_canonicalize_symtab, bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now return long instead of unsigned int, and use -1 to indicate an error. Along the way, rename get_symtab_upper_bound to bfd_get_symtab_upper_bound. * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on errors. (bfd_canonicalize_reloc): Likewise. * syms.c (bfd_get_symtab_upper_bound): Renamed from get_symtab_upper_bound. * targets.c (bfd_target): Renamed _get_symtab_upper_bound to _bfd_get_symtab_upper_bound, and changed it and _bfd_canonicalize_symtab and _get_reloc_upper_bound and _bfd_canonicalize_reloc to all return long. * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. (NAME(aout,get_symtab_upper_bound)): Likewise. * bout.c (b_out_canonicalize_reloc): Likewise. (b_out_get_reloc_upper_bound): Likewise. * coffcode.h (coff_canonicalize_reloc): Likewise. * coffgen.c (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * elfcode.h (elf_get_symtab_upper_bound): Likewise. (elf_get_reloc_upper_bound): Likewise. (elf_canonicalize_reloc): Likewise. (elf_get_symtab): Likewise. * hp300hpux.c (MY(get_symtab)): Likewise. (MY(get_symtab_upper_bound)): Likewise. (MY(canonicalize_reloc)): Likewise. * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. * ieee.c (ieee_slurp_external_symbols): Change return type to boolean. Check for errors from get_symbol. (ieee_slurp_symbol_table): Change return type to boolean. Check for errors from ieee_slurp_external_symbols. (ieee_get_symtab_upper_bound): Return long, and -1 on errors. (ieee_get_symtab): Likewise. (ieee_get_reloc_upper_bound): Likewise. (ieee_canonicalize_reloc): Likewise. * mipsbsd.c (MY(canonicalize_reloc)): Likewise. * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. (nlm_get_symtab): Likewise. (nlm_get_reloc_upper_bound): Likewise. (nlm_canonicalize_reloc): Likewise. * oasys.c (oasys_get_symtab_upper_bound): Likewise. (oasys_get_symtab): Likewise. (oasys_get_reloc_upper_bound): Likewise. (oasys_canonicalize_reloc): Likewise. * som.c (som_get_symtab_upper_bound): Likewise. (som_get_symtab): Likewise. (som_get_reloc_upper_bound): Likewise. (som_canonicalize_reloc): Likewise. * srec.c (srec_get_symtab_upper_bound): Likewise. (srec_get_symtab): Likewise. (srec_get_reloc_upper_bound): Define as bfd_0l. (srec_canonicalize_reloc): Likewise. * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. (tekhex_get_symtab_upper_bound): Likewise. (tekhex_get_reloc_upper_bound): Define as bfd_0l. (tekhex_canonicalize_reloc): Likewise. * libaout.h (NAME(aout,get_symtab_upper_bound)): Change declaration to return long. (NAME(aout,get_symtab)): Likewise. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. (bfd_elf32_get_symtab): Likewise. (bfd_elf32_get_reloc_upper_bound): Likewise. (bfd_elf32_canonicalize_reloc): Likewise. (bfd_elf64_get_symtab_upper_bound): Likewise. (bfd_elf64_get_symtab): Likewise. (bfd_elf64_get_reloc_upper_bound): Likewise. (bfd_elf64_canonicalize_reloc): Likewise. * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. (nlmNAME(get_symtab)): Likewise. (nlmNAME(get_reloc_upper_bound)): Likewise. (nlmNAME(canonicalize_reloc)): Likewise. * archive.c (compute_and_write_armap): Use error_return and no_memory_return labels rather than freeing information in various places. Change storage, symcount and src_count to long. Check errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * bout.c (b_out_relax_section): Change reloc_size to long. Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (b_out_get_relocated_section_contents): Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise. * elf32-mips.c: Likewise. * elf32-hppa.c (hppa_elf_stub_finish): Likewise. (hppa_look_for_stubs_in_section): Check for errors from bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and bfd_canonicalize_reloc. * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * linker.c (generic_link_read_symbols): Likewise. (_bfd_generic_final_link): Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. (bfd_coff_reloc16_get_relocated_section_contents): Likewise. * libbfd.c (bfd_0l): New function. * libbfd-in.h (bfd_0l): Declare. * aix386-core.c: Change get_symtab_upper_bound, get_symtab, get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather than bfd_0u. * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * libcoff.h: Rebuilt. * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables temp and name.
1994-03-31 00:15:07 +02:00
Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
Written by Cygnus Support.
1991-03-21 22:11:25 +01:00
This file is part of BFD, the Binary File Descriptor library.
1991-03-21 22:11:25 +01:00
This program is free software; you can redistribute it and/or modify
1991-03-21 22:11:25 +01:00
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
1991-03-21 22:11:25 +01:00
This program is distributed in the hope that it will be useful,
1991-03-21 22:11:25 +01:00
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
1991-03-21 22:11:25 +01:00
Add new style linker support to COFF backend. a29k only for now. * cofflink.c: New file. * libcoff-in.h: Include bfdlink.h. (obj_coff_external_syms, obj_coff_strings): Define accessor macro. (obj_coff_sym_hashes): Define accessor macro. (struct coff_tdata): Add fields external_syms, strings, and sym_hashes. (struct coff_link_hash_entry): Define. (struct coff_link_hash_table): Define. (coff_link_hash_lookup, coff_link_hash_traverse): Define. (coff_hash_table): Define. (_bfd_coff_link_hash_table_create): Declare. (_bfd_coff_link_add_symbols, _bfd_coff_final_link): Declare. * coffcode.h (bfd_coff_backend_data): Add fields _bfd_relsz, _bfd_coff_swap_reloc_in, _bfd_coff_sym_is_global, _bfd_coff_compute_section_file_positions, _bfd_coff_relocate_section. (bfd_coff_relsz, bfd_coff_swap_reloc_in): Define. (bfd_coff_sym_is_global): Define. (bfd_coff_compute_section_file_positions): Define. (bfd_coff_relocate_section): Define. (coff_mkobject_hook): Initialize obj_raw_syment_count and obj_conv_table_size. (coff_compute_section_file_positions): Set target_index of all sections. Set output_has_begun field. (coff_write_object_contents): Don't set target_index; now done by coff_compute_section_file_positions. Remove obsolete handling of scn_base and data_base. Don't bother to check that target_index is positive, since it always is. Remove use of pad, which is always zero. Check obj_raw_syment_count, not bfd_get_symcount, for the number of symbols, but only write them out if bfd_get_symcount is non-zero. (coff_slurp_symbol_table): Use obj_raw_syment_count, not bfd_get_symcount for the number of symbols. Don't set obj_conv_table_size. (coff_sym_is_global): New static function or macro. (coff_slurp_reloc_table): Call coff_swap_reloc_in, not bfd_swap_reloc_in. (coff_bfd_link_hash_table_create): If coff_relocate_section is defined, define as _bfd_coff_link_hash_table_create. (coff_bfd_link_add_symbols): Similar change. (coff_bfd_final_link): Similar change. (coff_relocate_section): Define as NULL if not defined. (bfd_coff_std_swap_table): Initialize new fields. * coffgen.c (coff_real_object_p): Don't set obj_raw_syment_count and obj_conv_table_size here. (coff_count_linenumbers): Reindent. If bfd_get_symcount is zero, add up the line numbers from the sections. (coff_write_symbols): Don't set bfd_get_symcount. (coff_pointerize_aux): Don't pointerize a nonpositive x_endndx field. (coff_get_normalized_symtab): Use obj_raw_syment_count, not bfd_get_symcount. (coff_print_symbol): If auxp->fix_end, print x_endndx value. * coffswap.h (coff_swap_reloc_in): Rename from bfd_swap_reloc_in. Reindent. Change argument type to PTR. * coff-a29k.c (coff_a29k_relocate_section): New static function. (coff_relocate_section): Define. * configure.in (a29kcoff_big_vec): Compile cofflink.o. * coff-alpha.c (alpha_ecoff_backend_data): Initialize new fields. * coff-mips.c (mips_ecoff_backend_data): Likewise. * libcoff.h: Rebuilt. * Makefile.in: Rebuilt dependencies. (BFD32_BACKENDS): Add cofflink.o. (CFILES): Add cofflink.c.
1994-09-06 21:28:55 +02:00
#include "bfdlink.h"
1991-03-21 22:11:25 +01:00
/* Object file tdata; access macros */
#define coff_data(bfd) ((bfd)->tdata.coff_obj_data)
#define exec_hdr(bfd) (coff_data(bfd)->hdr)
#define obj_symbols(bfd) (coff_data(bfd)->symbols)
#define obj_sym_filepos(bfd) (coff_data(bfd)->sym_filepos)
#define obj_relocbase(bfd) (coff_data(bfd)->relocbase)
#define obj_raw_syments(bfd) (coff_data(bfd)->raw_syments)
#define obj_raw_syment_count(bfd) (coff_data(bfd)->raw_syment_count)
#define obj_convert(bfd) (coff_data(bfd)->conversion_table)
#define obj_conv_table_size(bfd) (coff_data(bfd)->conv_table_size)
1991-12-01 01:39:12 +01:00
Add new style linker support to COFF backend. a29k only for now. * cofflink.c: New file. * libcoff-in.h: Include bfdlink.h. (obj_coff_external_syms, obj_coff_strings): Define accessor macro. (obj_coff_sym_hashes): Define accessor macro. (struct coff_tdata): Add fields external_syms, strings, and sym_hashes. (struct coff_link_hash_entry): Define. (struct coff_link_hash_table): Define. (coff_link_hash_lookup, coff_link_hash_traverse): Define. (coff_hash_table): Define. (_bfd_coff_link_hash_table_create): Declare. (_bfd_coff_link_add_symbols, _bfd_coff_final_link): Declare. * coffcode.h (bfd_coff_backend_data): Add fields _bfd_relsz, _bfd_coff_swap_reloc_in, _bfd_coff_sym_is_global, _bfd_coff_compute_section_file_positions, _bfd_coff_relocate_section. (bfd_coff_relsz, bfd_coff_swap_reloc_in): Define. (bfd_coff_sym_is_global): Define. (bfd_coff_compute_section_file_positions): Define. (bfd_coff_relocate_section): Define. (coff_mkobject_hook): Initialize obj_raw_syment_count and obj_conv_table_size. (coff_compute_section_file_positions): Set target_index of all sections. Set output_has_begun field. (coff_write_object_contents): Don't set target_index; now done by coff_compute_section_file_positions. Remove obsolete handling of scn_base and data_base. Don't bother to check that target_index is positive, since it always is. Remove use of pad, which is always zero. Check obj_raw_syment_count, not bfd_get_symcount, for the number of symbols, but only write them out if bfd_get_symcount is non-zero. (coff_slurp_symbol_table): Use obj_raw_syment_count, not bfd_get_symcount for the number of symbols. Don't set obj_conv_table_size. (coff_sym_is_global): New static function or macro. (coff_slurp_reloc_table): Call coff_swap_reloc_in, not bfd_swap_reloc_in. (coff_bfd_link_hash_table_create): If coff_relocate_section is defined, define as _bfd_coff_link_hash_table_create. (coff_bfd_link_add_symbols): Similar change. (coff_bfd_final_link): Similar change. (coff_relocate_section): Define as NULL if not defined. (bfd_coff_std_swap_table): Initialize new fields. * coffgen.c (coff_real_object_p): Don't set obj_raw_syment_count and obj_conv_table_size here. (coff_count_linenumbers): Reindent. If bfd_get_symcount is zero, add up the line numbers from the sections. (coff_write_symbols): Don't set bfd_get_symcount. (coff_pointerize_aux): Don't pointerize a nonpositive x_endndx field. (coff_get_normalized_symtab): Use obj_raw_syment_count, not bfd_get_symcount. (coff_print_symbol): If auxp->fix_end, print x_endndx value. * coffswap.h (coff_swap_reloc_in): Rename from bfd_swap_reloc_in. Reindent. Change argument type to PTR. * coff-a29k.c (coff_a29k_relocate_section): New static function. (coff_relocate_section): Define. * configure.in (a29kcoff_big_vec): Compile cofflink.o. * coff-alpha.c (alpha_ecoff_backend_data): Initialize new fields. * coff-mips.c (mips_ecoff_backend_data): Likewise. * libcoff.h: Rebuilt. * Makefile.in: Rebuilt dependencies. (BFD32_BACKENDS): Add cofflink.o. (CFILES): Add cofflink.c.
1994-09-06 21:28:55 +02:00
#define obj_coff_external_syms(bfd) (coff_data (bfd)->external_syms)
#define obj_coff_strings(bfd) (coff_data (bfd)->strings)
#define obj_coff_sym_hashes(bfd) (coff_data (bfd)->sym_hashes)
1991-03-21 22:11:25 +01:00
/* `Tdata' information kept for COFF files. */
typedef struct coff_tdata
{
struct coff_symbol_struct *symbols; /* symtab for input bfd */
1991-03-21 22:11:25 +01:00
unsigned int *conversion_table;
int conv_table_size;
1991-03-21 22:11:25 +01:00
file_ptr sym_filepos;
struct coff_ptr_struct *raw_syments;
1991-03-21 22:11:25 +01:00
unsigned int raw_syment_count;
1991-03-21 22:11:25 +01:00
/* These are only valid once writing has begun */
long int relocbase;
/* These members communicate important constants about the symbol table
to GDB's symbol-reading code. These `constants' unfortunately vary
from coff implementation to implementation... */
unsigned local_n_btmask;
unsigned local_n_btshft;
unsigned local_n_tmask;
unsigned local_n_tshift;
unsigned local_symesz;
unsigned local_auxesz;
unsigned local_linesz;
Add new style linker support to COFF backend. a29k only for now. * cofflink.c: New file. * libcoff-in.h: Include bfdlink.h. (obj_coff_external_syms, obj_coff_strings): Define accessor macro. (obj_coff_sym_hashes): Define accessor macro. (struct coff_tdata): Add fields external_syms, strings, and sym_hashes. (struct coff_link_hash_entry): Define. (struct coff_link_hash_table): Define. (coff_link_hash_lookup, coff_link_hash_traverse): Define. (coff_hash_table): Define. (_bfd_coff_link_hash_table_create): Declare. (_bfd_coff_link_add_symbols, _bfd_coff_final_link): Declare. * coffcode.h (bfd_coff_backend_data): Add fields _bfd_relsz, _bfd_coff_swap_reloc_in, _bfd_coff_sym_is_global, _bfd_coff_compute_section_file_positions, _bfd_coff_relocate_section. (bfd_coff_relsz, bfd_coff_swap_reloc_in): Define. (bfd_coff_sym_is_global): Define. (bfd_coff_compute_section_file_positions): Define. (bfd_coff_relocate_section): Define. (coff_mkobject_hook): Initialize obj_raw_syment_count and obj_conv_table_size. (coff_compute_section_file_positions): Set target_index of all sections. Set output_has_begun field. (coff_write_object_contents): Don't set target_index; now done by coff_compute_section_file_positions. Remove obsolete handling of scn_base and data_base. Don't bother to check that target_index is positive, since it always is. Remove use of pad, which is always zero. Check obj_raw_syment_count, not bfd_get_symcount, for the number of symbols, but only write them out if bfd_get_symcount is non-zero. (coff_slurp_symbol_table): Use obj_raw_syment_count, not bfd_get_symcount for the number of symbols. Don't set obj_conv_table_size. (coff_sym_is_global): New static function or macro. (coff_slurp_reloc_table): Call coff_swap_reloc_in, not bfd_swap_reloc_in. (coff_bfd_link_hash_table_create): If coff_relocate_section is defined, define as _bfd_coff_link_hash_table_create. (coff_bfd_link_add_symbols): Similar change. (coff_bfd_final_link): Similar change. (coff_relocate_section): Define as NULL if not defined. (bfd_coff_std_swap_table): Initialize new fields. * coffgen.c (coff_real_object_p): Don't set obj_raw_syment_count and obj_conv_table_size here. (coff_count_linenumbers): Reindent. If bfd_get_symcount is zero, add up the line numbers from the sections. (coff_write_symbols): Don't set bfd_get_symcount. (coff_pointerize_aux): Don't pointerize a nonpositive x_endndx field. (coff_get_normalized_symtab): Use obj_raw_syment_count, not bfd_get_symcount. (coff_print_symbol): If auxp->fix_end, print x_endndx value. * coffswap.h (coff_swap_reloc_in): Rename from bfd_swap_reloc_in. Reindent. Change argument type to PTR. * coff-a29k.c (coff_a29k_relocate_section): New static function. (coff_relocate_section): Define. * configure.in (a29kcoff_big_vec): Compile cofflink.o. * coff-alpha.c (alpha_ecoff_backend_data): Initialize new fields. * coff-mips.c (mips_ecoff_backend_data): Likewise. * libcoff.h: Rebuilt. * Makefile.in: Rebuilt dependencies. (BFD32_BACKENDS): Add cofflink.o. (CFILES): Add cofflink.c.
1994-09-06 21:28:55 +02:00
/* Used by the COFF backend linker. */
PTR external_syms;
char *strings;
struct coff_link_hash_entry **sym_hashes;
1991-04-23 18:02:09 +02:00
} coff_data_type;
1991-03-21 22:11:25 +01:00
/* We take the address of the first element of a asymbol to ensure that the
1991-03-21 22:11:25 +01:00
* macro is only ever applied to an asymbol. */
#define coffsymbol(asymbol) ((coff_symbol_type *)(&((asymbol)->the_bfd)))
Add new style linker support to COFF backend. a29k only for now. * cofflink.c: New file. * libcoff-in.h: Include bfdlink.h. (obj_coff_external_syms, obj_coff_strings): Define accessor macro. (obj_coff_sym_hashes): Define accessor macro. (struct coff_tdata): Add fields external_syms, strings, and sym_hashes. (struct coff_link_hash_entry): Define. (struct coff_link_hash_table): Define. (coff_link_hash_lookup, coff_link_hash_traverse): Define. (coff_hash_table): Define. (_bfd_coff_link_hash_table_create): Declare. (_bfd_coff_link_add_symbols, _bfd_coff_final_link): Declare. * coffcode.h (bfd_coff_backend_data): Add fields _bfd_relsz, _bfd_coff_swap_reloc_in, _bfd_coff_sym_is_global, _bfd_coff_compute_section_file_positions, _bfd_coff_relocate_section. (bfd_coff_relsz, bfd_coff_swap_reloc_in): Define. (bfd_coff_sym_is_global): Define. (bfd_coff_compute_section_file_positions): Define. (bfd_coff_relocate_section): Define. (coff_mkobject_hook): Initialize obj_raw_syment_count and obj_conv_table_size. (coff_compute_section_file_positions): Set target_index of all sections. Set output_has_begun field. (coff_write_object_contents): Don't set target_index; now done by coff_compute_section_file_positions. Remove obsolete handling of scn_base and data_base. Don't bother to check that target_index is positive, since it always is. Remove use of pad, which is always zero. Check obj_raw_syment_count, not bfd_get_symcount, for the number of symbols, but only write them out if bfd_get_symcount is non-zero. (coff_slurp_symbol_table): Use obj_raw_syment_count, not bfd_get_symcount for the number of symbols. Don't set obj_conv_table_size. (coff_sym_is_global): New static function or macro. (coff_slurp_reloc_table): Call coff_swap_reloc_in, not bfd_swap_reloc_in. (coff_bfd_link_hash_table_create): If coff_relocate_section is defined, define as _bfd_coff_link_hash_table_create. (coff_bfd_link_add_symbols): Similar change. (coff_bfd_final_link): Similar change. (coff_relocate_section): Define as NULL if not defined. (bfd_coff_std_swap_table): Initialize new fields. * coffgen.c (coff_real_object_p): Don't set obj_raw_syment_count and obj_conv_table_size here. (coff_count_linenumbers): Reindent. If bfd_get_symcount is zero, add up the line numbers from the sections. (coff_write_symbols): Don't set bfd_get_symcount. (coff_pointerize_aux): Don't pointerize a nonpositive x_endndx field. (coff_get_normalized_symtab): Use obj_raw_syment_count, not bfd_get_symcount. (coff_print_symbol): If auxp->fix_end, print x_endndx value. * coffswap.h (coff_swap_reloc_in): Rename from bfd_swap_reloc_in. Reindent. Change argument type to PTR. * coff-a29k.c (coff_a29k_relocate_section): New static function. (coff_relocate_section): Define. * configure.in (a29kcoff_big_vec): Compile cofflink.o. * coff-alpha.c (alpha_ecoff_backend_data): Initialize new fields. * coff-mips.c (mips_ecoff_backend_data): Likewise. * libcoff.h: Rebuilt. * Makefile.in: Rebuilt dependencies. (BFD32_BACKENDS): Add cofflink.o. (CFILES): Add cofflink.c.
1994-09-06 21:28:55 +02:00
/* COFF linker hash table entries. */
struct coff_link_hash_entry
{
struct bfd_link_hash_entry root;
/* Symbol index in output file. Set to -1 initially. Set to -2 if
there is a reloc against this symbol. */
long indx;
/* Symbol type. */
unsigned short type;
/* Symbol class. */
unsigned char class;
/* Number of auxiliary entries. */
char numaux;
/* BFD to take auxiliary entries from. */
bfd *auxbfd;
/* Pointer to array of auxiliary entries, if any. */
union internal_auxent *aux;
};
/* COFF linker hash table. */
struct coff_link_hash_table
{
struct bfd_link_hash_table root;
};
/* Look up an entry in a COFF linker hash table. */
#define coff_link_hash_lookup(table, string, create, copy, follow) \
((struct coff_link_hash_entry *) \
bfd_link_hash_lookup (&(table)->root, (string), (create), \
(copy), (follow)))
/* Traverse a COFF linker hash table. */
#define coff_link_hash_traverse(table, func, info) \
(bfd_link_hash_traverse \
(&(table)->root, \
(boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \
(info)))
/* Get the COFF linker hash table from a link_info structure. */
#define coff_hash_table(p) ((struct coff_link_hash_table *) ((p)->hash))
/* Functions in coffgen.c. */
extern const bfd_target *coff_object_p PARAMS ((bfd *));
extern struct sec *coff_section_from_bfd_index PARAMS ((bfd *, int));
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Changes to let BFD return an error indication from get_symtab_upper_bound, bfd_canonicalize_symtab, bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now return long instead of unsigned int, and use -1 to indicate an error. Along the way, rename get_symtab_upper_bound to bfd_get_symtab_upper_bound. * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on errors. (bfd_canonicalize_reloc): Likewise. * syms.c (bfd_get_symtab_upper_bound): Renamed from get_symtab_upper_bound. * targets.c (bfd_target): Renamed _get_symtab_upper_bound to _bfd_get_symtab_upper_bound, and changed it and _bfd_canonicalize_symtab and _get_reloc_upper_bound and _bfd_canonicalize_reloc to all return long. * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. (NAME(aout,get_symtab_upper_bound)): Likewise. * bout.c (b_out_canonicalize_reloc): Likewise. (b_out_get_reloc_upper_bound): Likewise. * coffcode.h (coff_canonicalize_reloc): Likewise. * coffgen.c (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * elfcode.h (elf_get_symtab_upper_bound): Likewise. (elf_get_reloc_upper_bound): Likewise. (elf_canonicalize_reloc): Likewise. (elf_get_symtab): Likewise. * hp300hpux.c (MY(get_symtab)): Likewise. (MY(get_symtab_upper_bound)): Likewise. (MY(canonicalize_reloc)): Likewise. * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. * ieee.c (ieee_slurp_external_symbols): Change return type to boolean. Check for errors from get_symbol. (ieee_slurp_symbol_table): Change return type to boolean. Check for errors from ieee_slurp_external_symbols. (ieee_get_symtab_upper_bound): Return long, and -1 on errors. (ieee_get_symtab): Likewise. (ieee_get_reloc_upper_bound): Likewise. (ieee_canonicalize_reloc): Likewise. * mipsbsd.c (MY(canonicalize_reloc)): Likewise. * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. (nlm_get_symtab): Likewise. (nlm_get_reloc_upper_bound): Likewise. (nlm_canonicalize_reloc): Likewise. * oasys.c (oasys_get_symtab_upper_bound): Likewise. (oasys_get_symtab): Likewise. (oasys_get_reloc_upper_bound): Likewise. (oasys_canonicalize_reloc): Likewise. * som.c (som_get_symtab_upper_bound): Likewise. (som_get_symtab): Likewise. (som_get_reloc_upper_bound): Likewise. (som_canonicalize_reloc): Likewise. * srec.c (srec_get_symtab_upper_bound): Likewise. (srec_get_symtab): Likewise. (srec_get_reloc_upper_bound): Define as bfd_0l. (srec_canonicalize_reloc): Likewise. * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. (tekhex_get_symtab_upper_bound): Likewise. (tekhex_get_reloc_upper_bound): Define as bfd_0l. (tekhex_canonicalize_reloc): Likewise. * libaout.h (NAME(aout,get_symtab_upper_bound)): Change declaration to return long. (NAME(aout,get_symtab)): Likewise. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. (bfd_elf32_get_symtab): Likewise. (bfd_elf32_get_reloc_upper_bound): Likewise. (bfd_elf32_canonicalize_reloc): Likewise. (bfd_elf64_get_symtab_upper_bound): Likewise. (bfd_elf64_get_symtab): Likewise. (bfd_elf64_get_reloc_upper_bound): Likewise. (bfd_elf64_canonicalize_reloc): Likewise. * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. (nlmNAME(get_symtab)): Likewise. (nlmNAME(get_reloc_upper_bound)): Likewise. (nlmNAME(canonicalize_reloc)): Likewise. * archive.c (compute_and_write_armap): Use error_return and no_memory_return labels rather than freeing information in various places. Change storage, symcount and src_count to long. Check errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * bout.c (b_out_relax_section): Change reloc_size to long. Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (b_out_get_relocated_section_contents): Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise. * elf32-mips.c: Likewise. * elf32-hppa.c (hppa_elf_stub_finish): Likewise. (hppa_look_for_stubs_in_section): Check for errors from bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and bfd_canonicalize_reloc. * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * linker.c (generic_link_read_symbols): Likewise. (_bfd_generic_final_link): Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. (bfd_coff_reloc16_get_relocated_section_contents): Likewise. * libbfd.c (bfd_0l): New function. * libbfd-in.h (bfd_0l): Declare. * aix386-core.c: Change get_symtab_upper_bound, get_symtab, get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather than bfd_0u. * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * libcoff.h: Rebuilt. * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables temp and name.
1994-03-31 00:15:07 +02:00
extern long coff_get_symtab_upper_bound PARAMS ((bfd *));
extern long coff_get_symtab PARAMS ((bfd *, asymbol **));
extern int coff_count_linenumbers PARAMS ((bfd *));
extern struct coff_symbol_struct *coff_symbol_from PARAMS ((bfd *, asymbol *));
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Changes to let BFD return an error indication from get_symtab_upper_bound, bfd_canonicalize_symtab, bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now return long instead of unsigned int, and use -1 to indicate an error. Along the way, rename get_symtab_upper_bound to bfd_get_symtab_upper_bound. * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on errors. (bfd_canonicalize_reloc): Likewise. * syms.c (bfd_get_symtab_upper_bound): Renamed from get_symtab_upper_bound. * targets.c (bfd_target): Renamed _get_symtab_upper_bound to _bfd_get_symtab_upper_bound, and changed it and _bfd_canonicalize_symtab and _get_reloc_upper_bound and _bfd_canonicalize_reloc to all return long. * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. (NAME(aout,get_symtab_upper_bound)): Likewise. * bout.c (b_out_canonicalize_reloc): Likewise. (b_out_get_reloc_upper_bound): Likewise. * coffcode.h (coff_canonicalize_reloc): Likewise. * coffgen.c (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * elfcode.h (elf_get_symtab_upper_bound): Likewise. (elf_get_reloc_upper_bound): Likewise. (elf_canonicalize_reloc): Likewise. (elf_get_symtab): Likewise. * hp300hpux.c (MY(get_symtab)): Likewise. (MY(get_symtab_upper_bound)): Likewise. (MY(canonicalize_reloc)): Likewise. * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. * ieee.c (ieee_slurp_external_symbols): Change return type to boolean. Check for errors from get_symbol. (ieee_slurp_symbol_table): Change return type to boolean. Check for errors from ieee_slurp_external_symbols. (ieee_get_symtab_upper_bound): Return long, and -1 on errors. (ieee_get_symtab): Likewise. (ieee_get_reloc_upper_bound): Likewise. (ieee_canonicalize_reloc): Likewise. * mipsbsd.c (MY(canonicalize_reloc)): Likewise. * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. (nlm_get_symtab): Likewise. (nlm_get_reloc_upper_bound): Likewise. (nlm_canonicalize_reloc): Likewise. * oasys.c (oasys_get_symtab_upper_bound): Likewise. (oasys_get_symtab): Likewise. (oasys_get_reloc_upper_bound): Likewise. (oasys_canonicalize_reloc): Likewise. * som.c (som_get_symtab_upper_bound): Likewise. (som_get_symtab): Likewise. (som_get_reloc_upper_bound): Likewise. (som_canonicalize_reloc): Likewise. * srec.c (srec_get_symtab_upper_bound): Likewise. (srec_get_symtab): Likewise. (srec_get_reloc_upper_bound): Define as bfd_0l. (srec_canonicalize_reloc): Likewise. * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. (tekhex_get_symtab_upper_bound): Likewise. (tekhex_get_reloc_upper_bound): Define as bfd_0l. (tekhex_canonicalize_reloc): Likewise. * libaout.h (NAME(aout,get_symtab_upper_bound)): Change declaration to return long. (NAME(aout,get_symtab)): Likewise. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. (bfd_elf32_get_symtab): Likewise. (bfd_elf32_get_reloc_upper_bound): Likewise. (bfd_elf32_canonicalize_reloc): Likewise. (bfd_elf64_get_symtab_upper_bound): Likewise. (bfd_elf64_get_symtab): Likewise. (bfd_elf64_get_reloc_upper_bound): Likewise. (bfd_elf64_canonicalize_reloc): Likewise. * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. (nlmNAME(get_symtab)): Likewise. (nlmNAME(get_reloc_upper_bound)): Likewise. (nlmNAME(canonicalize_reloc)): Likewise. * archive.c (compute_and_write_armap): Use error_return and no_memory_return labels rather than freeing information in various places. Change storage, symcount and src_count to long. Check errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * bout.c (b_out_relax_section): Change reloc_size to long. Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (b_out_get_relocated_section_contents): Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise. * elf32-mips.c: Likewise. * elf32-hppa.c (hppa_elf_stub_finish): Likewise. (hppa_look_for_stubs_in_section): Check for errors from bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and bfd_canonicalize_reloc. * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * linker.c (generic_link_read_symbols): Likewise. (_bfd_generic_final_link): Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. (bfd_coff_reloc16_get_relocated_section_contents): Likewise. * libbfd.c (bfd_0l): New function. * libbfd-in.h (bfd_0l): Declare. * aix386-core.c: Change get_symtab_upper_bound, get_symtab, get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather than bfd_0u. * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * libcoff.h: Rebuilt. * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables temp and name.
1994-03-31 00:15:07 +02:00
extern boolean coff_renumber_symbols PARAMS ((bfd *));
extern void coff_mangle_symbols PARAMS ((bfd *));
extern boolean coff_write_symbols PARAMS ((bfd *));
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Changes to let BFD return an error indication from get_symtab_upper_bound, bfd_canonicalize_symtab, bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now return long instead of unsigned int, and use -1 to indicate an error. Along the way, rename get_symtab_upper_bound to bfd_get_symtab_upper_bound. * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on errors. (bfd_canonicalize_reloc): Likewise. * syms.c (bfd_get_symtab_upper_bound): Renamed from get_symtab_upper_bound. * targets.c (bfd_target): Renamed _get_symtab_upper_bound to _bfd_get_symtab_upper_bound, and changed it and _bfd_canonicalize_symtab and _get_reloc_upper_bound and _bfd_canonicalize_reloc to all return long. * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. (NAME(aout,get_symtab_upper_bound)): Likewise. * bout.c (b_out_canonicalize_reloc): Likewise. (b_out_get_reloc_upper_bound): Likewise. * coffcode.h (coff_canonicalize_reloc): Likewise. * coffgen.c (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * elfcode.h (elf_get_symtab_upper_bound): Likewise. (elf_get_reloc_upper_bound): Likewise. (elf_canonicalize_reloc): Likewise. (elf_get_symtab): Likewise. * hp300hpux.c (MY(get_symtab)): Likewise. (MY(get_symtab_upper_bound)): Likewise. (MY(canonicalize_reloc)): Likewise. * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. * ieee.c (ieee_slurp_external_symbols): Change return type to boolean. Check for errors from get_symbol. (ieee_slurp_symbol_table): Change return type to boolean. Check for errors from ieee_slurp_external_symbols. (ieee_get_symtab_upper_bound): Return long, and -1 on errors. (ieee_get_symtab): Likewise. (ieee_get_reloc_upper_bound): Likewise. (ieee_canonicalize_reloc): Likewise. * mipsbsd.c (MY(canonicalize_reloc)): Likewise. * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. (nlm_get_symtab): Likewise. (nlm_get_reloc_upper_bound): Likewise. (nlm_canonicalize_reloc): Likewise. * oasys.c (oasys_get_symtab_upper_bound): Likewise. (oasys_get_symtab): Likewise. (oasys_get_reloc_upper_bound): Likewise. (oasys_canonicalize_reloc): Likewise. * som.c (som_get_symtab_upper_bound): Likewise. (som_get_symtab): Likewise. (som_get_reloc_upper_bound): Likewise. (som_canonicalize_reloc): Likewise. * srec.c (srec_get_symtab_upper_bound): Likewise. (srec_get_symtab): Likewise. (srec_get_reloc_upper_bound): Define as bfd_0l. (srec_canonicalize_reloc): Likewise. * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. (tekhex_get_symtab_upper_bound): Likewise. (tekhex_get_reloc_upper_bound): Define as bfd_0l. (tekhex_canonicalize_reloc): Likewise. * libaout.h (NAME(aout,get_symtab_upper_bound)): Change declaration to return long. (NAME(aout,get_symtab)): Likewise. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. (bfd_elf32_get_symtab): Likewise. (bfd_elf32_get_reloc_upper_bound): Likewise. (bfd_elf32_canonicalize_reloc): Likewise. (bfd_elf64_get_symtab_upper_bound): Likewise. (bfd_elf64_get_symtab): Likewise. (bfd_elf64_get_reloc_upper_bound): Likewise. (bfd_elf64_canonicalize_reloc): Likewise. * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. (nlmNAME(get_symtab)): Likewise. (nlmNAME(get_reloc_upper_bound)): Likewise. (nlmNAME(canonicalize_reloc)): Likewise. * archive.c (compute_and_write_armap): Use error_return and no_memory_return labels rather than freeing information in various places. Change storage, symcount and src_count to long. Check errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * bout.c (b_out_relax_section): Change reloc_size to long. Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (b_out_get_relocated_section_contents): Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise. * elf32-mips.c: Likewise. * elf32-hppa.c (hppa_elf_stub_finish): Likewise. (hppa_look_for_stubs_in_section): Check for errors from bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and bfd_canonicalize_reloc. * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * linker.c (generic_link_read_symbols): Likewise. (_bfd_generic_final_link): Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. (bfd_coff_reloc16_get_relocated_section_contents): Likewise. * libbfd.c (bfd_0l): New function. * libbfd-in.h (bfd_0l): Declare. * aix386-core.c: Change get_symtab_upper_bound, get_symtab, get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather than bfd_0u. * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * libcoff.h: Rebuilt. * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables temp and name.
1994-03-31 00:15:07 +02:00
extern boolean coff_write_linenumbers PARAMS ((bfd *));
extern alent *coff_get_lineno PARAMS ((bfd *, asymbol *));
extern asymbol *coff_section_symbol PARAMS ((bfd *, char *));
extern struct coff_ptr_struct *coff_get_normalized_symtab PARAMS ((bfd *));
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Changes to let BFD return an error indication from get_symtab_upper_bound, bfd_canonicalize_symtab, bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now return long instead of unsigned int, and use -1 to indicate an error. Along the way, rename get_symtab_upper_bound to bfd_get_symtab_upper_bound. * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on errors. (bfd_canonicalize_reloc): Likewise. * syms.c (bfd_get_symtab_upper_bound): Renamed from get_symtab_upper_bound. * targets.c (bfd_target): Renamed _get_symtab_upper_bound to _bfd_get_symtab_upper_bound, and changed it and _bfd_canonicalize_symtab and _get_reloc_upper_bound and _bfd_canonicalize_reloc to all return long. * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. (NAME(aout,get_symtab_upper_bound)): Likewise. * bout.c (b_out_canonicalize_reloc): Likewise. (b_out_get_reloc_upper_bound): Likewise. * coffcode.h (coff_canonicalize_reloc): Likewise. * coffgen.c (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * elfcode.h (elf_get_symtab_upper_bound): Likewise. (elf_get_reloc_upper_bound): Likewise. (elf_canonicalize_reloc): Likewise. (elf_get_symtab): Likewise. * hp300hpux.c (MY(get_symtab)): Likewise. (MY(get_symtab_upper_bound)): Likewise. (MY(canonicalize_reloc)): Likewise. * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. * ieee.c (ieee_slurp_external_symbols): Change return type to boolean. Check for errors from get_symbol. (ieee_slurp_symbol_table): Change return type to boolean. Check for errors from ieee_slurp_external_symbols. (ieee_get_symtab_upper_bound): Return long, and -1 on errors. (ieee_get_symtab): Likewise. (ieee_get_reloc_upper_bound): Likewise. (ieee_canonicalize_reloc): Likewise. * mipsbsd.c (MY(canonicalize_reloc)): Likewise. * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. (nlm_get_symtab): Likewise. (nlm_get_reloc_upper_bound): Likewise. (nlm_canonicalize_reloc): Likewise. * oasys.c (oasys_get_symtab_upper_bound): Likewise. (oasys_get_symtab): Likewise. (oasys_get_reloc_upper_bound): Likewise. (oasys_canonicalize_reloc): Likewise. * som.c (som_get_symtab_upper_bound): Likewise. (som_get_symtab): Likewise. (som_get_reloc_upper_bound): Likewise. (som_canonicalize_reloc): Likewise. * srec.c (srec_get_symtab_upper_bound): Likewise. (srec_get_symtab): Likewise. (srec_get_reloc_upper_bound): Define as bfd_0l. (srec_canonicalize_reloc): Likewise. * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. (tekhex_get_symtab_upper_bound): Likewise. (tekhex_get_reloc_upper_bound): Define as bfd_0l. (tekhex_canonicalize_reloc): Likewise. * libaout.h (NAME(aout,get_symtab_upper_bound)): Change declaration to return long. (NAME(aout,get_symtab)): Likewise. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. (bfd_elf32_get_symtab): Likewise. (bfd_elf32_get_reloc_upper_bound): Likewise. (bfd_elf32_canonicalize_reloc): Likewise. (bfd_elf64_get_symtab_upper_bound): Likewise. (bfd_elf64_get_symtab): Likewise. (bfd_elf64_get_reloc_upper_bound): Likewise. (bfd_elf64_canonicalize_reloc): Likewise. * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. (nlmNAME(get_symtab)): Likewise. (nlmNAME(get_reloc_upper_bound)): Likewise. (nlmNAME(canonicalize_reloc)): Likewise. * archive.c (compute_and_write_armap): Use error_return and no_memory_return labels rather than freeing information in various places. Change storage, symcount and src_count to long. Check errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * bout.c (b_out_relax_section): Change reloc_size to long. Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (b_out_get_relocated_section_contents): Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise. * elf32-mips.c: Likewise. * elf32-hppa.c (hppa_elf_stub_finish): Likewise. (hppa_look_for_stubs_in_section): Check for errors from bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and bfd_canonicalize_reloc. * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * linker.c (generic_link_read_symbols): Likewise. (_bfd_generic_final_link): Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. (bfd_coff_reloc16_get_relocated_section_contents): Likewise. * libbfd.c (bfd_0l): New function. * libbfd-in.h (bfd_0l): Declare. * aix386-core.c: Change get_symtab_upper_bound, get_symtab, get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather than bfd_0u. * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * libcoff.h: Rebuilt. * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables temp and name.
1994-03-31 00:15:07 +02:00
extern long coff_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr));
extern asymbol *coff_make_empty_symbol PARAMS ((bfd *));
extern void coff_print_symbol PARAMS ((bfd *, PTR filep, asymbol *,
bfd_print_symbol_type how));
extern void coff_get_symbol_info PARAMS ((bfd *, asymbol *,
symbol_info *ret));
extern asymbol *coff_bfd_make_debug_symbol PARAMS ((bfd *, PTR,
unsigned long));
extern boolean coff_find_nearest_line PARAMS ((bfd *,
asection *,
asymbol **,
bfd_vma offset,
CONST char **filename_ptr,
CONST char **functionname_ptr,
unsigned int *line_ptr));
extern int coff_sizeof_headers PARAMS ((bfd *, boolean reloc));
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Changes to let BFD return an error indication from get_symtab_upper_bound, bfd_canonicalize_symtab, bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now return long instead of unsigned int, and use -1 to indicate an error. Along the way, rename get_symtab_upper_bound to bfd_get_symtab_upper_bound. * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on errors. (bfd_canonicalize_reloc): Likewise. * syms.c (bfd_get_symtab_upper_bound): Renamed from get_symtab_upper_bound. * targets.c (bfd_target): Renamed _get_symtab_upper_bound to _bfd_get_symtab_upper_bound, and changed it and _bfd_canonicalize_symtab and _get_reloc_upper_bound and _bfd_canonicalize_reloc to all return long. * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. (NAME(aout,get_symtab_upper_bound)): Likewise. * bout.c (b_out_canonicalize_reloc): Likewise. (b_out_get_reloc_upper_bound): Likewise. * coffcode.h (coff_canonicalize_reloc): Likewise. * coffgen.c (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * elfcode.h (elf_get_symtab_upper_bound): Likewise. (elf_get_reloc_upper_bound): Likewise. (elf_canonicalize_reloc): Likewise. (elf_get_symtab): Likewise. * hp300hpux.c (MY(get_symtab)): Likewise. (MY(get_symtab_upper_bound)): Likewise. (MY(canonicalize_reloc)): Likewise. * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. * ieee.c (ieee_slurp_external_symbols): Change return type to boolean. Check for errors from get_symbol. (ieee_slurp_symbol_table): Change return type to boolean. Check for errors from ieee_slurp_external_symbols. (ieee_get_symtab_upper_bound): Return long, and -1 on errors. (ieee_get_symtab): Likewise. (ieee_get_reloc_upper_bound): Likewise. (ieee_canonicalize_reloc): Likewise. * mipsbsd.c (MY(canonicalize_reloc)): Likewise. * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. (nlm_get_symtab): Likewise. (nlm_get_reloc_upper_bound): Likewise. (nlm_canonicalize_reloc): Likewise. * oasys.c (oasys_get_symtab_upper_bound): Likewise. (oasys_get_symtab): Likewise. (oasys_get_reloc_upper_bound): Likewise. (oasys_canonicalize_reloc): Likewise. * som.c (som_get_symtab_upper_bound): Likewise. (som_get_symtab): Likewise. (som_get_reloc_upper_bound): Likewise. (som_canonicalize_reloc): Likewise. * srec.c (srec_get_symtab_upper_bound): Likewise. (srec_get_symtab): Likewise. (srec_get_reloc_upper_bound): Define as bfd_0l. (srec_canonicalize_reloc): Likewise. * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. (tekhex_get_symtab_upper_bound): Likewise. (tekhex_get_reloc_upper_bound): Define as bfd_0l. (tekhex_canonicalize_reloc): Likewise. * libaout.h (NAME(aout,get_symtab_upper_bound)): Change declaration to return long. (NAME(aout,get_symtab)): Likewise. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. (bfd_elf32_get_symtab): Likewise. (bfd_elf32_get_reloc_upper_bound): Likewise. (bfd_elf32_canonicalize_reloc): Likewise. (bfd_elf64_get_symtab_upper_bound): Likewise. (bfd_elf64_get_symtab): Likewise. (bfd_elf64_get_reloc_upper_bound): Likewise. (bfd_elf64_canonicalize_reloc): Likewise. * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. (nlmNAME(get_symtab)): Likewise. (nlmNAME(get_reloc_upper_bound)): Likewise. (nlmNAME(canonicalize_reloc)): Likewise. * archive.c (compute_and_write_armap): Use error_return and no_memory_return labels rather than freeing information in various places. Change storage, symcount and src_count to long. Check errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * bout.c (b_out_relax_section): Change reloc_size to long. Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (b_out_get_relocated_section_contents): Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise. * elf32-mips.c: Likewise. * elf32-hppa.c (hppa_elf_stub_finish): Likewise. (hppa_look_for_stubs_in_section): Check for errors from bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and bfd_canonicalize_reloc. * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * linker.c (generic_link_read_symbols): Likewise. (_bfd_generic_final_link): Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. (bfd_coff_reloc16_get_relocated_section_contents): Likewise. * libbfd.c (bfd_0l): New function. * libbfd-in.h (bfd_0l): Declare. * aix386-core.c: Change get_symtab_upper_bound, get_symtab, get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather than bfd_0u. * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * libcoff.h: Rebuilt. * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables temp and name.
1994-03-31 00:15:07 +02:00
extern boolean bfd_coff_reloc16_relax_section
PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *));
extern bfd_byte *bfd_coff_reloc16_get_relocated_section_contents
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
bfd_byte *, boolean relocateable, asymbol **));
extern bfd_vma bfd_coff_reloc16_get_value PARAMS ((arelent *,
struct bfd_link_info *,
asection *));
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Changes to let BFD return an error indication from get_symtab_upper_bound, bfd_canonicalize_symtab, bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now return long instead of unsigned int, and use -1 to indicate an error. Along the way, rename get_symtab_upper_bound to bfd_get_symtab_upper_bound. * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on errors. (bfd_canonicalize_reloc): Likewise. * syms.c (bfd_get_symtab_upper_bound): Renamed from get_symtab_upper_bound. * targets.c (bfd_target): Renamed _get_symtab_upper_bound to _bfd_get_symtab_upper_bound, and changed it and _bfd_canonicalize_symtab and _get_reloc_upper_bound and _bfd_canonicalize_reloc to all return long. * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. (NAME(aout,get_symtab_upper_bound)): Likewise. * bout.c (b_out_canonicalize_reloc): Likewise. (b_out_get_reloc_upper_bound): Likewise. * coffcode.h (coff_canonicalize_reloc): Likewise. * coffgen.c (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * elfcode.h (elf_get_symtab_upper_bound): Likewise. (elf_get_reloc_upper_bound): Likewise. (elf_canonicalize_reloc): Likewise. (elf_get_symtab): Likewise. * hp300hpux.c (MY(get_symtab)): Likewise. (MY(get_symtab_upper_bound)): Likewise. (MY(canonicalize_reloc)): Likewise. * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. * ieee.c (ieee_slurp_external_symbols): Change return type to boolean. Check for errors from get_symbol. (ieee_slurp_symbol_table): Change return type to boolean. Check for errors from ieee_slurp_external_symbols. (ieee_get_symtab_upper_bound): Return long, and -1 on errors. (ieee_get_symtab): Likewise. (ieee_get_reloc_upper_bound): Likewise. (ieee_canonicalize_reloc): Likewise. * mipsbsd.c (MY(canonicalize_reloc)): Likewise. * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. (nlm_get_symtab): Likewise. (nlm_get_reloc_upper_bound): Likewise. (nlm_canonicalize_reloc): Likewise. * oasys.c (oasys_get_symtab_upper_bound): Likewise. (oasys_get_symtab): Likewise. (oasys_get_reloc_upper_bound): Likewise. (oasys_canonicalize_reloc): Likewise. * som.c (som_get_symtab_upper_bound): Likewise. (som_get_symtab): Likewise. (som_get_reloc_upper_bound): Likewise. (som_canonicalize_reloc): Likewise. * srec.c (srec_get_symtab_upper_bound): Likewise. (srec_get_symtab): Likewise. (srec_get_reloc_upper_bound): Define as bfd_0l. (srec_canonicalize_reloc): Likewise. * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. (tekhex_get_symtab_upper_bound): Likewise. (tekhex_get_reloc_upper_bound): Define as bfd_0l. (tekhex_canonicalize_reloc): Likewise. * libaout.h (NAME(aout,get_symtab_upper_bound)): Change declaration to return long. (NAME(aout,get_symtab)): Likewise. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. (bfd_elf32_get_symtab): Likewise. (bfd_elf32_get_reloc_upper_bound): Likewise. (bfd_elf32_canonicalize_reloc): Likewise. (bfd_elf64_get_symtab_upper_bound): Likewise. (bfd_elf64_get_symtab): Likewise. (bfd_elf64_get_reloc_upper_bound): Likewise. (bfd_elf64_canonicalize_reloc): Likewise. * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. (nlmNAME(get_symtab)): Likewise. (nlmNAME(get_reloc_upper_bound)): Likewise. (nlmNAME(canonicalize_reloc)): Likewise. * archive.c (compute_and_write_armap): Use error_return and no_memory_return labels rather than freeing information in various places. Change storage, symcount and src_count to long. Check errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * bout.c (b_out_relax_section): Change reloc_size to long. Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (b_out_get_relocated_section_contents): Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise. * elf32-mips.c: Likewise. * elf32-hppa.c (hppa_elf_stub_finish): Likewise. (hppa_look_for_stubs_in_section): Check for errors from bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and bfd_canonicalize_reloc. * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * linker.c (generic_link_read_symbols): Likewise. (_bfd_generic_final_link): Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. (bfd_coff_reloc16_get_relocated_section_contents): Likewise. * libbfd.c (bfd_0l): New function. * libbfd-in.h (bfd_0l): Declare. * aix386-core.c: Change get_symtab_upper_bound, get_symtab, get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather than bfd_0u. * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * libcoff.h: Rebuilt. * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables temp and name.
1994-03-31 00:15:07 +02:00
extern void bfd_perform_slip PARAMS ((bfd *abfd, unsigned int slip,
asection *input_section,
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Changes to let BFD return an error indication from get_symtab_upper_bound, bfd_canonicalize_symtab, bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now return long instead of unsigned int, and use -1 to indicate an error. Along the way, rename get_symtab_upper_bound to bfd_get_symtab_upper_bound. * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on errors. (bfd_canonicalize_reloc): Likewise. * syms.c (bfd_get_symtab_upper_bound): Renamed from get_symtab_upper_bound. * targets.c (bfd_target): Renamed _get_symtab_upper_bound to _bfd_get_symtab_upper_bound, and changed it and _bfd_canonicalize_symtab and _get_reloc_upper_bound and _bfd_canonicalize_reloc to all return long. * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. (NAME(aout,get_symtab_upper_bound)): Likewise. * bout.c (b_out_canonicalize_reloc): Likewise. (b_out_get_reloc_upper_bound): Likewise. * coffcode.h (coff_canonicalize_reloc): Likewise. * coffgen.c (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * elfcode.h (elf_get_symtab_upper_bound): Likewise. (elf_get_reloc_upper_bound): Likewise. (elf_canonicalize_reloc): Likewise. (elf_get_symtab): Likewise. * hp300hpux.c (MY(get_symtab)): Likewise. (MY(get_symtab_upper_bound)): Likewise. (MY(canonicalize_reloc)): Likewise. * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. * ieee.c (ieee_slurp_external_symbols): Change return type to boolean. Check for errors from get_symbol. (ieee_slurp_symbol_table): Change return type to boolean. Check for errors from ieee_slurp_external_symbols. (ieee_get_symtab_upper_bound): Return long, and -1 on errors. (ieee_get_symtab): Likewise. (ieee_get_reloc_upper_bound): Likewise. (ieee_canonicalize_reloc): Likewise. * mipsbsd.c (MY(canonicalize_reloc)): Likewise. * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. (nlm_get_symtab): Likewise. (nlm_get_reloc_upper_bound): Likewise. (nlm_canonicalize_reloc): Likewise. * oasys.c (oasys_get_symtab_upper_bound): Likewise. (oasys_get_symtab): Likewise. (oasys_get_reloc_upper_bound): Likewise. (oasys_canonicalize_reloc): Likewise. * som.c (som_get_symtab_upper_bound): Likewise. (som_get_symtab): Likewise. (som_get_reloc_upper_bound): Likewise. (som_canonicalize_reloc): Likewise. * srec.c (srec_get_symtab_upper_bound): Likewise. (srec_get_symtab): Likewise. (srec_get_reloc_upper_bound): Define as bfd_0l. (srec_canonicalize_reloc): Likewise. * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. (tekhex_get_symtab_upper_bound): Likewise. (tekhex_get_reloc_upper_bound): Define as bfd_0l. (tekhex_canonicalize_reloc): Likewise. * libaout.h (NAME(aout,get_symtab_upper_bound)): Change declaration to return long. (NAME(aout,get_symtab)): Likewise. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. (bfd_elf32_get_symtab): Likewise. (bfd_elf32_get_reloc_upper_bound): Likewise. (bfd_elf32_canonicalize_reloc): Likewise. (bfd_elf64_get_symtab_upper_bound): Likewise. (bfd_elf64_get_symtab): Likewise. (bfd_elf64_get_reloc_upper_bound): Likewise. (bfd_elf64_canonicalize_reloc): Likewise. * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. (nlmNAME(get_symtab)): Likewise. (nlmNAME(get_reloc_upper_bound)): Likewise. (nlmNAME(canonicalize_reloc)): Likewise. * archive.c (compute_and_write_armap): Use error_return and no_memory_return labels rather than freeing information in various places. Change storage, symcount and src_count to long. Check errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * bout.c (b_out_relax_section): Change reloc_size to long. Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (b_out_get_relocated_section_contents): Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise. * elf32-mips.c: Likewise. * elf32-hppa.c (hppa_elf_stub_finish): Likewise. (hppa_look_for_stubs_in_section): Check for errors from bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and bfd_canonicalize_reloc. * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * linker.c (generic_link_read_symbols): Likewise. (_bfd_generic_final_link): Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. (bfd_coff_reloc16_get_relocated_section_contents): Likewise. * libbfd.c (bfd_0l): New function. * libbfd-in.h (bfd_0l): Declare. * aix386-core.c: Change get_symtab_upper_bound, get_symtab, get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather than bfd_0u. * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * libcoff.h: Rebuilt. * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables temp and name.
1994-03-31 00:15:07 +02:00
bfd_vma val));
Add new style linker support to COFF backend. a29k only for now. * cofflink.c: New file. * libcoff-in.h: Include bfdlink.h. (obj_coff_external_syms, obj_coff_strings): Define accessor macro. (obj_coff_sym_hashes): Define accessor macro. (struct coff_tdata): Add fields external_syms, strings, and sym_hashes. (struct coff_link_hash_entry): Define. (struct coff_link_hash_table): Define. (coff_link_hash_lookup, coff_link_hash_traverse): Define. (coff_hash_table): Define. (_bfd_coff_link_hash_table_create): Declare. (_bfd_coff_link_add_symbols, _bfd_coff_final_link): Declare. * coffcode.h (bfd_coff_backend_data): Add fields _bfd_relsz, _bfd_coff_swap_reloc_in, _bfd_coff_sym_is_global, _bfd_coff_compute_section_file_positions, _bfd_coff_relocate_section. (bfd_coff_relsz, bfd_coff_swap_reloc_in): Define. (bfd_coff_sym_is_global): Define. (bfd_coff_compute_section_file_positions): Define. (bfd_coff_relocate_section): Define. (coff_mkobject_hook): Initialize obj_raw_syment_count and obj_conv_table_size. (coff_compute_section_file_positions): Set target_index of all sections. Set output_has_begun field. (coff_write_object_contents): Don't set target_index; now done by coff_compute_section_file_positions. Remove obsolete handling of scn_base and data_base. Don't bother to check that target_index is positive, since it always is. Remove use of pad, which is always zero. Check obj_raw_syment_count, not bfd_get_symcount, for the number of symbols, but only write them out if bfd_get_symcount is non-zero. (coff_slurp_symbol_table): Use obj_raw_syment_count, not bfd_get_symcount for the number of symbols. Don't set obj_conv_table_size. (coff_sym_is_global): New static function or macro. (coff_slurp_reloc_table): Call coff_swap_reloc_in, not bfd_swap_reloc_in. (coff_bfd_link_hash_table_create): If coff_relocate_section is defined, define as _bfd_coff_link_hash_table_create. (coff_bfd_link_add_symbols): Similar change. (coff_bfd_final_link): Similar change. (coff_relocate_section): Define as NULL if not defined. (bfd_coff_std_swap_table): Initialize new fields. * coffgen.c (coff_real_object_p): Don't set obj_raw_syment_count and obj_conv_table_size here. (coff_count_linenumbers): Reindent. If bfd_get_symcount is zero, add up the line numbers from the sections. (coff_write_symbols): Don't set bfd_get_symcount. (coff_pointerize_aux): Don't pointerize a nonpositive x_endndx field. (coff_get_normalized_symtab): Use obj_raw_syment_count, not bfd_get_symcount. (coff_print_symbol): If auxp->fix_end, print x_endndx value. * coffswap.h (coff_swap_reloc_in): Rename from bfd_swap_reloc_in. Reindent. Change argument type to PTR. * coff-a29k.c (coff_a29k_relocate_section): New static function. (coff_relocate_section): Define. * configure.in (a29kcoff_big_vec): Compile cofflink.o. * coff-alpha.c (alpha_ecoff_backend_data): Initialize new fields. * coff-mips.c (mips_ecoff_backend_data): Likewise. * libcoff.h: Rebuilt. * Makefile.in: Rebuilt dependencies. (BFD32_BACKENDS): Add cofflink.o. (CFILES): Add cofflink.c.
1994-09-06 21:28:55 +02:00
/* Functions in cofflink.c. */
extern struct bfd_link_hash_table *_bfd_coff_link_hash_table_create
PARAMS ((bfd *));
extern boolean _bfd_coff_link_add_symbols
PARAMS ((bfd *, struct bfd_link_info *));
extern boolean _bfd_coff_final_link
PARAMS ((bfd *, struct bfd_link_info *));
/* And more taken from the source .. */
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Changes to let BFD return an error indication from get_symtab_upper_bound, bfd_canonicalize_symtab, bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now return long instead of unsigned int, and use -1 to indicate an error. Along the way, rename get_symtab_upper_bound to bfd_get_symtab_upper_bound. * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on errors. (bfd_canonicalize_reloc): Likewise. * syms.c (bfd_get_symtab_upper_bound): Renamed from get_symtab_upper_bound. * targets.c (bfd_target): Renamed _get_symtab_upper_bound to _bfd_get_symtab_upper_bound, and changed it and _bfd_canonicalize_symtab and _get_reloc_upper_bound and _bfd_canonicalize_reloc to all return long. * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. (NAME(aout,get_symtab_upper_bound)): Likewise. * bout.c (b_out_canonicalize_reloc): Likewise. (b_out_get_reloc_upper_bound): Likewise. * coffcode.h (coff_canonicalize_reloc): Likewise. * coffgen.c (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * elfcode.h (elf_get_symtab_upper_bound): Likewise. (elf_get_reloc_upper_bound): Likewise. (elf_canonicalize_reloc): Likewise. (elf_get_symtab): Likewise. * hp300hpux.c (MY(get_symtab)): Likewise. (MY(get_symtab_upper_bound)): Likewise. (MY(canonicalize_reloc)): Likewise. * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. * ieee.c (ieee_slurp_external_symbols): Change return type to boolean. Check for errors from get_symbol. (ieee_slurp_symbol_table): Change return type to boolean. Check for errors from ieee_slurp_external_symbols. (ieee_get_symtab_upper_bound): Return long, and -1 on errors. (ieee_get_symtab): Likewise. (ieee_get_reloc_upper_bound): Likewise. (ieee_canonicalize_reloc): Likewise. * mipsbsd.c (MY(canonicalize_reloc)): Likewise. * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. (nlm_get_symtab): Likewise. (nlm_get_reloc_upper_bound): Likewise. (nlm_canonicalize_reloc): Likewise. * oasys.c (oasys_get_symtab_upper_bound): Likewise. (oasys_get_symtab): Likewise. (oasys_get_reloc_upper_bound): Likewise. (oasys_canonicalize_reloc): Likewise. * som.c (som_get_symtab_upper_bound): Likewise. (som_get_symtab): Likewise. (som_get_reloc_upper_bound): Likewise. (som_canonicalize_reloc): Likewise. * srec.c (srec_get_symtab_upper_bound): Likewise. (srec_get_symtab): Likewise. (srec_get_reloc_upper_bound): Define as bfd_0l. (srec_canonicalize_reloc): Likewise. * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. (tekhex_get_symtab_upper_bound): Likewise. (tekhex_get_reloc_upper_bound): Define as bfd_0l. (tekhex_canonicalize_reloc): Likewise. * libaout.h (NAME(aout,get_symtab_upper_bound)): Change declaration to return long. (NAME(aout,get_symtab)): Likewise. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. (bfd_elf32_get_symtab): Likewise. (bfd_elf32_get_reloc_upper_bound): Likewise. (bfd_elf32_canonicalize_reloc): Likewise. (bfd_elf64_get_symtab_upper_bound): Likewise. (bfd_elf64_get_symtab): Likewise. (bfd_elf64_get_reloc_upper_bound): Likewise. (bfd_elf64_canonicalize_reloc): Likewise. * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. (nlmNAME(get_symtab)): Likewise. (nlmNAME(get_reloc_upper_bound)): Likewise. (nlmNAME(canonicalize_reloc)): Likewise. * archive.c (compute_and_write_armap): Use error_return and no_memory_return labels rather than freeing information in various places. Change storage, symcount and src_count to long. Check errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * bout.c (b_out_relax_section): Change reloc_size to long. Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (b_out_get_relocated_section_contents): Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise. * elf32-mips.c: Likewise. * elf32-hppa.c (hppa_elf_stub_finish): Likewise. (hppa_look_for_stubs_in_section): Check for errors from bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and bfd_canonicalize_reloc. * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * linker.c (generic_link_read_symbols): Likewise. (_bfd_generic_final_link): Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. (bfd_coff_reloc16_get_relocated_section_contents): Likewise. * libbfd.c (bfd_0l): New function. * libbfd-in.h (bfd_0l): Declare. * aix386-core.c: Change get_symtab_upper_bound, get_symtab, get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather than bfd_0u. * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * libcoff.h: Rebuilt. * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables temp and name.
1994-03-31 00:15:07 +02:00
typedef struct coff_ptr_struct
1991-12-01 01:39:12 +01:00
{
/* Remembers the offset from the first symbol in the file for
this symbol. Generated by coff_renumber_symbols. */
1991-12-01 01:39:12 +01:00
unsigned int offset;
* coffcode.h (combined_entry_type): Changed fix_tag and fix_end fields to bitfields. Added fields fix_value and fix_scnlen. (sec_to_styp_flags): If STYP_DEBUG is defined, use it rather than STYP_INFO for the type of a section named .debug. (coff_add_missing_symbols): Don't define if RS6000COFF_C. (coff_write_object_contents): If RS6000COFF_C, don't call coff_add_missing_symbols. (coff_slurp_symbol_table): If RS6000COFF_C, then if the last aux entry has type STY_LD change the x_scnlen into a pointer to a symbol and set fix_scnlen. Also, for a C_BSTAT symbol, change the value into a pointer to a symbol and set fix_value. * libcoff.h: Rebuilt. * coffgen.c (coff_mangle_symbols): Reindent. If fix_value is set, get the symbol offset. Likewise for fix_scnlen. (string_size): Change type to bfd_size_type. (debug_string_size, debug_string_section): New static variables. (coff_fix_symbol_name): If bfd_coff_symname_in_debug returns true, write the symbol name into the .debug section; assume that the section has already been created with the right size. (coff_write_symbols): Initialize debug_string_size to 0. If bfd_coff_symname_in_debug returns true, don't put symbol name in usual string table. After writing out all symbols, if debug_string_size is not 0, check that it matches the size of the .debug section. (coff_get_normalized_symtab): Clear new fix_value and fix_scnlen fields. If the string offset is 0, always use an empty string as the name. (coff_make_empty_symbol): Zero out the symbol structure.
1994-02-05 06:11:46 +01:00
/* Should the value of this symbol be renumbered. Used for
XCOFF C_BSTAT symbols. Set by coff_slurp_symbol_table. */
unsigned int fix_value : 1;
/* Should the tag field of this symbol be renumbered.
Created by coff_pointerize_aux. */
* coffcode.h (combined_entry_type): Changed fix_tag and fix_end fields to bitfields. Added fields fix_value and fix_scnlen. (sec_to_styp_flags): If STYP_DEBUG is defined, use it rather than STYP_INFO for the type of a section named .debug. (coff_add_missing_symbols): Don't define if RS6000COFF_C. (coff_write_object_contents): If RS6000COFF_C, don't call coff_add_missing_symbols. (coff_slurp_symbol_table): If RS6000COFF_C, then if the last aux entry has type STY_LD change the x_scnlen into a pointer to a symbol and set fix_scnlen. Also, for a C_BSTAT symbol, change the value into a pointer to a symbol and set fix_value. * libcoff.h: Rebuilt. * coffgen.c (coff_mangle_symbols): Reindent. If fix_value is set, get the symbol offset. Likewise for fix_scnlen. (string_size): Change type to bfd_size_type. (debug_string_size, debug_string_section): New static variables. (coff_fix_symbol_name): If bfd_coff_symname_in_debug returns true, write the symbol name into the .debug section; assume that the section has already been created with the right size. (coff_write_symbols): Initialize debug_string_size to 0. If bfd_coff_symname_in_debug returns true, don't put symbol name in usual string table. After writing out all symbols, if debug_string_size is not 0, check that it matches the size of the .debug section. (coff_get_normalized_symtab): Clear new fix_value and fix_scnlen fields. If the string offset is 0, always use an empty string as the name. (coff_make_empty_symbol): Zero out the symbol structure.
1994-02-05 06:11:46 +01:00
unsigned int fix_tag : 1;
/* Should the endidx field of this symbol be renumbered.
Created by coff_pointerize_aux. */
* coffcode.h (combined_entry_type): Changed fix_tag and fix_end fields to bitfields. Added fields fix_value and fix_scnlen. (sec_to_styp_flags): If STYP_DEBUG is defined, use it rather than STYP_INFO for the type of a section named .debug. (coff_add_missing_symbols): Don't define if RS6000COFF_C. (coff_write_object_contents): If RS6000COFF_C, don't call coff_add_missing_symbols. (coff_slurp_symbol_table): If RS6000COFF_C, then if the last aux entry has type STY_LD change the x_scnlen into a pointer to a symbol and set fix_scnlen. Also, for a C_BSTAT symbol, change the value into a pointer to a symbol and set fix_value. * libcoff.h: Rebuilt. * coffgen.c (coff_mangle_symbols): Reindent. If fix_value is set, get the symbol offset. Likewise for fix_scnlen. (string_size): Change type to bfd_size_type. (debug_string_size, debug_string_section): New static variables. (coff_fix_symbol_name): If bfd_coff_symname_in_debug returns true, write the symbol name into the .debug section; assume that the section has already been created with the right size. (coff_write_symbols): Initialize debug_string_size to 0. If bfd_coff_symname_in_debug returns true, don't put symbol name in usual string table. After writing out all symbols, if debug_string_size is not 0, check that it matches the size of the .debug section. (coff_get_normalized_symtab): Clear new fix_value and fix_scnlen fields. If the string offset is 0, always use an empty string as the name. (coff_make_empty_symbol): Zero out the symbol structure.
1994-02-05 06:11:46 +01:00
unsigned int fix_end : 1;
/* Should the x_csect.x_scnlen field be renumbered.
Created by coff_slurp_symbol_table. */
unsigned int fix_scnlen : 1;
/* The container for the symbol structure as read and translated
from the file. */
1991-12-01 01:39:12 +01:00
union {
union internal_auxent auxent;
struct internal_syment syment;
} u;
} combined_entry_type;
/* Each canonical asymbol really looks like this: */
1991-12-01 01:39:12 +01:00
typedef struct coff_symbol_struct
{
/* The actual symbol which the rest of BFD works with */
asymbol symbol;
/* A pointer to the hidden information for this symbol */
combined_entry_type *native;
1991-08-17 02:17:15 +02:00
/* A pointer to the linenumber information for this symbol */
struct lineno_cache_entry *lineno;
/* Have the line numbers been relocated yet ? */
boolean done_lineno;
} coff_symbol_type;
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Changes to let BFD return an error indication from get_symtab_upper_bound, bfd_canonicalize_symtab, bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now return long instead of unsigned int, and use -1 to indicate an error. Along the way, rename get_symtab_upper_bound to bfd_get_symtab_upper_bound. * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on errors. (bfd_canonicalize_reloc): Likewise. * syms.c (bfd_get_symtab_upper_bound): Renamed from get_symtab_upper_bound. * targets.c (bfd_target): Renamed _get_symtab_upper_bound to _bfd_get_symtab_upper_bound, and changed it and _bfd_canonicalize_symtab and _get_reloc_upper_bound and _bfd_canonicalize_reloc to all return long. * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. (NAME(aout,get_symtab_upper_bound)): Likewise. * bout.c (b_out_canonicalize_reloc): Likewise. (b_out_get_reloc_upper_bound): Likewise. * coffcode.h (coff_canonicalize_reloc): Likewise. * coffgen.c (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * elfcode.h (elf_get_symtab_upper_bound): Likewise. (elf_get_reloc_upper_bound): Likewise. (elf_canonicalize_reloc): Likewise. (elf_get_symtab): Likewise. * hp300hpux.c (MY(get_symtab)): Likewise. (MY(get_symtab_upper_bound)): Likewise. (MY(canonicalize_reloc)): Likewise. * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. * ieee.c (ieee_slurp_external_symbols): Change return type to boolean. Check for errors from get_symbol. (ieee_slurp_symbol_table): Change return type to boolean. Check for errors from ieee_slurp_external_symbols. (ieee_get_symtab_upper_bound): Return long, and -1 on errors. (ieee_get_symtab): Likewise. (ieee_get_reloc_upper_bound): Likewise. (ieee_canonicalize_reloc): Likewise. * mipsbsd.c (MY(canonicalize_reloc)): Likewise. * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. (nlm_get_symtab): Likewise. (nlm_get_reloc_upper_bound): Likewise. (nlm_canonicalize_reloc): Likewise. * oasys.c (oasys_get_symtab_upper_bound): Likewise. (oasys_get_symtab): Likewise. (oasys_get_reloc_upper_bound): Likewise. (oasys_canonicalize_reloc): Likewise. * som.c (som_get_symtab_upper_bound): Likewise. (som_get_symtab): Likewise. (som_get_reloc_upper_bound): Likewise. (som_canonicalize_reloc): Likewise. * srec.c (srec_get_symtab_upper_bound): Likewise. (srec_get_symtab): Likewise. (srec_get_reloc_upper_bound): Define as bfd_0l. (srec_canonicalize_reloc): Likewise. * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. (tekhex_get_symtab_upper_bound): Likewise. (tekhex_get_reloc_upper_bound): Define as bfd_0l. (tekhex_canonicalize_reloc): Likewise. * libaout.h (NAME(aout,get_symtab_upper_bound)): Change declaration to return long. (NAME(aout,get_symtab)): Likewise. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. (bfd_elf32_get_symtab): Likewise. (bfd_elf32_get_reloc_upper_bound): Likewise. (bfd_elf32_canonicalize_reloc): Likewise. (bfd_elf64_get_symtab_upper_bound): Likewise. (bfd_elf64_get_symtab): Likewise. (bfd_elf64_get_reloc_upper_bound): Likewise. (bfd_elf64_canonicalize_reloc): Likewise. * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. (nlmNAME(get_symtab)): Likewise. (nlmNAME(get_reloc_upper_bound)): Likewise. (nlmNAME(canonicalize_reloc)): Likewise. * archive.c (compute_and_write_armap): Use error_return and no_memory_return labels rather than freeing information in various places. Change storage, symcount and src_count to long. Check errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * bout.c (b_out_relax_section): Change reloc_size to long. Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (b_out_get_relocated_section_contents): Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise. * elf32-mips.c: Likewise. * elf32-hppa.c (hppa_elf_stub_finish): Likewise. (hppa_look_for_stubs_in_section): Check for errors from bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and bfd_canonicalize_reloc. * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * linker.c (generic_link_read_symbols): Likewise. (_bfd_generic_final_link): Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. (bfd_coff_reloc16_get_relocated_section_contents): Likewise. * libbfd.c (bfd_0l): New function. * libbfd-in.h (bfd_0l): Declare. * aix386-core.c: Change get_symtab_upper_bound, get_symtab, get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather than bfd_0u. * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * libcoff.h: Rebuilt. * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables temp and name.
1994-03-31 00:15:07 +02:00
typedef struct
{
void (*_bfd_coff_swap_aux_in) PARAMS ((
bfd *abfd,
PTR ext,
int type,
int class,
int indaux,
int numaux,
PTR in));
void (*_bfd_coff_swap_sym_in) PARAMS ((
bfd *abfd ,
PTR ext,
PTR in));
void (*_bfd_coff_swap_lineno_in) PARAMS ((
bfd *abfd,
PTR ext,
PTR in));
unsigned int (*_bfd_coff_swap_aux_out) PARAMS ((
bfd *abfd,
PTR in,
int type,
int class,
int indaux,
int numaux,
PTR ext));
unsigned int (*_bfd_coff_swap_sym_out) PARAMS ((
bfd *abfd,
PTR in,
PTR ext));
unsigned int (*_bfd_coff_swap_lineno_out) PARAMS ((
bfd *abfd,
PTR in,
PTR ext));
unsigned int (*_bfd_coff_swap_reloc_out) PARAMS ((
bfd *abfd,
PTR src,
PTR dst));
unsigned int (*_bfd_coff_swap_filehdr_out) PARAMS ((
bfd *abfd,
PTR in,
PTR out));
unsigned int (*_bfd_coff_swap_aouthdr_out) PARAMS ((
bfd *abfd,
PTR in,
PTR out));
unsigned int (*_bfd_coff_swap_scnhdr_out) PARAMS ((
bfd *abfd,
PTR in,
PTR out));
unsigned int _bfd_filhsz;
unsigned int _bfd_aoutsz;
unsigned int _bfd_scnhsz;
unsigned int _bfd_symesz;
unsigned int _bfd_auxesz;
Add new style linker support to COFF backend. a29k only for now. * cofflink.c: New file. * libcoff-in.h: Include bfdlink.h. (obj_coff_external_syms, obj_coff_strings): Define accessor macro. (obj_coff_sym_hashes): Define accessor macro. (struct coff_tdata): Add fields external_syms, strings, and sym_hashes. (struct coff_link_hash_entry): Define. (struct coff_link_hash_table): Define. (coff_link_hash_lookup, coff_link_hash_traverse): Define. (coff_hash_table): Define. (_bfd_coff_link_hash_table_create): Declare. (_bfd_coff_link_add_symbols, _bfd_coff_final_link): Declare. * coffcode.h (bfd_coff_backend_data): Add fields _bfd_relsz, _bfd_coff_swap_reloc_in, _bfd_coff_sym_is_global, _bfd_coff_compute_section_file_positions, _bfd_coff_relocate_section. (bfd_coff_relsz, bfd_coff_swap_reloc_in): Define. (bfd_coff_sym_is_global): Define. (bfd_coff_compute_section_file_positions): Define. (bfd_coff_relocate_section): Define. (coff_mkobject_hook): Initialize obj_raw_syment_count and obj_conv_table_size. (coff_compute_section_file_positions): Set target_index of all sections. Set output_has_begun field. (coff_write_object_contents): Don't set target_index; now done by coff_compute_section_file_positions. Remove obsolete handling of scn_base and data_base. Don't bother to check that target_index is positive, since it always is. Remove use of pad, which is always zero. Check obj_raw_syment_count, not bfd_get_symcount, for the number of symbols, but only write them out if bfd_get_symcount is non-zero. (coff_slurp_symbol_table): Use obj_raw_syment_count, not bfd_get_symcount for the number of symbols. Don't set obj_conv_table_size. (coff_sym_is_global): New static function or macro. (coff_slurp_reloc_table): Call coff_swap_reloc_in, not bfd_swap_reloc_in. (coff_bfd_link_hash_table_create): If coff_relocate_section is defined, define as _bfd_coff_link_hash_table_create. (coff_bfd_link_add_symbols): Similar change. (coff_bfd_final_link): Similar change. (coff_relocate_section): Define as NULL if not defined. (bfd_coff_std_swap_table): Initialize new fields. * coffgen.c (coff_real_object_p): Don't set obj_raw_syment_count and obj_conv_table_size here. (coff_count_linenumbers): Reindent. If bfd_get_symcount is zero, add up the line numbers from the sections. (coff_write_symbols): Don't set bfd_get_symcount. (coff_pointerize_aux): Don't pointerize a nonpositive x_endndx field. (coff_get_normalized_symtab): Use obj_raw_syment_count, not bfd_get_symcount. (coff_print_symbol): If auxp->fix_end, print x_endndx value. * coffswap.h (coff_swap_reloc_in): Rename from bfd_swap_reloc_in. Reindent. Change argument type to PTR. * coff-a29k.c (coff_a29k_relocate_section): New static function. (coff_relocate_section): Define. * configure.in (a29kcoff_big_vec): Compile cofflink.o. * coff-alpha.c (alpha_ecoff_backend_data): Initialize new fields. * coff-mips.c (mips_ecoff_backend_data): Likewise. * libcoff.h: Rebuilt. * Makefile.in: Rebuilt dependencies. (BFD32_BACKENDS): Add cofflink.o. (CFILES): Add cofflink.c.
1994-09-06 21:28:55 +02:00
unsigned int _bfd_relsz;
unsigned int _bfd_linesz;
boolean _bfd_coff_long_filenames;
void (*_bfd_coff_swap_filehdr_in) PARAMS ((
bfd *abfd,
PTR ext,
PTR in));
void (*_bfd_coff_swap_aouthdr_in) PARAMS ((
bfd *abfd,
PTR ext,
PTR in));
void (*_bfd_coff_swap_scnhdr_in) PARAMS ((
bfd *abfd,
PTR ext,
PTR in));
Add new style linker support to COFF backend. a29k only for now. * cofflink.c: New file. * libcoff-in.h: Include bfdlink.h. (obj_coff_external_syms, obj_coff_strings): Define accessor macro. (obj_coff_sym_hashes): Define accessor macro. (struct coff_tdata): Add fields external_syms, strings, and sym_hashes. (struct coff_link_hash_entry): Define. (struct coff_link_hash_table): Define. (coff_link_hash_lookup, coff_link_hash_traverse): Define. (coff_hash_table): Define. (_bfd_coff_link_hash_table_create): Declare. (_bfd_coff_link_add_symbols, _bfd_coff_final_link): Declare. * coffcode.h (bfd_coff_backend_data): Add fields _bfd_relsz, _bfd_coff_swap_reloc_in, _bfd_coff_sym_is_global, _bfd_coff_compute_section_file_positions, _bfd_coff_relocate_section. (bfd_coff_relsz, bfd_coff_swap_reloc_in): Define. (bfd_coff_sym_is_global): Define. (bfd_coff_compute_section_file_positions): Define. (bfd_coff_relocate_section): Define. (coff_mkobject_hook): Initialize obj_raw_syment_count and obj_conv_table_size. (coff_compute_section_file_positions): Set target_index of all sections. Set output_has_begun field. (coff_write_object_contents): Don't set target_index; now done by coff_compute_section_file_positions. Remove obsolete handling of scn_base and data_base. Don't bother to check that target_index is positive, since it always is. Remove use of pad, which is always zero. Check obj_raw_syment_count, not bfd_get_symcount, for the number of symbols, but only write them out if bfd_get_symcount is non-zero. (coff_slurp_symbol_table): Use obj_raw_syment_count, not bfd_get_symcount for the number of symbols. Don't set obj_conv_table_size. (coff_sym_is_global): New static function or macro. (coff_slurp_reloc_table): Call coff_swap_reloc_in, not bfd_swap_reloc_in. (coff_bfd_link_hash_table_create): If coff_relocate_section is defined, define as _bfd_coff_link_hash_table_create. (coff_bfd_link_add_symbols): Similar change. (coff_bfd_final_link): Similar change. (coff_relocate_section): Define as NULL if not defined. (bfd_coff_std_swap_table): Initialize new fields. * coffgen.c (coff_real_object_p): Don't set obj_raw_syment_count and obj_conv_table_size here. (coff_count_linenumbers): Reindent. If bfd_get_symcount is zero, add up the line numbers from the sections. (coff_write_symbols): Don't set bfd_get_symcount. (coff_pointerize_aux): Don't pointerize a nonpositive x_endndx field. (coff_get_normalized_symtab): Use obj_raw_syment_count, not bfd_get_symcount. (coff_print_symbol): If auxp->fix_end, print x_endndx value. * coffswap.h (coff_swap_reloc_in): Rename from bfd_swap_reloc_in. Reindent. Change argument type to PTR. * coff-a29k.c (coff_a29k_relocate_section): New static function. (coff_relocate_section): Define. * configure.in (a29kcoff_big_vec): Compile cofflink.o. * coff-alpha.c (alpha_ecoff_backend_data): Initialize new fields. * coff-mips.c (mips_ecoff_backend_data): Likewise. * libcoff.h: Rebuilt. * Makefile.in: Rebuilt dependencies. (BFD32_BACKENDS): Add cofflink.o. (CFILES): Add cofflink.c.
1994-09-06 21:28:55 +02:00
void (*_bfd_coff_swap_reloc_in) PARAMS ((
bfd *abfd,
PTR ext,
PTR in));
boolean (*_bfd_coff_bad_format_hook) PARAMS ((
bfd *abfd,
PTR internal_filehdr));
boolean (*_bfd_coff_set_arch_mach_hook) PARAMS ((
bfd *abfd,
PTR internal_filehdr));
PTR (*_bfd_coff_mkobject_hook) PARAMS ((
bfd *abfd,
PTR internal_filehdr,
PTR internal_aouthdr));
flagword (*_bfd_styp_to_sec_flags_hook) PARAMS ((
bfd *abfd,
PTR internal_scnhdr,
const char *name));
asection *(*_bfd_make_section_hook) PARAMS ((
bfd *abfd,
char *name));
void (*_bfd_set_alignment_hook) PARAMS ((
bfd *abfd,
asection *sec,
PTR internal_scnhdr));
boolean (*_bfd_coff_slurp_symbol_table) PARAMS ((
bfd *abfd));
boolean (*_bfd_coff_symname_in_debug) PARAMS ((
bfd *abfd,
struct internal_syment *sym));
void (*_bfd_coff_reloc16_extra_cases) PARAMS ((
bfd *abfd,
struct bfd_link_info *link_info,
struct bfd_link_order *link_order,
arelent *reloc,
bfd_byte *data,
unsigned int *src_ptr,
unsigned int *dst_ptr));
int (*_bfd_coff_reloc16_estimate) PARAMS ((
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Changes to let BFD return an error indication from get_symtab_upper_bound, bfd_canonicalize_symtab, bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now return long instead of unsigned int, and use -1 to indicate an error. Along the way, rename get_symtab_upper_bound to bfd_get_symtab_upper_bound. * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on errors. (bfd_canonicalize_reloc): Likewise. * syms.c (bfd_get_symtab_upper_bound): Renamed from get_symtab_upper_bound. * targets.c (bfd_target): Renamed _get_symtab_upper_bound to _bfd_get_symtab_upper_bound, and changed it and _bfd_canonicalize_symtab and _get_reloc_upper_bound and _bfd_canonicalize_reloc to all return long. * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. (NAME(aout,get_symtab_upper_bound)): Likewise. * bout.c (b_out_canonicalize_reloc): Likewise. (b_out_get_reloc_upper_bound): Likewise. * coffcode.h (coff_canonicalize_reloc): Likewise. * coffgen.c (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * elfcode.h (elf_get_symtab_upper_bound): Likewise. (elf_get_reloc_upper_bound): Likewise. (elf_canonicalize_reloc): Likewise. (elf_get_symtab): Likewise. * hp300hpux.c (MY(get_symtab)): Likewise. (MY(get_symtab_upper_bound)): Likewise. (MY(canonicalize_reloc)): Likewise. * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. * ieee.c (ieee_slurp_external_symbols): Change return type to boolean. Check for errors from get_symbol. (ieee_slurp_symbol_table): Change return type to boolean. Check for errors from ieee_slurp_external_symbols. (ieee_get_symtab_upper_bound): Return long, and -1 on errors. (ieee_get_symtab): Likewise. (ieee_get_reloc_upper_bound): Likewise. (ieee_canonicalize_reloc): Likewise. * mipsbsd.c (MY(canonicalize_reloc)): Likewise. * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. (nlm_get_symtab): Likewise. (nlm_get_reloc_upper_bound): Likewise. (nlm_canonicalize_reloc): Likewise. * oasys.c (oasys_get_symtab_upper_bound): Likewise. (oasys_get_symtab): Likewise. (oasys_get_reloc_upper_bound): Likewise. (oasys_canonicalize_reloc): Likewise. * som.c (som_get_symtab_upper_bound): Likewise. (som_get_symtab): Likewise. (som_get_reloc_upper_bound): Likewise. (som_canonicalize_reloc): Likewise. * srec.c (srec_get_symtab_upper_bound): Likewise. (srec_get_symtab): Likewise. (srec_get_reloc_upper_bound): Define as bfd_0l. (srec_canonicalize_reloc): Likewise. * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. (tekhex_get_symtab_upper_bound): Likewise. (tekhex_get_reloc_upper_bound): Define as bfd_0l. (tekhex_canonicalize_reloc): Likewise. * libaout.h (NAME(aout,get_symtab_upper_bound)): Change declaration to return long. (NAME(aout,get_symtab)): Likewise. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. (bfd_elf32_get_symtab): Likewise. (bfd_elf32_get_reloc_upper_bound): Likewise. (bfd_elf32_canonicalize_reloc): Likewise. (bfd_elf64_get_symtab_upper_bound): Likewise. (bfd_elf64_get_symtab): Likewise. (bfd_elf64_get_reloc_upper_bound): Likewise. (bfd_elf64_canonicalize_reloc): Likewise. * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. (nlmNAME(get_symtab)): Likewise. (nlmNAME(get_reloc_upper_bound)): Likewise. (nlmNAME(canonicalize_reloc)): Likewise. * archive.c (compute_and_write_armap): Use error_return and no_memory_return labels rather than freeing information in various places. Change storage, symcount and src_count to long. Check errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * bout.c (b_out_relax_section): Change reloc_size to long. Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (b_out_get_relocated_section_contents): Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise. * elf32-mips.c: Likewise. * elf32-hppa.c (hppa_elf_stub_finish): Likewise. (hppa_look_for_stubs_in_section): Check for errors from bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and bfd_canonicalize_reloc. * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * linker.c (generic_link_read_symbols): Likewise. (_bfd_generic_final_link): Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. (bfd_coff_reloc16_get_relocated_section_contents): Likewise. * libbfd.c (bfd_0l): New function. * libbfd-in.h (bfd_0l): Declare. * aix386-core.c: Change get_symtab_upper_bound, get_symtab, get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather than bfd_0u. * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * libcoff.h: Rebuilt. * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables temp and name.
1994-03-31 00:15:07 +02:00
bfd *abfd,
asection *input_section,
arelent *r,
unsigned int shrink,
struct bfd_link_info *link_info));
Add new style linker support to COFF backend. a29k only for now. * cofflink.c: New file. * libcoff-in.h: Include bfdlink.h. (obj_coff_external_syms, obj_coff_strings): Define accessor macro. (obj_coff_sym_hashes): Define accessor macro. (struct coff_tdata): Add fields external_syms, strings, and sym_hashes. (struct coff_link_hash_entry): Define. (struct coff_link_hash_table): Define. (coff_link_hash_lookup, coff_link_hash_traverse): Define. (coff_hash_table): Define. (_bfd_coff_link_hash_table_create): Declare. (_bfd_coff_link_add_symbols, _bfd_coff_final_link): Declare. * coffcode.h (bfd_coff_backend_data): Add fields _bfd_relsz, _bfd_coff_swap_reloc_in, _bfd_coff_sym_is_global, _bfd_coff_compute_section_file_positions, _bfd_coff_relocate_section. (bfd_coff_relsz, bfd_coff_swap_reloc_in): Define. (bfd_coff_sym_is_global): Define. (bfd_coff_compute_section_file_positions): Define. (bfd_coff_relocate_section): Define. (coff_mkobject_hook): Initialize obj_raw_syment_count and obj_conv_table_size. (coff_compute_section_file_positions): Set target_index of all sections. Set output_has_begun field. (coff_write_object_contents): Don't set target_index; now done by coff_compute_section_file_positions. Remove obsolete handling of scn_base and data_base. Don't bother to check that target_index is positive, since it always is. Remove use of pad, which is always zero. Check obj_raw_syment_count, not bfd_get_symcount, for the number of symbols, but only write them out if bfd_get_symcount is non-zero. (coff_slurp_symbol_table): Use obj_raw_syment_count, not bfd_get_symcount for the number of symbols. Don't set obj_conv_table_size. (coff_sym_is_global): New static function or macro. (coff_slurp_reloc_table): Call coff_swap_reloc_in, not bfd_swap_reloc_in. (coff_bfd_link_hash_table_create): If coff_relocate_section is defined, define as _bfd_coff_link_hash_table_create. (coff_bfd_link_add_symbols): Similar change. (coff_bfd_final_link): Similar change. (coff_relocate_section): Define as NULL if not defined. (bfd_coff_std_swap_table): Initialize new fields. * coffgen.c (coff_real_object_p): Don't set obj_raw_syment_count and obj_conv_table_size here. (coff_count_linenumbers): Reindent. If bfd_get_symcount is zero, add up the line numbers from the sections. (coff_write_symbols): Don't set bfd_get_symcount. (coff_pointerize_aux): Don't pointerize a nonpositive x_endndx field. (coff_get_normalized_symtab): Use obj_raw_syment_count, not bfd_get_symcount. (coff_print_symbol): If auxp->fix_end, print x_endndx value. * coffswap.h (coff_swap_reloc_in): Rename from bfd_swap_reloc_in. Reindent. Change argument type to PTR. * coff-a29k.c (coff_a29k_relocate_section): New static function. (coff_relocate_section): Define. * configure.in (a29kcoff_big_vec): Compile cofflink.o. * coff-alpha.c (alpha_ecoff_backend_data): Initialize new fields. * coff-mips.c (mips_ecoff_backend_data): Likewise. * libcoff.h: Rebuilt. * Makefile.in: Rebuilt dependencies. (BFD32_BACKENDS): Add cofflink.o. (CFILES): Add cofflink.c.
1994-09-06 21:28:55 +02:00
boolean (*_bfd_coff_sym_is_global) PARAMS ((
bfd *abfd,
struct internal_syment *));
void (*_bfd_coff_compute_section_file_positions) PARAMS ((
bfd *abfd));
boolean (*_bfd_coff_relocate_section) PARAMS ((
bfd *output_bfd,
struct bfd_link_info *info,
bfd *input_bfd,
asection *input_section,
bfd_byte *contents,
struct internal_reloc *relocs,
struct internal_syment *syms,
asection **sections));
} bfd_coff_backend_data;
#define coff_backend_info(abfd) ((bfd_coff_backend_data *) (abfd)->xvec->backend_data)
#define bfd_coff_swap_aux_in(a,e,t,c,ind,num,i) \
((coff_backend_info (a)->_bfd_coff_swap_aux_in) (a,e,t,c,ind,num,i))
#define bfd_coff_swap_sym_in(a,e,i) \
((coff_backend_info (a)->_bfd_coff_swap_sym_in) (a,e,i))
#define bfd_coff_swap_lineno_in(a,e,i) \
((coff_backend_info ( a)->_bfd_coff_swap_lineno_in) (a,e,i))
#define bfd_coff_swap_reloc_out(abfd, i, o) \
((coff_backend_info (abfd)->_bfd_coff_swap_reloc_out) (abfd, i, o))
#define bfd_coff_swap_lineno_out(abfd, i, o) \
((coff_backend_info (abfd)->_bfd_coff_swap_lineno_out) (abfd, i, o))
#define bfd_coff_swap_aux_out(a,i,t,c,ind,num,o) \
((coff_backend_info (a)->_bfd_coff_swap_aux_out) (a,i,t,c,ind,num,o))
#define bfd_coff_swap_sym_out(abfd, i,o) \
((coff_backend_info (abfd)->_bfd_coff_swap_sym_out) (abfd, i, o))
#define bfd_coff_swap_scnhdr_out(abfd, i,o) \
((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_out) (abfd, i, o))
#define bfd_coff_swap_filehdr_out(abfd, i,o) \
((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_out) (abfd, i, o))
#define bfd_coff_swap_aouthdr_out(abfd, i,o) \
((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_out) (abfd, i, o))
#define bfd_coff_filhsz(abfd) (coff_backend_info (abfd)->_bfd_filhsz)
#define bfd_coff_aoutsz(abfd) (coff_backend_info (abfd)->_bfd_aoutsz)
#define bfd_coff_scnhsz(abfd) (coff_backend_info (abfd)->_bfd_scnhsz)
#define bfd_coff_symesz(abfd) (coff_backend_info (abfd)->_bfd_symesz)
#define bfd_coff_auxesz(abfd) (coff_backend_info (abfd)->_bfd_auxesz)
Add new style linker support to COFF backend. a29k only for now. * cofflink.c: New file. * libcoff-in.h: Include bfdlink.h. (obj_coff_external_syms, obj_coff_strings): Define accessor macro. (obj_coff_sym_hashes): Define accessor macro. (struct coff_tdata): Add fields external_syms, strings, and sym_hashes. (struct coff_link_hash_entry): Define. (struct coff_link_hash_table): Define. (coff_link_hash_lookup, coff_link_hash_traverse): Define. (coff_hash_table): Define. (_bfd_coff_link_hash_table_create): Declare. (_bfd_coff_link_add_symbols, _bfd_coff_final_link): Declare. * coffcode.h (bfd_coff_backend_data): Add fields _bfd_relsz, _bfd_coff_swap_reloc_in, _bfd_coff_sym_is_global, _bfd_coff_compute_section_file_positions, _bfd_coff_relocate_section. (bfd_coff_relsz, bfd_coff_swap_reloc_in): Define. (bfd_coff_sym_is_global): Define. (bfd_coff_compute_section_file_positions): Define. (bfd_coff_relocate_section): Define. (coff_mkobject_hook): Initialize obj_raw_syment_count and obj_conv_table_size. (coff_compute_section_file_positions): Set target_index of all sections. Set output_has_begun field. (coff_write_object_contents): Don't set target_index; now done by coff_compute_section_file_positions. Remove obsolete handling of scn_base and data_base. Don't bother to check that target_index is positive, since it always is. Remove use of pad, which is always zero. Check obj_raw_syment_count, not bfd_get_symcount, for the number of symbols, but only write them out if bfd_get_symcount is non-zero. (coff_slurp_symbol_table): Use obj_raw_syment_count, not bfd_get_symcount for the number of symbols. Don't set obj_conv_table_size. (coff_sym_is_global): New static function or macro. (coff_slurp_reloc_table): Call coff_swap_reloc_in, not bfd_swap_reloc_in. (coff_bfd_link_hash_table_create): If coff_relocate_section is defined, define as _bfd_coff_link_hash_table_create. (coff_bfd_link_add_symbols): Similar change. (coff_bfd_final_link): Similar change. (coff_relocate_section): Define as NULL if not defined. (bfd_coff_std_swap_table): Initialize new fields. * coffgen.c (coff_real_object_p): Don't set obj_raw_syment_count and obj_conv_table_size here. (coff_count_linenumbers): Reindent. If bfd_get_symcount is zero, add up the line numbers from the sections. (coff_write_symbols): Don't set bfd_get_symcount. (coff_pointerize_aux): Don't pointerize a nonpositive x_endndx field. (coff_get_normalized_symtab): Use obj_raw_syment_count, not bfd_get_symcount. (coff_print_symbol): If auxp->fix_end, print x_endndx value. * coffswap.h (coff_swap_reloc_in): Rename from bfd_swap_reloc_in. Reindent. Change argument type to PTR. * coff-a29k.c (coff_a29k_relocate_section): New static function. (coff_relocate_section): Define. * configure.in (a29kcoff_big_vec): Compile cofflink.o. * coff-alpha.c (alpha_ecoff_backend_data): Initialize new fields. * coff-mips.c (mips_ecoff_backend_data): Likewise. * libcoff.h: Rebuilt. * Makefile.in: Rebuilt dependencies. (BFD32_BACKENDS): Add cofflink.o. (CFILES): Add cofflink.c.
1994-09-06 21:28:55 +02:00
#define bfd_coff_relsz(abfd) (coff_backend_info (abfd)->_bfd_relsz)
#define bfd_coff_linesz(abfd) (coff_backend_info (abfd)->_bfd_linesz)
#define bfd_coff_long_filenames(abfd) (coff_backend_info (abfd)->_bfd_coff_long_filenames)
#define bfd_coff_swap_filehdr_in(abfd, i,o) \
((coff_backend_info (abfd)->_bfd_coff_swap_filehdr_in) (abfd, i, o))
#define bfd_coff_swap_aouthdr_in(abfd, i,o) \
((coff_backend_info (abfd)->_bfd_coff_swap_aouthdr_in) (abfd, i, o))
#define bfd_coff_swap_scnhdr_in(abfd, i,o) \
((coff_backend_info (abfd)->_bfd_coff_swap_scnhdr_in) (abfd, i, o))
Add new style linker support to COFF backend. a29k only for now. * cofflink.c: New file. * libcoff-in.h: Include bfdlink.h. (obj_coff_external_syms, obj_coff_strings): Define accessor macro. (obj_coff_sym_hashes): Define accessor macro. (struct coff_tdata): Add fields external_syms, strings, and sym_hashes. (struct coff_link_hash_entry): Define. (struct coff_link_hash_table): Define. (coff_link_hash_lookup, coff_link_hash_traverse): Define. (coff_hash_table): Define. (_bfd_coff_link_hash_table_create): Declare. (_bfd_coff_link_add_symbols, _bfd_coff_final_link): Declare. * coffcode.h (bfd_coff_backend_data): Add fields _bfd_relsz, _bfd_coff_swap_reloc_in, _bfd_coff_sym_is_global, _bfd_coff_compute_section_file_positions, _bfd_coff_relocate_section. (bfd_coff_relsz, bfd_coff_swap_reloc_in): Define. (bfd_coff_sym_is_global): Define. (bfd_coff_compute_section_file_positions): Define. (bfd_coff_relocate_section): Define. (coff_mkobject_hook): Initialize obj_raw_syment_count and obj_conv_table_size. (coff_compute_section_file_positions): Set target_index of all sections. Set output_has_begun field. (coff_write_object_contents): Don't set target_index; now done by coff_compute_section_file_positions. Remove obsolete handling of scn_base and data_base. Don't bother to check that target_index is positive, since it always is. Remove use of pad, which is always zero. Check obj_raw_syment_count, not bfd_get_symcount, for the number of symbols, but only write them out if bfd_get_symcount is non-zero. (coff_slurp_symbol_table): Use obj_raw_syment_count, not bfd_get_symcount for the number of symbols. Don't set obj_conv_table_size. (coff_sym_is_global): New static function or macro. (coff_slurp_reloc_table): Call coff_swap_reloc_in, not bfd_swap_reloc_in. (coff_bfd_link_hash_table_create): If coff_relocate_section is defined, define as _bfd_coff_link_hash_table_create. (coff_bfd_link_add_symbols): Similar change. (coff_bfd_final_link): Similar change. (coff_relocate_section): Define as NULL if not defined. (bfd_coff_std_swap_table): Initialize new fields. * coffgen.c (coff_real_object_p): Don't set obj_raw_syment_count and obj_conv_table_size here. (coff_count_linenumbers): Reindent. If bfd_get_symcount is zero, add up the line numbers from the sections. (coff_write_symbols): Don't set bfd_get_symcount. (coff_pointerize_aux): Don't pointerize a nonpositive x_endndx field. (coff_get_normalized_symtab): Use obj_raw_syment_count, not bfd_get_symcount. (coff_print_symbol): If auxp->fix_end, print x_endndx value. * coffswap.h (coff_swap_reloc_in): Rename from bfd_swap_reloc_in. Reindent. Change argument type to PTR. * coff-a29k.c (coff_a29k_relocate_section): New static function. (coff_relocate_section): Define. * configure.in (a29kcoff_big_vec): Compile cofflink.o. * coff-alpha.c (alpha_ecoff_backend_data): Initialize new fields. * coff-mips.c (mips_ecoff_backend_data): Likewise. * libcoff.h: Rebuilt. * Makefile.in: Rebuilt dependencies. (BFD32_BACKENDS): Add cofflink.o. (CFILES): Add cofflink.c.
1994-09-06 21:28:55 +02:00
#define bfd_coff_swap_reloc_in(abfd, i, o) \
((coff_backend_info (abfd)->_bfd_coff_swap_reloc_in) (abfd, i, o))
#define bfd_coff_bad_format_hook(abfd, filehdr) \
((coff_backend_info (abfd)->_bfd_coff_bad_format_hook) (abfd, filehdr))
#define bfd_coff_set_arch_mach_hook(abfd, filehdr)\
((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr))
#define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\
((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr))
#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name)\
((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook) (abfd, scnhdr, name))
#define bfd_coff_make_section_hook(abfd, name)\
((coff_backend_info (abfd)->_bfd_make_section_hook) (abfd, name))
#define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\
((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr))
#define bfd_coff_slurp_symbol_table(abfd)\
((coff_backend_info (abfd)->_bfd_coff_slurp_symbol_table) (abfd))
#define bfd_coff_symname_in_debug(abfd, sym)\
((coff_backend_info (abfd)->_bfd_coff_symname_in_debug) (abfd, sym))
#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)\
((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\
(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr))
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Changes to let BFD return an error indication from get_symtab_upper_bound, bfd_canonicalize_symtab, bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now return long instead of unsigned int, and use -1 to indicate an error. Along the way, rename get_symtab_upper_bound to bfd_get_symtab_upper_bound. * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on errors. (bfd_canonicalize_reloc): Likewise. * syms.c (bfd_get_symtab_upper_bound): Renamed from get_symtab_upper_bound. * targets.c (bfd_target): Renamed _get_symtab_upper_bound to _bfd_get_symtab_upper_bound, and changed it and _bfd_canonicalize_symtab and _get_reloc_upper_bound and _bfd_canonicalize_reloc to all return long. * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. (NAME(aout,get_symtab_upper_bound)): Likewise. * bout.c (b_out_canonicalize_reloc): Likewise. (b_out_get_reloc_upper_bound): Likewise. * coffcode.h (coff_canonicalize_reloc): Likewise. * coffgen.c (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * elfcode.h (elf_get_symtab_upper_bound): Likewise. (elf_get_reloc_upper_bound): Likewise. (elf_canonicalize_reloc): Likewise. (elf_get_symtab): Likewise. * hp300hpux.c (MY(get_symtab)): Likewise. (MY(get_symtab_upper_bound)): Likewise. (MY(canonicalize_reloc)): Likewise. * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. * ieee.c (ieee_slurp_external_symbols): Change return type to boolean. Check for errors from get_symbol. (ieee_slurp_symbol_table): Change return type to boolean. Check for errors from ieee_slurp_external_symbols. (ieee_get_symtab_upper_bound): Return long, and -1 on errors. (ieee_get_symtab): Likewise. (ieee_get_reloc_upper_bound): Likewise. (ieee_canonicalize_reloc): Likewise. * mipsbsd.c (MY(canonicalize_reloc)): Likewise. * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. (nlm_get_symtab): Likewise. (nlm_get_reloc_upper_bound): Likewise. (nlm_canonicalize_reloc): Likewise. * oasys.c (oasys_get_symtab_upper_bound): Likewise. (oasys_get_symtab): Likewise. (oasys_get_reloc_upper_bound): Likewise. (oasys_canonicalize_reloc): Likewise. * som.c (som_get_symtab_upper_bound): Likewise. (som_get_symtab): Likewise. (som_get_reloc_upper_bound): Likewise. (som_canonicalize_reloc): Likewise. * srec.c (srec_get_symtab_upper_bound): Likewise. (srec_get_symtab): Likewise. (srec_get_reloc_upper_bound): Define as bfd_0l. (srec_canonicalize_reloc): Likewise. * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. (tekhex_get_symtab_upper_bound): Likewise. (tekhex_get_reloc_upper_bound): Define as bfd_0l. (tekhex_canonicalize_reloc): Likewise. * libaout.h (NAME(aout,get_symtab_upper_bound)): Change declaration to return long. (NAME(aout,get_symtab)): Likewise. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. (bfd_elf32_get_symtab): Likewise. (bfd_elf32_get_reloc_upper_bound): Likewise. (bfd_elf32_canonicalize_reloc): Likewise. (bfd_elf64_get_symtab_upper_bound): Likewise. (bfd_elf64_get_symtab): Likewise. (bfd_elf64_get_reloc_upper_bound): Likewise. (bfd_elf64_canonicalize_reloc): Likewise. * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. (nlmNAME(get_symtab)): Likewise. (nlmNAME(get_reloc_upper_bound)): Likewise. (nlmNAME(canonicalize_reloc)): Likewise. * archive.c (compute_and_write_armap): Use error_return and no_memory_return labels rather than freeing information in various places. Change storage, symcount and src_count to long. Check errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * bout.c (b_out_relax_section): Change reloc_size to long. Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (b_out_get_relocated_section_contents): Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise. * elf32-mips.c: Likewise. * elf32-hppa.c (hppa_elf_stub_finish): Likewise. (hppa_look_for_stubs_in_section): Check for errors from bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and bfd_canonicalize_reloc. * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * linker.c (generic_link_read_symbols): Likewise. (_bfd_generic_final_link): Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. (bfd_coff_reloc16_get_relocated_section_contents): Likewise. * libbfd.c (bfd_0l): New function. * libbfd-in.h (bfd_0l): Declare. * aix386-core.c: Change get_symtab_upper_bound, get_symtab, get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather than bfd_0u. * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * libcoff.h: Rebuilt. * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables temp and name.
1994-03-31 00:15:07 +02:00
#define bfd_coff_reloc16_estimate(abfd, section, reloc, shrink, link_info)\
((coff_backend_info (abfd)->_bfd_coff_reloc16_estimate)\
Wed Mar 30 16:25:41 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) Changes to let BFD return an error indication from get_symtab_upper_bound, bfd_canonicalize_symtab, bfd_get_reloc_upper_bound, and bfd_canonicalize_reloc. They now return long instead of unsigned int, and use -1 to indicate an error. Along the way, rename get_symtab_upper_bound to bfd_get_symtab_upper_bound. * bfd.c (bfd_get_reloc_upper_bound): Return long, and -1 on errors. (bfd_canonicalize_reloc): Likewise. * syms.c (bfd_get_symtab_upper_bound): Renamed from get_symtab_upper_bound. * targets.c (bfd_target): Renamed _get_symtab_upper_bound to _bfd_get_symtab_upper_bound, and changed it and _bfd_canonicalize_symtab and _get_reloc_upper_bound and _bfd_canonicalize_reloc to all return long. * aoutx.h (NAME(aout,get_symtab)): Return long, and -1 on errors. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. (NAME(aout,get_symtab_upper_bound)): Likewise. * bout.c (b_out_canonicalize_reloc): Likewise. (b_out_get_reloc_upper_bound): Likewise. * coffcode.h (coff_canonicalize_reloc): Likewise. * coffgen.c (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * ecoff.c (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * elfcode.h (elf_get_symtab_upper_bound): Likewise. (elf_get_reloc_upper_bound): Likewise. (elf_canonicalize_reloc): Likewise. (elf_get_symtab): Likewise. * hp300hpux.c (MY(get_symtab)): Likewise. (MY(get_symtab_upper_bound)): Likewise. (MY(canonicalize_reloc)): Likewise. * i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise. * ieee.c (ieee_slurp_external_symbols): Change return type to boolean. Check for errors from get_symbol. (ieee_slurp_symbol_table): Change return type to boolean. Check for errors from ieee_slurp_external_symbols. (ieee_get_symtab_upper_bound): Return long, and -1 on errors. (ieee_get_symtab): Likewise. (ieee_get_reloc_upper_bound): Likewise. (ieee_canonicalize_reloc): Likewise. * mipsbsd.c (MY(canonicalize_reloc)): Likewise. * nlmcode.h (nlm_get_symtab_upper_bound): Likewise. (nlm_get_symtab): Likewise. (nlm_get_reloc_upper_bound): Likewise. (nlm_canonicalize_reloc): Likewise. * oasys.c (oasys_get_symtab_upper_bound): Likewise. (oasys_get_symtab): Likewise. (oasys_get_reloc_upper_bound): Likewise. (oasys_canonicalize_reloc): Likewise. * som.c (som_get_symtab_upper_bound): Likewise. (som_get_symtab): Likewise. (som_get_reloc_upper_bound): Likewise. (som_canonicalize_reloc): Likewise. * srec.c (srec_get_symtab_upper_bound): Likewise. (srec_get_symtab): Likewise. (srec_get_reloc_upper_bound): Define as bfd_0l. (srec_canonicalize_reloc): Likewise. * tekhex.c (tekhex_get_symtab): Return long, and -1 on errors. (tekhex_get_symtab_upper_bound): Likewise. (tekhex_get_reloc_upper_bound): Define as bfd_0l. (tekhex_canonicalize_reloc): Likewise. * libaout.h (NAME(aout,get_symtab_upper_bound)): Change declaration to return long. (NAME(aout,get_symtab)): Likewise. (NAME(aout,canonicalize_reloc)): Likewise. (NAME(aout,get_reloc_upper_bound)): Likewise. * libcoff-in.h (coff_get_symtab_upper_bound): Likewise. (coff_get_symtab): Likewise. (coff_get_reloc_upper_bound): Likewise. * libecoff.h (ecoff_get_symtab_upper_bound): Likewise. (ecoff_get_symtab): Likewise. (ecoff_canonicalize_reloc): Likewise. * libelf.h (bfd_elf32_get_symtab_upper_bound): Likewise. (bfd_elf32_get_symtab): Likewise. (bfd_elf32_get_reloc_upper_bound): Likewise. (bfd_elf32_canonicalize_reloc): Likewise. (bfd_elf64_get_symtab_upper_bound): Likewise. (bfd_elf64_get_symtab): Likewise. (bfd_elf64_get_reloc_upper_bound): Likewise. (bfd_elf64_canonicalize_reloc): Likewise. * libnlm.h (nlmNAME(get_symtab_upper_bound)): Likewise. (nlmNAME(get_symtab)): Likewise. (nlmNAME(get_reloc_upper_bound)): Likewise. (nlmNAME(canonicalize_reloc)): Likewise. * archive.c (compute_and_write_armap): Use error_return and no_memory_return labels rather than freeing information in various places. Change storage, symcount and src_count to long. Check errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * bout.c (b_out_relax_section): Change reloc_size to long. Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (b_out_get_relocated_section_contents): Likewise. * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise. * elf32-mips.c: Likewise. * elf32-hppa.c (hppa_elf_stub_finish): Likewise. (hppa_look_for_stubs_in_section): Check for errors from bfd_get_symtab_upper_bound, bfd_canonicalize_symtab, and bfd_canonicalize_reloc. * ecofflink.c (bfd_ecoff_debug_accumulate_other): Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * linker.c (generic_link_read_symbols): Likewise. (_bfd_generic_final_link): Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. * reloc16.c (bfd_coff_reloc16_relax_section): Likewise. (bfd_coff_reloc16_get_relocated_section_contents): Likewise. * libbfd.c (bfd_0l): New function. * libbfd-in.h (bfd_0l): Declare. * aix386-core.c: Change get_symtab_upper_bound, get_symtab, get_reloc_upper_bound, and canonicalize_reloc to use bfd_0l rather than bfd_0u. * cisco-core.c, hppabsd-core.c, hpux-core.c: Likewise. * irix-core.c, osf-core.c, ptrace-core.c, trad-core.c: Likewise. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * libcoff.h: Rebuilt. * nlm32-sparc.c (nlm_sparc_read_reloc): Remove unused variables temp and name.
1994-03-31 00:15:07 +02:00
(abfd, section, reloc, shrink, link_info))
Add new style linker support to COFF backend. a29k only for now. * cofflink.c: New file. * libcoff-in.h: Include bfdlink.h. (obj_coff_external_syms, obj_coff_strings): Define accessor macro. (obj_coff_sym_hashes): Define accessor macro. (struct coff_tdata): Add fields external_syms, strings, and sym_hashes. (struct coff_link_hash_entry): Define. (struct coff_link_hash_table): Define. (coff_link_hash_lookup, coff_link_hash_traverse): Define. (coff_hash_table): Define. (_bfd_coff_link_hash_table_create): Declare. (_bfd_coff_link_add_symbols, _bfd_coff_final_link): Declare. * coffcode.h (bfd_coff_backend_data): Add fields _bfd_relsz, _bfd_coff_swap_reloc_in, _bfd_coff_sym_is_global, _bfd_coff_compute_section_file_positions, _bfd_coff_relocate_section. (bfd_coff_relsz, bfd_coff_swap_reloc_in): Define. (bfd_coff_sym_is_global): Define. (bfd_coff_compute_section_file_positions): Define. (bfd_coff_relocate_section): Define. (coff_mkobject_hook): Initialize obj_raw_syment_count and obj_conv_table_size. (coff_compute_section_file_positions): Set target_index of all sections. Set output_has_begun field. (coff_write_object_contents): Don't set target_index; now done by coff_compute_section_file_positions. Remove obsolete handling of scn_base and data_base. Don't bother to check that target_index is positive, since it always is. Remove use of pad, which is always zero. Check obj_raw_syment_count, not bfd_get_symcount, for the number of symbols, but only write them out if bfd_get_symcount is non-zero. (coff_slurp_symbol_table): Use obj_raw_syment_count, not bfd_get_symcount for the number of symbols. Don't set obj_conv_table_size. (coff_sym_is_global): New static function or macro. (coff_slurp_reloc_table): Call coff_swap_reloc_in, not bfd_swap_reloc_in. (coff_bfd_link_hash_table_create): If coff_relocate_section is defined, define as _bfd_coff_link_hash_table_create. (coff_bfd_link_add_symbols): Similar change. (coff_bfd_final_link): Similar change. (coff_relocate_section): Define as NULL if not defined. (bfd_coff_std_swap_table): Initialize new fields. * coffgen.c (coff_real_object_p): Don't set obj_raw_syment_count and obj_conv_table_size here. (coff_count_linenumbers): Reindent. If bfd_get_symcount is zero, add up the line numbers from the sections. (coff_write_symbols): Don't set bfd_get_symcount. (coff_pointerize_aux): Don't pointerize a nonpositive x_endndx field. (coff_get_normalized_symtab): Use obj_raw_syment_count, not bfd_get_symcount. (coff_print_symbol): If auxp->fix_end, print x_endndx value. * coffswap.h (coff_swap_reloc_in): Rename from bfd_swap_reloc_in. Reindent. Change argument type to PTR. * coff-a29k.c (coff_a29k_relocate_section): New static function. (coff_relocate_section): Define. * configure.in (a29kcoff_big_vec): Compile cofflink.o. * coff-alpha.c (alpha_ecoff_backend_data): Initialize new fields. * coff-mips.c (mips_ecoff_backend_data): Likewise. * libcoff.h: Rebuilt. * Makefile.in: Rebuilt dependencies. (BFD32_BACKENDS): Add cofflink.o. (CFILES): Add cofflink.c.
1994-09-06 21:28:55 +02:00
#define bfd_coff_sym_is_global(abfd, sym)\
((coff_backend_info (abfd)->_bfd_coff_sym_is_global)\
(abfd, sym))
#define bfd_coff_compute_section_file_positions(abfd)\
((coff_backend_info (abfd)->_bfd_coff_compute_section_file_positions)\
(abfd))
#define bfd_coff_relocate_section(obfd,info,ibfd,o,con,rel,isyms,secs)\
((coff_backend_info (ibfd)->_bfd_coff_relocate_section)\
(obfd, info, ibfd, o, con, rel, isyms, secs))