Basically a checkpoint.
Fri Jan 8 15:47:53 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * bfd.c (struct _bfd): Added ecoff_tdata to tdata union. * targets.c (enum target_flavour): Added bfd_target_ecoff_flavour. * coff-msym.c: Use DEFUN for function definitons. * coff-mips.c: Added code to read and print symbols, and to find line numbers.
This commit is contained in:
parent
06c3865a42
commit
515c429211
5 changed files with 1382 additions and 73 deletions
|
@ -1,5 +1,11 @@
|
||||||
Fri Jan 8 15:47:53 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
Fri Jan 8 15:47:53 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
|
||||||
|
|
||||||
|
* bfd.c (struct _bfd): Added ecoff_tdata to tdata union.
|
||||||
|
* targets.c (enum target_flavour): Added bfd_target_ecoff_flavour.
|
||||||
|
* coff-msym.c: Use DEFUN for function definitons.
|
||||||
|
* coff-mips.c: Added code to read and print symbols, and to find
|
||||||
|
line numbers.
|
||||||
|
|
||||||
* coffcode.h: Moved many generic functions into coffgen.c. Moved
|
* coffcode.h: Moved many generic functions into coffgen.c. Moved
|
||||||
swapping functions into coffswap.h for ECOFF use. Moved
|
swapping functions into coffswap.h for ECOFF use. Moved
|
||||||
relocation functions, only used by h8300 and z8k, into reloc16.c.
|
relocation functions, only used by h8300 and z8k, into reloc16.c.
|
||||||
|
|
48
bfd/bfd.c
48
bfd/bfd.c
|
@ -146,6 +146,7 @@ CODE_FRAGMENT
|
||||||
. struct _oasys_data *oasys_obj_data;
|
. struct _oasys_data *oasys_obj_data;
|
||||||
. struct _oasys_ar_data *oasys_ar_data;
|
. struct _oasys_ar_data *oasys_ar_data;
|
||||||
. struct coff_tdata *coff_obj_data;
|
. struct coff_tdata *coff_obj_data;
|
||||||
|
. struct ecoff_tdata *ecoff_obj_data;
|
||||||
. struct ieee_data_struct *ieee_data;
|
. struct ieee_data_struct *ieee_data;
|
||||||
. struct ieee_ar_data_struct *ieee_ar_data;
|
. struct ieee_ar_data_struct *ieee_ar_data;
|
||||||
. struct srec_data_struct *srec_data;
|
. struct srec_data_struct *srec_data;
|
||||||
|
@ -517,6 +518,53 @@ bfd_get_mtime (abfd)
|
||||||
return buf.st_mtime;
|
return buf.st_mtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
FUNCTION
|
||||||
|
The bfd_get_size function
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
long bfd_get_size(bfd *);
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
Return file size (as read from file system) for the file
|
||||||
|
associated with a bfd.
|
||||||
|
|
||||||
|
Note that the initial motivation for, and use of, this routine is not
|
||||||
|
so we can get the exact size of the object the bfd applies to, since
|
||||||
|
that might not be generally possible (archive members for example?).
|
||||||
|
Although it would be ideal if someone could eventually modify
|
||||||
|
it so that such results were guaranteed.
|
||||||
|
|
||||||
|
Instead, we want to ask questions like "is this NNN byte sized
|
||||||
|
object I'm about to try read from file offset YYY reasonable?"
|
||||||
|
As as example of where we might want to do this, some object formats
|
||||||
|
use string tables for which the first sizeof(long) bytes of the table
|
||||||
|
contain the size of the table itself, including the size bytes.
|
||||||
|
If an application tries to read what it thinks is one of these
|
||||||
|
string tables, without some way to validate the size, and for
|
||||||
|
some reason the size is wrong (byte swapping error, wrong location
|
||||||
|
for the string table, etc), the only clue is likely to be a read
|
||||||
|
error when it tries to read the table, or a "virtual memory
|
||||||
|
exhausted" error when it tries to allocated 15 bazillon bytes
|
||||||
|
of space for the 15 bazillon byte table it is about to read.
|
||||||
|
This function at least allows us to answer the quesion, "is the
|
||||||
|
size reasonable?".
|
||||||
|
*/
|
||||||
|
|
||||||
|
long
|
||||||
|
bfd_get_size (abfd)
|
||||||
|
bfd *abfd;
|
||||||
|
{
|
||||||
|
FILE *fp;
|
||||||
|
struct stat buf;
|
||||||
|
|
||||||
|
fp = bfd_cache_lookup (abfd);
|
||||||
|
if (0 != fstat (fileno (fp), &buf))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return buf.st_size;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FUNCTION
|
FUNCTION
|
||||||
stuff
|
stuff
|
||||||
|
|
1332
bfd/coff-mips.c
1332
bfd/coff-mips.c
File diff suppressed because it is too large
Load diff
|
@ -38,10 +38,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
#include "coff/ecoff-ext.h" /* ECOFF external struct defns */
|
#include "coff/ecoff-ext.h" /* ECOFF external struct defns */
|
||||||
|
|
||||||
void
|
void
|
||||||
ecoff_swap_hdr_in (abfd, ext_copy, intern)
|
DEFUN (ecoff_swap_hdr_in, (abfd, ext_copy, intern),
|
||||||
bfd *abfd;
|
bfd *abfd AND
|
||||||
struct hdr_ext *ext_copy;
|
struct hdr_ext *ext_copy AND
|
||||||
HDRR *intern;
|
HDRR *intern)
|
||||||
{
|
{
|
||||||
struct hdr_ext ext[1];
|
struct hdr_ext ext[1];
|
||||||
|
|
||||||
|
@ -82,10 +82,10 @@ ecoff_swap_hdr_in (abfd, ext_copy, intern)
|
||||||
/* Swap in the file descriptor record. */
|
/* Swap in the file descriptor record. */
|
||||||
|
|
||||||
void
|
void
|
||||||
ecoff_swap_fdr_in (abfd, ext_copy, intern)
|
DEFUN (ecoff_swap_fdr_in, (abfd, ext_copy, intern),
|
||||||
bfd *abfd;
|
bfd *abfd AND
|
||||||
struct fdr_ext *ext_copy;
|
struct fdr_ext *ext_copy AND
|
||||||
FDR *intern;
|
FDR *intern)
|
||||||
{
|
{
|
||||||
struct fdr_ext ext[1];
|
struct fdr_ext ext[1];
|
||||||
|
|
||||||
|
@ -143,10 +143,10 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern)
|
||||||
/* Swap in the procedure descriptor record. */
|
/* Swap in the procedure descriptor record. */
|
||||||
|
|
||||||
void
|
void
|
||||||
ecoff_swap_pdr_in (abfd, ext_copy, intern)
|
DEFUN (ecoff_swap_pdr_in, (abfd, ext_copy, intern),
|
||||||
bfd *abfd;
|
bfd *abfd AND
|
||||||
struct pdr_ext *ext_copy;
|
struct pdr_ext *ext_copy AND
|
||||||
PDR *intern;
|
PDR *intern)
|
||||||
{
|
{
|
||||||
struct pdr_ext ext[1];
|
struct pdr_ext ext[1];
|
||||||
|
|
||||||
|
@ -177,10 +177,10 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern)
|
||||||
/* Swap in a symbol record. */
|
/* Swap in a symbol record. */
|
||||||
|
|
||||||
void
|
void
|
||||||
ecoff_swap_sym_in (abfd, ext_copy, intern)
|
DEFUN (ecoff_swap_sym_in, (abfd, ext_copy, intern),
|
||||||
bfd *abfd;
|
bfd *abfd AND
|
||||||
struct sym_ext *ext_copy;
|
struct sym_ext *ext_copy AND
|
||||||
SYMR *intern;
|
SYMR *intern)
|
||||||
{
|
{
|
||||||
struct sym_ext ext[1];
|
struct sym_ext ext[1];
|
||||||
|
|
||||||
|
@ -226,10 +226,10 @@ ecoff_swap_sym_in (abfd, ext_copy, intern)
|
||||||
/* Swap in an external symbol record. */
|
/* Swap in an external symbol record. */
|
||||||
|
|
||||||
void
|
void
|
||||||
ecoff_swap_ext_in (abfd, ext_copy, intern)
|
DEFUN (ecoff_swap_ext_in, (abfd, ext_copy, intern),
|
||||||
bfd *abfd;
|
bfd *abfd AND
|
||||||
struct ext_ext *ext_copy;
|
struct ext_ext *ext_copy AND
|
||||||
EXTR *intern;
|
EXTR *intern)
|
||||||
{
|
{
|
||||||
struct ext_ext ext[1];
|
struct ext_ext ext[1];
|
||||||
|
|
||||||
|
@ -260,10 +260,10 @@ ecoff_swap_ext_in (abfd, ext_copy, intern)
|
||||||
info comes from the file header record (fh-fBigendian). */
|
info comes from the file header record (fh-fBigendian). */
|
||||||
|
|
||||||
void
|
void
|
||||||
ecoff_swap_tir_in (bigend, ext_copy, intern)
|
DEFUN (ecoff_swap_tir_in, (bigend, ext_copy, intern),
|
||||||
int bigend;
|
int bigend AND
|
||||||
struct tir_ext *ext_copy;
|
struct tir_ext *ext_copy AND
|
||||||
TIR *intern;
|
TIR *intern)
|
||||||
{
|
{
|
||||||
struct tir_ext ext[1];
|
struct tir_ext ext[1];
|
||||||
|
|
||||||
|
@ -316,10 +316,10 @@ ecoff_swap_tir_in (bigend, ext_copy, intern)
|
||||||
big-endian or little-endian format.*/
|
big-endian or little-endian format.*/
|
||||||
|
|
||||||
void
|
void
|
||||||
ecoff_swap_rndx_in (bigend, ext_copy, intern)
|
DEFUN (ecoff_swap_rndx_in, (bigend, ext_copy, intern),
|
||||||
int bigend;
|
int bigend AND
|
||||||
struct rndx_ext *ext_copy;
|
struct rndx_ext *ext_copy AND
|
||||||
RNDXR *intern;
|
RNDXR *intern)
|
||||||
{
|
{
|
||||||
struct rndx_ext ext[1];
|
struct rndx_ext ext[1];
|
||||||
|
|
||||||
|
@ -353,10 +353,10 @@ ecoff_swap_rndx_in (bigend, ext_copy, intern)
|
||||||
/* Swap in a relative file descriptor. */
|
/* Swap in a relative file descriptor. */
|
||||||
|
|
||||||
void
|
void
|
||||||
ecoff_swap_rfd_in (abfd, ext, intern)
|
DEFUN (ecoff_swap_rfd_in, (abfd, ext, intern),
|
||||||
bfd *abfd;
|
bfd *abfd AND
|
||||||
struct rfd_ext *ext;
|
struct rfd_ext *ext AND
|
||||||
RFDT *intern;
|
RFDT *intern)
|
||||||
{
|
{
|
||||||
|
|
||||||
*intern = bfd_h_get_32 (abfd, (bfd_byte *)ext->rfd);
|
*intern = bfd_h_get_32 (abfd, (bfd_byte *)ext->rfd);
|
||||||
|
|
|
@ -132,6 +132,7 @@ of a file.
|
||||||
. bfd_target_unknown_flavour,
|
. bfd_target_unknown_flavour,
|
||||||
. bfd_target_aout_flavour,
|
. bfd_target_aout_flavour,
|
||||||
. bfd_target_coff_flavour,
|
. bfd_target_coff_flavour,
|
||||||
|
. bfd_target_ecoff_flavour,
|
||||||
. bfd_target_elf_flavour,
|
. bfd_target_elf_flavour,
|
||||||
. bfd_target_ieee_flavour,
|
. bfd_target_ieee_flavour,
|
||||||
. bfd_target_oasys_flavour,
|
. bfd_target_oasys_flavour,
|
||||||
|
@ -357,7 +358,7 @@ extern bfd_target rs6000coff_vec;
|
||||||
extern bfd_target h8300coff_vec;
|
extern bfd_target h8300coff_vec;
|
||||||
extern bfd_target z8kcoff_vec;
|
extern bfd_target z8kcoff_vec;
|
||||||
extern bfd_target we32kcoff_vec;
|
extern bfd_target we32kcoff_vec;
|
||||||
#ifdef hp9000s800
|
#ifdef HOST_HPPAHPUX
|
||||||
extern bfd_target hppa_vec;
|
extern bfd_target hppa_vec;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -412,7 +413,7 @@ bfd_target *target_vector[] = {
|
||||||
&m68kcoff_vec,
|
&m68kcoff_vec,
|
||||||
&a29kcoff_big_vec,
|
&a29kcoff_big_vec,
|
||||||
&rs6000coff_vec,
|
&rs6000coff_vec,
|
||||||
#ifdef hp9000s800
|
#ifdef HOST_HPPAHPUX
|
||||||
&hppa_vec,
|
&hppa_vec,
|
||||||
#endif
|
#endif
|
||||||
&we32kcoff_vec,
|
&we32kcoff_vec,
|
||||||
|
|
Loading…
Reference in a new issue