1991-07-31 18:58:05 +02:00
|
|
|
/* 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.
|
1991-07-31 18:58:05 +02:00
|
|
|
Written by Cygnus Support.
|
1991-03-21 22:11:25 +01:00
|
|
|
|
1991-07-31 18:58:05 +02:00
|
|
|
This file is part of BFD, the Binary File Descriptor library.
|
1991-03-21 22:11:25 +01:00
|
|
|
|
1991-07-31 18:58:05 +02: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
|
1991-07-31 18:58:05 +02:00
|
|
|
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
|
|
|
|
1991-07-31 18:58:05 +02: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
|
1991-07-31 18:58:05 +02:00
|
|
|
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 */
|
|
|
|
|
1992-02-06 20:22:03 +01:00
|
|
|
#define coff_data(bfd) ((bfd)->tdata.coff_obj_data)
|
1991-11-27 17:56:08 +01:00
|
|
|
#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)
|
1991-07-31 18:58:05 +02:00
|
|
|
|
1991-11-27 17:56:08 +01:00
|
|
|
#define obj_relocbase(bfd) (coff_data(bfd)->relocbase)
|
|
|
|
#define obj_raw_syments(bfd) (coff_data(bfd)->raw_syments)
|
1993-02-23 07:50:49 +01:00
|
|
|
#define obj_raw_syment_count(bfd) (coff_data(bfd)->raw_syment_count)
|
1991-11-27 17:56:08 +01:00
|
|
|
#define obj_convert(bfd) (coff_data(bfd)->conversion_table)
|
syms.c (asymbol): Added new field "app_data", for data particular to the
application. Some of the linker flags ought to get moved to this field
someday.
archures.c (bfd_default_scan): Recognize a few more numbers: 80486, 80960,
and 960.
bfd-in.h, bfd.c, targets.c, coffcode.h, coff-mips.c, other targets: Moved COFF
swap table to backend data.
hosts/i386linux.h: Include unistd.h.
aoutx.h, libaout.h, stab-syms.c: stab names are now in constant storage.
trad-core.c: Fixed some `PARAMS' uses that were missing parentheses.
aoutx.h, archive.c, archures.c, coffcode.h, ctor.c, reloc.c, syms.c: Doc fixes.
1992-12-04 00:03:17 +01:00
|
|
|
#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
|
|
|
|
1991-11-27 17:56:08 +01:00
|
|
|
/* `Tdata' information kept for COFF files. */
|
1991-07-31 18:58:05 +02:00
|
|
|
|
1991-11-27 17:56:08 +01:00
|
|
|
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;
|
syms.c (asymbol): Added new field "app_data", for data particular to the
application. Some of the linker flags ought to get moved to this field
someday.
archures.c (bfd_default_scan): Recognize a few more numbers: 80486, 80960,
and 960.
bfd-in.h, bfd.c, targets.c, coffcode.h, coff-mips.c, other targets: Moved COFF
swap table to backend data.
hosts/i386linux.h: Include unistd.h.
aoutx.h, libaout.h, stab-syms.c: stab names are now in constant storage.
trad-core.c: Fixed some `PARAMS' uses that were missing parentheses.
aoutx.h, archive.c, archures.c, coffcode.h, ctor.c, reloc.c, syms.c: Doc fixes.
1992-12-04 00:03:17 +01:00
|
|
|
int conv_table_size;
|
1991-03-21 22:11:25 +01:00
|
|
|
file_ptr sym_filepos;
|
|
|
|
|
1991-11-27 17:56:08 +01:00
|
|
|
struct coff_ptr_struct *raw_syments;
|
1991-03-21 22:11:25 +01:00
|
|
|
unsigned int raw_syment_count;
|
1991-11-27 17:56:08 +01:00
|
|
|
|
1991-03-21 22:11:25 +01:00
|
|
|
/* These are only valid once writing has begun */
|
|
|
|
long int relocbase;
|
1991-11-27 17:56:08 +01:00
|
|
|
|
|
|
|
/* 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
|
|
|
|
1991-05-02 06:11:40 +02: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)))
|
1991-05-02 06:11:40 +02: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
|
|
|
/* 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))
|
|
|
|
|
1993-01-08 22:11:21 +01:00
|
|
|
/* Functions in coffgen.c. */
|
1994-08-15 18:26:06 +02:00
|
|
|
extern const bfd_target *coff_object_p PARAMS ((bfd *));
|
1993-01-08 22:11:21 +01:00
|
|
|
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 **));
|
1993-02-23 07:50:49 +01:00
|
|
|
extern int coff_count_linenumbers PARAMS ((bfd *));
|
1993-01-08 22:11:21 +01:00
|
|
|
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 *));
|
1993-01-08 22:11:21 +01:00
|
|
|
extern void coff_mangle_symbols PARAMS ((bfd *));
|
1994-08-15 18:26:06 +02:00
|
|
|
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 *));
|
1993-01-08 22:11:21 +01:00
|
|
|
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));
|
1993-01-08 22:11:21 +01:00
|
|
|
extern asymbol *coff_make_empty_symbol PARAMS ((bfd *));
|
|
|
|
extern void coff_print_symbol PARAMS ((bfd *, PTR filep, asymbol *,
|
|
|
|
bfd_print_symbol_type how));
|
1994-02-01 18:11:56 +01:00
|
|
|
extern void coff_get_symbol_info PARAMS ((bfd *, asymbol *,
|
|
|
|
symbol_info *ret));
|
|
|
|
extern asymbol *coff_bfd_make_debug_symbol PARAMS ((bfd *, PTR,
|
|
|
|
unsigned long));
|
1993-01-08 22:11:21 +01:00
|
|
|
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 *));
|
1993-01-08 22:11:21 +01:00
|
|
|
extern bfd_byte *bfd_coff_reloc16_get_relocated_section_contents
|
1994-02-01 18:11:56 +01:00
|
|
|
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
|
|
|
|
bfd_byte *, boolean relocateable, asymbol **));
|
1993-01-08 22:11:21 +01:00
|
|
|
extern bfd_vma bfd_coff_reloc16_get_value PARAMS ((arelent *,
|
1994-02-01 18:11:56 +01:00
|
|
|
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,
|
1994-02-01 18:11:56 +01:00
|
|
|
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));
|
1991-07-31 18:58:05 +02: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
|
|
|
/* 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 *));
|
|
|
|
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 01:56:56 +01:00
|
|
|
/* And more taken from the source .. */
|
1991-07-31 18:58:05 +02:00
|
|
|
|
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
|
|
|
{
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 01:56:56 +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;
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 01:56:56 +01:00
|
|
|
|
* 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;
|
|
|
|
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 01:56:56 +01:00
|
|
|
/* 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;
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 01:56:56 +01:00
|
|
|
|
|
|
|
/* 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;
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 01:56:56 +01:00
|
|
|
|
|
|
|
/* 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;
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 01:56:56 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* Each canonical asymbol really looks like this: */
|
|
|
|
|
1991-12-01 01:39:12 +01:00
|
|
|
typedef struct coff_symbol_struct
|
|
|
|
{
|
syms.c (asymbol): Added new field "app_data", for data particular to the
application. Some of the linker flags ought to get moved to this field
someday.
archures.c (bfd_default_scan): Recognize a few more numbers: 80486, 80960,
and 960.
bfd-in.h, bfd.c, targets.c, coffcode.h, coff-mips.c, other targets: Moved COFF
swap table to backend data.
hosts/i386linux.h: Include unistd.h.
aoutx.h, libaout.h, stab-syms.c: stab names are now in constant storage.
trad-core.c: Fixed some `PARAMS' uses that were missing parentheses.
aoutx.h, archive.c, archures.c, coffcode.h, ctor.c, reloc.c, syms.c: Doc fixes.
1992-12-04 00:03:17 +01:00
|
|
|
/* The actual symbol which the rest of BFD works with */
|
|
|
|
asymbol symbol;
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 01:56:56 +01:00
|
|
|
|
syms.c (asymbol): Added new field "app_data", for data particular to the
application. Some of the linker flags ought to get moved to this field
someday.
archures.c (bfd_default_scan): Recognize a few more numbers: 80486, 80960,
and 960.
bfd-in.h, bfd.c, targets.c, coffcode.h, coff-mips.c, other targets: Moved COFF
swap table to backend data.
hosts/i386linux.h: Include unistd.h.
aoutx.h, libaout.h, stab-syms.c: stab names are now in constant storage.
trad-core.c: Fixed some `PARAMS' uses that were missing parentheses.
aoutx.h, archive.c, archures.c, coffcode.h, ctor.c, reloc.c, syms.c: Doc fixes.
1992-12-04 00:03:17 +01:00
|
|
|
/* A pointer to the hidden information for this symbol */
|
|
|
|
combined_entry_type *native;
|
1991-08-17 02:17:15 +02:00
|
|
|
|
syms.c (asymbol): Added new field "app_data", for data particular to the
application. Some of the linker flags ought to get moved to this field
someday.
archures.c (bfd_default_scan): Recognize a few more numbers: 80486, 80960,
and 960.
bfd-in.h, bfd.c, targets.c, coffcode.h, coff-mips.c, other targets: Moved COFF
swap table to backend data.
hosts/i386linux.h: Include unistd.h.
aoutx.h, libaout.h, stab-syms.c: stab names are now in constant storage.
trad-core.c: Fixed some `PARAMS' uses that were missing parentheses.
aoutx.h, archive.c, archures.c, coffcode.h, ctor.c, reloc.c, syms.c: Doc fixes.
1992-12-04 00:03:17 +01: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;
|
* aoutx.h, archive.c, archures.c, bfd.c, cache.c, coff-m88k.c,
coffcode.h, core.c, ctor.c, elf.c, format.c, ieee.c, init.c,
libbfd.c, libbfd.h, libcoff.h, opncls.c, reloc.c, section.c,
srec.c, syms.c, targets.c : all new documentation and lint
removal.
1991-12-08 01:56:56 +01:00
|
|
|
} 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
|
1993-01-08 22:11:21 +01:00
|
|
|
{
|
syms.c (asymbol): Added new field "app_data", for data particular to the
application. Some of the linker flags ought to get moved to this field
someday.
archures.c (bfd_default_scan): Recognize a few more numbers: 80486, 80960,
and 960.
bfd-in.h, bfd.c, targets.c, coffcode.h, coff-mips.c, other targets: Moved COFF
swap table to backend data.
hosts/i386linux.h: Include unistd.h.
aoutx.h, libaout.h, stab-syms.c: stab names are now in constant storage.
trad-core.c: Fixed some `PARAMS' uses that were missing parentheses.
aoutx.h, archive.c, archures.c, coffcode.h, ctor.c, reloc.c, syms.c: Doc fixes.
1992-12-04 00:03:17 +01:00
|
|
|
void (*_bfd_coff_swap_aux_in) PARAMS ((
|
1994-02-01 18:11:56 +01:00
|
|
|
bfd *abfd,
|
syms.c (asymbol): Added new field "app_data", for data particular to the
application. Some of the linker flags ought to get moved to this field
someday.
archures.c (bfd_default_scan): Recognize a few more numbers: 80486, 80960,
and 960.
bfd-in.h, bfd.c, targets.c, coffcode.h, coff-mips.c, other targets: Moved COFF
swap table to backend data.
hosts/i386linux.h: Include unistd.h.
aoutx.h, libaout.h, stab-syms.c: stab names are now in constant storage.
trad-core.c: Fixed some `PARAMS' uses that were missing parentheses.
aoutx.h, archive.c, archures.c, coffcode.h, ctor.c, reloc.c, syms.c: Doc fixes.
1992-12-04 00:03:17 +01:00
|
|
|
PTR ext,
|
|
|
|
int type,
|
1994-02-01 18:11:56 +01:00
|
|
|
int class,
|
|
|
|
int indaux,
|
|
|
|
int numaux,
|
syms.c (asymbol): Added new field "app_data", for data particular to the
application. Some of the linker flags ought to get moved to this field
someday.
archures.c (bfd_default_scan): Recognize a few more numbers: 80486, 80960,
and 960.
bfd-in.h, bfd.c, targets.c, coffcode.h, coff-mips.c, other targets: Moved COFF
swap table to backend data.
hosts/i386linux.h: Include unistd.h.
aoutx.h, libaout.h, stab-syms.c: stab names are now in constant storage.
trad-core.c: Fixed some `PARAMS' uses that were missing parentheses.
aoutx.h, archive.c, archures.c, coffcode.h, ctor.c, reloc.c, syms.c: Doc fixes.
1992-12-04 00:03:17 +01:00
|
|
|
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,
|
1994-02-01 18:11:56 +01:00
|
|
|
int indaux,
|
|
|
|
int numaux,
|
syms.c (asymbol): Added new field "app_data", for data particular to the
application. Some of the linker flags ought to get moved to this field
someday.
archures.c (bfd_default_scan): Recognize a few more numbers: 80486, 80960,
and 960.
bfd-in.h, bfd.c, targets.c, coffcode.h, coff-mips.c, other targets: Moved COFF
swap table to backend data.
hosts/i386linux.h: Include unistd.h.
aoutx.h, libaout.h, stab-syms.c: stab names are now in constant storage.
trad-core.c: Fixed some `PARAMS' uses that were missing parentheses.
aoutx.h, archive.c, archures.c, coffcode.h, ctor.c, reloc.c, syms.c: Doc fixes.
1992-12-04 00:03:17 +01:00
|
|
|
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));
|
|
|
|
|
1993-01-08 22:11:21 +01:00
|
|
|
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;
|
1993-01-08 22:11:21 +01:00
|
|
|
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));
|
1993-01-08 22:11:21 +01:00
|
|
|
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,
|
1993-02-23 07:50:49 +01:00
|
|
|
PTR internal_filehdr,
|
|
|
|
PTR internal_aouthdr));
|
1993-01-08 22:11:21 +01:00
|
|
|
flagword (*_bfd_styp_to_sec_flags_hook) PARAMS ((
|
|
|
|
bfd *abfd,
|
1994-08-15 18:26:06 +02:00
|
|
|
PTR internal_scnhdr,
|
|
|
|
const char *name));
|
1993-01-08 22:11:21 +01:00
|
|
|
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,
|
1994-02-01 18:11:56 +01:00
|
|
|
struct bfd_link_info *link_info,
|
|
|
|
struct bfd_link_order *link_order,
|
1993-01-08 22:11:21 +01:00
|
|
|
arelent *reloc,
|
|
|
|
bfd_byte *data,
|
|
|
|
unsigned int *src_ptr,
|
|
|
|
unsigned int *dst_ptr));
|
1994-02-01 18:11:56 +01:00
|
|
|
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,
|
1994-02-01 18:11:56 +01:00
|
|
|
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));
|
1994-02-01 18:11:56 +01:00
|
|
|
|
syms.c (asymbol): Added new field "app_data", for data particular to the
application. Some of the linker flags ought to get moved to this field
someday.
archures.c (bfd_default_scan): Recognize a few more numbers: 80486, 80960,
and 960.
bfd-in.h, bfd.c, targets.c, coffcode.h, coff-mips.c, other targets: Moved COFF
swap table to backend data.
hosts/i386linux.h: Include unistd.h.
aoutx.h, libaout.h, stab-syms.c: stab names are now in constant storage.
trad-core.c: Fixed some `PARAMS' uses that were missing parentheses.
aoutx.h, archive.c, archures.c, coffcode.h, ctor.c, reloc.c, syms.c: Doc fixes.
1992-12-04 00:03:17 +01:00
|
|
|
} bfd_coff_backend_data;
|
|
|
|
|
|
|
|
#define coff_backend_info(abfd) ((bfd_coff_backend_data *) (abfd)->xvec->backend_data)
|
|
|
|
|
1994-02-01 18:11:56 +01:00
|
|
|
#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))
|
syms.c (asymbol): Added new field "app_data", for data particular to the
application. Some of the linker flags ought to get moved to this field
someday.
archures.c (bfd_default_scan): Recognize a few more numbers: 80486, 80960,
and 960.
bfd-in.h, bfd.c, targets.c, coffcode.h, coff-mips.c, other targets: Moved COFF
swap table to backend data.
hosts/i386linux.h: Include unistd.h.
aoutx.h, libaout.h, stab-syms.c: stab names are now in constant storage.
trad-core.c: Fixed some `PARAMS' uses that were missing parentheses.
aoutx.h, archive.c, archures.c, coffcode.h, ctor.c, reloc.c, syms.c: Doc fixes.
1992-12-04 00:03:17 +01:00
|
|
|
|
|
|
|
#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))
|
|
|
|
|
1994-02-01 18:11:56 +01:00
|
|
|
#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))
|
syms.c (asymbol): Added new field "app_data", for data particular to the
application. Some of the linker flags ought to get moved to this field
someday.
archures.c (bfd_default_scan): Recognize a few more numbers: 80486, 80960,
and 960.
bfd-in.h, bfd.c, targets.c, coffcode.h, coff-mips.c, other targets: Moved COFF
swap table to backend data.
hosts/i386linux.h: Include unistd.h.
aoutx.h, libaout.h, stab-syms.c: stab names are now in constant storage.
trad-core.c: Fixed some `PARAMS' uses that were missing parentheses.
aoutx.h, archive.c, archures.c, coffcode.h, ctor.c, reloc.c, syms.c: Doc fixes.
1992-12-04 00:03:17 +01:00
|
|
|
|
|
|
|
#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))
|
|
|
|
|
1993-01-08 22:11:21 +01:00
|
|
|
#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)
|
1993-01-08 22:11:21 +01:00
|
|
|
#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))
|
|
|
|
|
1993-01-08 22:11:21 +01:00
|
|
|
#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))
|
1993-02-23 07:50:49 +01:00
|
|
|
#define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\
|
|
|
|
((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr))
|
1993-01-08 22:11:21 +01:00
|
|
|
|
1994-08-15 18:26:06 +02:00
|
|
|
#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name)\
|
|
|
|
((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook) (abfd, scnhdr, name))
|
1993-01-08 22:11:21 +01:00
|
|
|
|
|
|
|
#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))
|
|
|
|
|
1994-02-01 18:11:56 +01:00
|
|
|
#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)\
|
1993-01-08 22:11:21 +01:00
|
|
|
((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\
|
1994-02-01 18:11:56 +01:00
|
|
|
(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)\
|
1994-02-01 18:11:56 +01:00
|
|
|
((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))
|
|
|
|
|