* ecoff.c (ecoff_swap_tir_in): Change input argument to const.

(ecoff_swap_tir_out): Likewise.
	(ecoff_swap_rndx_in, ecoff_swap_rndx_out): Likewise.
	(ecoff_slurp_symbolic_info): Add new arguments to correspond to
	read_debug_info entry point in ecoff_debug_swap structure.
	Change all calls.
	* libecoff.h (ecoff_slurp_symbolic_info): Change declaration.
	* ecoffswap.h (ecoff_swap_tir_in, ecoff_swap_tir_out): Declare.
	(ecoff_swap_rndx_in, ecoff_swap_rndx_out): Declare.
	* coff-alpha.c (alpha_ecoff_backend_data): Initialize new
	ecoff_debug_swap fields.
	* coff-mips.c (mips_ecoff_backend_data): Likewise.
	* elf32-mips.c (mips_elf_read_ecoff_info): Undefine READ.
	(mips_elf_ecoff_debug_swap): Initialize new ecoff_debug_swap
	fields.
	* configure.in (bfd_elf32_bigmips_vec): Use ecoff.o and
	ecofflink.o.
	(bfd_elf32_littlemips_vec): Likewise.
	(ecoff_big_vec, ecoff_little_vec): Likewise.
	(ecoffalpha_little_vec): Likewise.
	* Makefile.in (BFD_LIBS): Remove ecoff.o and ecofflink.o.
	(BFD32_BACKENDS): Add ecoff.o and ecofflink.o.
This commit is contained in:
Ian Lance Taylor 1994-06-20 18:26:55 +00:00
parent 6c8fa8e62c
commit aac6b32f31
7 changed files with 1482 additions and 591 deletions

View File

@ -1,5 +1,28 @@
Mon Jun 20 11:06:27 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
* ecoff.c (ecoff_swap_tir_in): Change input argument to const.
(ecoff_swap_tir_out): Likewise.
(ecoff_swap_rndx_in, ecoff_swap_rndx_out): Likewise.
(ecoff_slurp_symbolic_info): Add new arguments to correspond to
read_debug_info entry point in ecoff_debug_swap structure.
Change all calls.
* libecoff.h (ecoff_slurp_symbolic_info): Change declaration.
* ecoffswap.h (ecoff_swap_tir_in, ecoff_swap_tir_out): Declare.
(ecoff_swap_rndx_in, ecoff_swap_rndx_out): Declare.
* coff-alpha.c (alpha_ecoff_backend_data): Initialize new
ecoff_debug_swap fields.
* coff-mips.c (mips_ecoff_backend_data): Likewise.
* elf32-mips.c (mips_elf_read_ecoff_info): Undefine READ.
(mips_elf_ecoff_debug_swap): Initialize new ecoff_debug_swap
fields.
* configure.in (bfd_elf32_bigmips_vec): Use ecoff.o and
ecofflink.o.
(bfd_elf32_littlemips_vec): Likewise.
(ecoff_big_vec, ecoff_little_vec): Likewise.
(ecoffalpha_little_vec): Likewise.
* Makefile.in (BFD_LIBS): Remove ecoff.o and ecofflink.o.
(BFD32_BACKENDS): Add ecoff.o and ecofflink.o.
* aoutx.h (NAME(aout,final_link)): Check flavour of sub, not abfd,
when computing reloc sizes. From Eric Youngdale
<ericy@cais.cais.com>.

View File

@ -1956,6 +1956,8 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
ecoff_swap_fdr_in,
ecoff_swap_rfd_in,
ecoff_swap_ext_in,
ecoff_swap_tir_in,
ecoff_swap_rndx_in,
/* Functions to swap out external symbolic data. */
ecoff_swap_hdr_out,
ecoff_swap_dnr_out,
@ -1964,7 +1966,11 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
ecoff_swap_opt_out,
ecoff_swap_fdr_out,
ecoff_swap_rfd_out,
ecoff_swap_ext_out
ecoff_swap_ext_out,
ecoff_swap_tir_out,
ecoff_swap_rndx_out,
/* Function to read in symbolic data. */
ecoff_slurp_symbolic_info
},
/* External reloc size. */
RELSZ,
@ -2027,6 +2033,7 @@ bfd_target ecoffalpha_little_vec =
BFD_JUMP_TABLE_RELOCS (ecoff),
BFD_JUMP_TABLE_WRITE (ecoff),
BFD_JUMP_TABLE_LINK (ecoff),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
(PTR) &alpha_ecoff_backend_data
};

View File

@ -2320,6 +2320,8 @@ static const struct ecoff_backend_data mips_ecoff_backend_data =
ecoff_swap_fdr_in,
ecoff_swap_rfd_in,
ecoff_swap_ext_in,
ecoff_swap_tir_in,
ecoff_swap_rndx_in,
/* Functions to swap out external symbolic data. */
ecoff_swap_hdr_out,
ecoff_swap_dnr_out,
@ -2328,7 +2330,11 @@ static const struct ecoff_backend_data mips_ecoff_backend_data =
ecoff_swap_opt_out,
ecoff_swap_fdr_out,
ecoff_swap_rfd_out,
ecoff_swap_ext_out
ecoff_swap_ext_out,
ecoff_swap_tir_out,
ecoff_swap_rndx_out,
/* Function to read in symbolic data. */
ecoff_slurp_symbolic_info
},
/* External reloc size. */
RELSZ,

View File

@ -412,7 +412,7 @@ ecoff_styp_to_sec_flags (abfd, hdr)
void
ecoff_swap_tir_in (bigend, ext_copy, intern)
int bigend;
struct tir_ext *ext_copy;
const struct tir_ext *ext_copy;
TIR *intern;
{
struct tir_ext ext[1];
@ -469,7 +469,7 @@ ecoff_swap_tir_in (bigend, ext_copy, intern)
void
ecoff_swap_tir_out (bigend, intern_copy, ext)
int bigend;
TIR *intern_copy;
const TIR *intern_copy;
struct tir_ext *ext;
{
TIR intern[1];
@ -525,7 +525,7 @@ ecoff_swap_tir_out (bigend, intern_copy, ext)
void
ecoff_swap_rndx_in (bigend, ext_copy, intern)
int bigend;
struct rndx_ext *ext_copy;
const struct rndx_ext *ext_copy;
RNDXR *intern;
{
struct rndx_ext ext[1];
@ -564,7 +564,7 @@ ecoff_swap_rndx_in (bigend, ext_copy, intern)
void
ecoff_swap_rndx_out (bigend, intern_copy, ext)
int bigend;
RNDXR *intern_copy;
const RNDXR *intern_copy;
struct rndx_ext *ext;
{
RNDXR intern[1];
@ -665,11 +665,15 @@ ecoff_slurp_symbolic_header (abfd)
}
/* Read in and swap the important symbolic information for an ECOFF
object file. This is called by gdb. */
object file. This is called by gdb via the read_debug_info entry
point in the backend structure. */
/*ARGSUSED*/
boolean
ecoff_slurp_symbolic_info (abfd)
ecoff_slurp_symbolic_info (abfd, ignore, debug)
bfd *abfd;
asection *ignore;
struct ecoff_debug_info *debug;
{
const struct ecoff_backend_data * const backend = ecoff_backend (abfd);
HDRR *internal_symhdr;
@ -683,6 +687,8 @@ ecoff_slurp_symbolic_info (abfd)
bfd_size_type raw_end;
bfd_size_type cb_end;
BFD_ASSERT (debug == &ecoff_data (abfd)->debug_info);
/* Check whether we've already gotten it, and whether there's any to
get. */
if (ecoff_data (abfd)->raw_syments != (PTR) NULL)
@ -696,7 +702,7 @@ ecoff_slurp_symbolic_info (abfd)
if (! ecoff_slurp_symbolic_header (abfd))
return false;
internal_symhdr = &ecoff_data (abfd)->debug_info.symbolic_header;
internal_symhdr = &debug->symbolic_header;
/* Read all the symbolic information at once. */
raw_base = (ecoff_data (abfd)->sym_filepos
@ -756,11 +762,11 @@ ecoff_slurp_symbolic_info (abfd)
/* Get pointers for the numeric offsets in the HDRR structure. */
#define FIX(off1, off2, type) \
if (internal_symhdr->off1 == 0) \
ecoff_data (abfd)->debug_info.off2 = (type) NULL; \
debug->off2 = (type) NULL; \
else \
ecoff_data (abfd)->debug_info.off2 = (type) ((char *) raw \
+ internal_symhdr->off1 \
- raw_base)
debug->off2 = (type) ((char *) raw \
+ internal_symhdr->off1 \
- raw_base)
FIX (cbLineOffset, line, unsigned char *);
FIX (cbDnOffset, external_dnr, PTR);
FIX (cbPdOffset, external_pdr, PTR);
@ -782,18 +788,17 @@ ecoff_slurp_symbolic_info (abfd)
We need to look at the fdr to deal with a lot of information in
the symbols, so we swap them here. */
ecoff_data (abfd)->debug_info.fdr =
(struct fdr *) bfd_alloc (abfd,
(internal_symhdr->ifdMax *
sizeof (struct fdr)));
if (ecoff_data (abfd)->debug_info.fdr == NULL)
debug->fdr = (struct fdr *) bfd_alloc (abfd,
(internal_symhdr->ifdMax *
sizeof (struct fdr)));
if (debug->fdr == NULL)
{
bfd_set_error (bfd_error_no_memory);
return false;
}
external_fdr_size = backend->debug_swap.external_fdr_size;
fdr_ptr = ecoff_data (abfd)->debug_info.fdr;
fraw_src = (char *) ecoff_data (abfd)->debug_info.external_fdr;
fdr_ptr = debug->fdr;
fraw_src = (char *) debug->external_fdr;
fraw_end = fraw_src + internal_symhdr->ifdMax * external_fdr_size;
for (; fraw_src < fraw_end; fraw_src += external_fdr_size, fdr_ptr++)
(*backend->debug_swap.swap_fdr_in) (abfd, (PTR) fraw_src, fdr_ptr);
@ -1128,7 +1133,8 @@ ecoff_slurp_symbol_table (abfd)
return true;
/* Get the symbolic information. */
if (ecoff_slurp_symbolic_info (abfd) == false)
if (! ecoff_slurp_symbolic_info (abfd, (asection *) NULL,
&ecoff_data (abfd)->debug_info))
return false;
if (bfd_get_symcount (abfd) == 0)
return true;
@ -1211,7 +1217,8 @@ long
ecoff_get_symtab_upper_bound (abfd)
bfd *abfd;
{
if (! ecoff_slurp_symbolic_info (abfd))
if (! ecoff_slurp_symbolic_info (abfd, (asection *) NULL,
&ecoff_data (abfd)->debug_info))
return -1;
if (bfd_get_symcount (abfd) == 0)
@ -2020,7 +2027,8 @@ ecoff_find_nearest_line (abfd,
return false;
/* Make sure we have the FDR's. */
if (ecoff_slurp_symbolic_info (abfd) == false
if (! ecoff_slurp_symbolic_info (abfd, (asection *) NULL,
&ecoff_data (abfd)->debug_info)
|| bfd_get_symcount (abfd) == 0)
return false;

View File

@ -51,6 +51,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define ecoff_put_off bfd_h_put_64
#endif
/* ECOFF auxiliary information swapping routines. These are the same
for all ECOFF targets, so they are defined in ecoff.c. */
extern void ecoff_swap_tir_in PARAMS ((int, const struct tir_ext *, TIR *));
extern void ecoff_swap_tir_out PARAMS ((int, const TIR *, struct tir_ext *));
extern void ecoff_swap_rndx_in PARAMS ((int, const struct rndx_ext *,
RNDXR *));
extern void ecoff_swap_rndx_out PARAMS ((int, const RNDXR *,
struct rndx_ext *));
/* Swap in the symbolic header. */
static void
@ -209,7 +218,7 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern)
static void
ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr)
bfd *abfd;
FDR *intern_copy;
const FDR *intern_copy;
PTR ext_ptr;
{
struct fdr_ext *ext = (struct fdr_ext *) ext_ptr;
@ -288,17 +297,43 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern)
intern->isym = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_isym);
intern->iline = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_iline);
intern->regmask = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_regmask);
intern->regoffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_regoffset);
intern->iopt = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_iopt);
intern->regoffset = bfd_h_get_signed_32 (abfd,
(bfd_byte *)ext->p_regoffset);
intern->iopt = bfd_h_get_signed_32 (abfd, (bfd_byte *)ext->p_iopt);
intern->fregmask = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_fregmask);
intern->fregoffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_fregoffset);
intern->frameoffset = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_frameoffset);
intern->fregoffset = bfd_h_get_signed_32 (abfd,
(bfd_byte *)ext->p_fregoffset);
intern->frameoffset = bfd_h_get_signed_32 (abfd,
(bfd_byte *)ext->p_frameoffset);
intern->framereg = bfd_h_get_16 (abfd, (bfd_byte *)ext->p_framereg);
intern->pcreg = bfd_h_get_16 (abfd, (bfd_byte *)ext->p_pcreg);
intern->lnLow = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_lnLow);
intern->lnHigh = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_lnHigh);
intern->cbLineOffset = ecoff_get_off (abfd, (bfd_byte *)ext->p_cbLineOffset);
#ifdef ECOFF_64
intern->gp_prologue = bfd_h_get_8 (abfd, (bfd_byte *) ext->p_gp_prologue);
if (abfd->xvec->header_byteorder_big_p != false)
{
intern->gp_used = 0 != (ext->p_bits1[0] & PDR_BITS1_GP_USED_BIG);
intern->reg_frame = 0 != (ext->p_bits1[0] & PDR_BITS1_REG_FRAME_BIG);
intern->reserved = (((ext->p_bits1[0] & PDR_BITS1_RESERVED_BIG)
<< PDR_BITS1_RESERVED_SH_LEFT_BIG)
| ((ext->p_bits2[0] & PDR_BITS2_RESERVED_BIG)
>> PDR_BITS2_RESERVED_SH_BIG));
}
else
{
intern->gp_used = 0 != (ext->p_bits1[0] & PDR_BITS1_GP_USED_LITTLE);
intern->reg_frame = 0 != (ext->p_bits1[0] & PDR_BITS1_REG_FRAME_LITTLE);
intern->reserved = (((ext->p_bits1[0] & PDR_BITS1_RESERVED_LITTLE)
>> PDR_BITS1_RESERVED_SH_LITTLE)
| ((ext->p_bits2[0] & PDR_BITS2_RESERVED_LITTLE)
<< PDR_BITS2_RESERVED_SH_LEFT_LITTLE));
}
intern->localoff = bfd_h_get_8 (abfd, (bfd_byte *) ext->p_localoff);
#endif
#ifdef TEST
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
abort();
@ -310,7 +345,7 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern)
static void
ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr)
bfd *abfd;
PDR *intern_copy;
const PDR *intern_copy;
PTR ext_ptr;
{
struct pdr_ext *ext = (struct pdr_ext *) ext_ptr;
@ -333,6 +368,31 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr)
bfd_h_put_32 (abfd, intern->lnHigh, (bfd_byte *)ext->p_lnHigh);
ecoff_put_off (abfd, intern->cbLineOffset, (bfd_byte *)ext->p_cbLineOffset);
#ifdef ECOFF_64
bfd_h_put_8 (abfd, intern->gp_prologue, (bfd_byte *) ext->p_gp_prologue);
if (abfd->xvec->header_byteorder_big_p != false)
{
ext->p_bits1[0] = ((intern->gp_used ? PDR_BITS1_GP_USED_BIG : 0)
| (intern->reg_frame ? PDR_BITS1_REG_FRAME_BIG : 0)
| ((intern->reserved
>> PDR_BITS1_RESERVED_SH_LEFT_BIG)
& PDR_BITS1_RESERVED_BIG));
ext->p_bits2[0] = ((intern->reserved << PDR_BITS2_RESERVED_SH_BIG)
& PDR_BITS2_RESERVED_BIG);
}
else
{
ext->p_bits1[0] = ((intern->gp_used ? PDR_BITS1_GP_USED_LITTLE : 0)
| (intern->reg_frame ? PDR_BITS1_REG_FRAME_LITTLE : 0)
| ((intern->reserved << PDR_BITS1_RESERVED_SH_LITTLE)
& PDR_BITS1_RESERVED_LITTLE));
ext->p_bits2[0] = ((intern->reserved >>
PDR_BITS2_RESERVED_SH_LEFT_LITTLE)
& PDR_BITS2_RESERVED_LITTLE);
}
bfd_h_put_8 (abfd, intern->localoff, (bfd_byte *) ext->p_localoff);
#endif
#ifdef TEST
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
abort();
@ -378,7 +438,8 @@ ecoff_swap_sym_in (abfd, ext_copy, intern)
intern->index = ((ext->s_bits2[0] & SYM_BITS2_INDEX_LITTLE)
>> SYM_BITS2_INDEX_SH_LITTLE)
| (ext->s_bits3[0] << SYM_BITS3_INDEX_SH_LEFT_LITTLE)
| (ext->s_bits4[0] << SYM_BITS4_INDEX_SH_LEFT_LITTLE);
| ((unsigned int) ext->s_bits4[0]
<< SYM_BITS4_INDEX_SH_LEFT_LITTLE);
}
#ifdef TEST
@ -392,7 +453,7 @@ ecoff_swap_sym_in (abfd, ext_copy, intern)
static void
ecoff_swap_sym_out (abfd, intern_copy, ext_ptr)
bfd *abfd;
SYMR *intern_copy;
const SYMR *intern_copy;
PTR ext_ptr;
{
struct sym_ext *ext = (struct sym_ext *) ext_ptr;
@ -480,7 +541,7 @@ ecoff_swap_ext_in (abfd, ext_copy, intern)
static void
ecoff_swap_ext_out (abfd, intern_copy, ext_ptr)
bfd *abfd;
EXTR *intern_copy;
const EXTR *intern_copy;
PTR ext_ptr;
{
struct ext_ext *ext = (struct ext_ext *) ext_ptr;
@ -539,7 +600,7 @@ ecoff_swap_rfd_in (abfd, ext_ptr, intern)
static void
ecoff_swap_rfd_out (abfd, intern, ext_ptr)
bfd *abfd;
RFDT *intern;
const RFDT *intern;
PTR ext_ptr;
{
struct rfd_ext *ext = (struct rfd_ext *) ext_ptr;
@ -567,9 +628,12 @@ ecoff_swap_opt_in (abfd, ext_copy, intern)
if (abfd->xvec->header_byteorder_big_p != false)
{
intern->ot = ext->o_bits1[0];
intern->value = ((ext->o_bits2[0] << OPT_BITS2_VALUE_SH_LEFT_BIG)
| (ext->o_bits3[0] << OPT_BITS2_VALUE_SH_LEFT_BIG)
| (ext->o_bits4[0] << OPT_BITS2_VALUE_SH_LEFT_BIG));
intern->value = (((unsigned int) ext->o_bits2[0]
<< OPT_BITS2_VALUE_SH_LEFT_BIG)
| ((unsigned int) ext->o_bits3[0]
<< OPT_BITS2_VALUE_SH_LEFT_BIG)
| ((unsigned int) ext->o_bits4[0]
<< OPT_BITS2_VALUE_SH_LEFT_BIG));
}
else
{
@ -595,7 +659,7 @@ ecoff_swap_opt_in (abfd, ext_copy, intern)
static void
ecoff_swap_opt_out (abfd, intern_copy, ext_ptr)
bfd *abfd;
OPTR *intern_copy;
const OPTR *intern_copy;
PTR ext_ptr;
{
struct opt_ext *ext = (struct opt_ext *) ext_ptr;
@ -655,7 +719,7 @@ ecoff_swap_dnr_in (abfd, ext_copy, intern)
static void
ecoff_swap_dnr_out (abfd, intern_copy, ext_ptr)
bfd *abfd;
DNR *intern_copy;
const DNR *intern_copy;
PTR ext_ptr;
{
struct dnr_ext *ext = (struct dnr_ext *) ext_ptr;

File diff suppressed because it is too large Load Diff

View File

@ -223,7 +223,8 @@ struct ecoff_link_hash_table
extern boolean ecoff_mkobject PARAMS ((bfd *));
/* Read in the ECOFF symbolic debugging information. */
extern boolean ecoff_slurp_symbolic_info PARAMS ((bfd *));
extern boolean ecoff_slurp_symbolic_info PARAMS ((bfd *, asection *,
struct ecoff_debug_info *));
/* Generic ECOFF BFD backend vectors. */