* bfd.c (struct bfd_preserve): New.
(bfd_preserve_save): New function. (bfd_preserve_restore): Ditto. (bfd_preserve_finish): Ditto. * bfd-in2.h: Regenerate. * mach-o.c: Formatting. (bfd_mach_o_scan_read_symtab_symbol): Make "value" unsigned. (bfd_mach_o_object_p): Use bfd_preserve_save/restore/finish. (bfd_mach_o_core_p): Ditto. (bfd_mach_o_scan): Pass in mdata. * mach-o.h (bfd_mach_o_scan): Update prototype. * pef.c: Formatting. (bfd_pef_object_p): Use bfd_preserve_save/restore/finish. (bfd_pef_xlib_object_p): Ditto. (bfd_pef_scan): Pass in mdata. Move version check to bfd_pef_object_p. * pef.h (bfd_pef_scan): Update prototype. * xsym.c: Formatting, K&R fixes. (bfd_sym_object_p): Use bfd_preserve_save/restore/finish. (bfd_sym_scan): New function split out from bfd_sym_object_p. * xsym.h (bfd_sym_scan): Declare. * elfcode.h (elf_object_p): Use bfd_preserve_save/restore/finish. (elf_core_file_p): Likewise. * targets.c (_bfd_target_vector): Revert 2002-11-08 change.
This commit is contained in:
parent
c4c4121963
commit
e84d6fca26
@ -1,3 +1,30 @@
|
||||
2002-11-13 Klee Dienes <kdienes@apple.com>
|
||||
Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* bfd.c (struct bfd_preserve): New.
|
||||
(bfd_preserve_save): New function.
|
||||
(bfd_preserve_restore): Ditto.
|
||||
(bfd_preserve_finish): Ditto.
|
||||
* bfd-in2.h: Regenerate.
|
||||
* mach-o.c: Formatting.
|
||||
(bfd_mach_o_scan_read_symtab_symbol): Make "value" unsigned.
|
||||
(bfd_mach_o_object_p): Use bfd_preserve_save/restore/finish.
|
||||
(bfd_mach_o_core_p): Ditto.
|
||||
(bfd_mach_o_scan): Pass in mdata.
|
||||
* mach-o.h (bfd_mach_o_scan): Update prototype.
|
||||
* pef.c: Formatting.
|
||||
(bfd_pef_object_p): Use bfd_preserve_save/restore/finish.
|
||||
(bfd_pef_xlib_object_p): Ditto.
|
||||
(bfd_pef_scan): Pass in mdata. Move version check to bfd_pef_object_p.
|
||||
* pef.h (bfd_pef_scan): Update prototype.
|
||||
* xsym.c: Formatting, K&R fixes.
|
||||
(bfd_sym_object_p): Use bfd_preserve_save/restore/finish.
|
||||
(bfd_sym_scan): New function split out from bfd_sym_object_p.
|
||||
* xsym.h (bfd_sym_scan): Declare.
|
||||
* elfcode.h (elf_object_p): Use bfd_preserve_save/restore/finish.
|
||||
(elf_core_file_p): Likewise.
|
||||
* targets.c (_bfd_target_vector): Revert 2002-11-08 change.
|
||||
|
||||
2002-11-12 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* po/da.po: Updated Danish translation.
|
||||
|
@ -3739,6 +3739,27 @@ extern bfd_byte *bfd_get_relocated_section_contents
|
||||
boolean
|
||||
bfd_alt_mach_code PARAMS ((bfd *abfd, int alternative));
|
||||
|
||||
struct bfd_preserve
|
||||
{
|
||||
PTR marker;
|
||||
PTR tdata;
|
||||
flagword flags;
|
||||
const struct bfd_arch_info *arch_info;
|
||||
struct sec *sections;
|
||||
struct sec **section_tail;
|
||||
unsigned int section_count;
|
||||
struct bfd_hash_table section_htab;
|
||||
};
|
||||
|
||||
boolean
|
||||
bfd_preserve_save PARAMS ((bfd *, struct bfd_preserve *));
|
||||
|
||||
void
|
||||
bfd_preserve_restore PARAMS ((bfd *, struct bfd_preserve *));
|
||||
|
||||
void
|
||||
bfd_preserve_finish PARAMS ((bfd *, struct bfd_preserve *));
|
||||
|
||||
/* Extracted from archive.c. */
|
||||
symindex
|
||||
bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym));
|
||||
|
130
bfd/bfd.c
130
bfd/bfd.c
@ -1392,3 +1392,133 @@ bfd_alt_mach_code (abfd, alternative)
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
CODE_FRAGMENT
|
||||
|
||||
.struct bfd_preserve
|
||||
.{
|
||||
. PTR marker;
|
||||
. PTR tdata;
|
||||
. flagword flags;
|
||||
. const struct bfd_arch_info *arch_info;
|
||||
. struct sec *sections;
|
||||
. struct sec **section_tail;
|
||||
. unsigned int section_count;
|
||||
. struct bfd_hash_table section_htab;
|
||||
.};
|
||||
.
|
||||
*/
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
bfd_preserve_save
|
||||
|
||||
SYNOPSIS
|
||||
boolean bfd_preserve_save (bfd *, struct bfd_preserve *);
|
||||
|
||||
DESCRIPTION
|
||||
When testing an object for compatibility with a particular
|
||||
target back-end, the back-end object_p function needs to set
|
||||
up certain fields in the bfd on successfully recognizing the
|
||||
object. This typically happens in a piecemeal fashion, with
|
||||
failures possible at many points. On failure, the bfd is
|
||||
supposed to be restored to its initial state, which is
|
||||
virtually impossible. However, restoring a subset of the bfd
|
||||
state works in practice. This function stores the subset and
|
||||
reinitializes the bfd.
|
||||
|
||||
*/
|
||||
|
||||
boolean
|
||||
bfd_preserve_save (abfd, preserve)
|
||||
bfd *abfd;
|
||||
struct bfd_preserve *preserve;
|
||||
{
|
||||
preserve->tdata = abfd->tdata.any;
|
||||
preserve->arch_info = abfd->arch_info;
|
||||
preserve->flags = abfd->flags;
|
||||
|
||||
preserve->sections = abfd->sections;
|
||||
preserve->section_tail = abfd->section_tail;
|
||||
preserve->section_count = abfd->section_count;
|
||||
preserve->section_htab = abfd->section_htab;
|
||||
|
||||
if (! bfd_hash_table_init (&abfd->section_htab, bfd_section_hash_newfunc))
|
||||
return false;
|
||||
|
||||
abfd->tdata.any = NULL;
|
||||
abfd->arch_info = &bfd_default_arch_struct;
|
||||
abfd->flags = 0;
|
||||
|
||||
abfd->sections = NULL;
|
||||
abfd->section_tail = &abfd->sections;
|
||||
abfd->section_count = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
bfd_preserve_restore
|
||||
|
||||
SYNOPSIS
|
||||
void bfd_preserve_restore (bfd *, struct bfd_preserve *);
|
||||
|
||||
DESCRIPTION
|
||||
This function restores bfd state saved by bfd_preserve_save.
|
||||
If MARKER is non-NULL in struct bfd_preserve then that block
|
||||
and all subsequently bfd_alloc'd memory is freed.
|
||||
|
||||
*/
|
||||
|
||||
void
|
||||
bfd_preserve_restore (abfd, preserve)
|
||||
bfd *abfd;
|
||||
struct bfd_preserve *preserve;
|
||||
{
|
||||
bfd_hash_table_free (&abfd->section_htab);
|
||||
|
||||
abfd->tdata.any = preserve->tdata;
|
||||
abfd->arch_info = preserve->arch_info;
|
||||
abfd->flags = preserve->flags;
|
||||
|
||||
abfd->section_htab = preserve->section_htab;
|
||||
abfd->sections = preserve->sections;
|
||||
abfd->section_tail = preserve->section_tail;
|
||||
abfd->section_count = preserve->section_count;
|
||||
|
||||
/* bfd_release frees all memory more recently bfd_alloc'd than
|
||||
its arg, as well as its arg. */
|
||||
if (preserve->marker != NULL)
|
||||
{
|
||||
bfd_release (abfd, preserve->marker);
|
||||
preserve->marker = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
bfd_preserve_finish
|
||||
|
||||
SYNOPSIS
|
||||
void bfd_preserve_finish (bfd *, struct bfd_preserve *);
|
||||
|
||||
DESCRIPTION
|
||||
This function should be called when the bfd state saved by
|
||||
bfd_preserve_save is no longer needed. ie. when the back-end
|
||||
object_p function returns with success.
|
||||
|
||||
*/
|
||||
|
||||
void
|
||||
bfd_preserve_finish (abfd, preserve)
|
||||
bfd *abfd ATTRIBUTE_UNUSED;
|
||||
struct bfd_preserve *preserve;
|
||||
{
|
||||
/* It would be nice to be able to free more memory here, eg. old
|
||||
tdata, but that's not possible since these blocks are sitting
|
||||
inside bfd_alloc'd memory. The section hash is on a separate
|
||||
objalloc. */
|
||||
bfd_hash_table_free (&preserve->section_htab);
|
||||
}
|
||||
|
@ -505,16 +505,6 @@ elf_file_p (x_ehdrp)
|
||||
&& (x_ehdrp->e_ident[EI_MAG3] == ELFMAG3));
|
||||
}
|
||||
|
||||
struct bfd_preserve
|
||||
{
|
||||
const struct bfd_arch_info *arch_info;
|
||||
struct elf_obj_tdata *tdata;
|
||||
struct bfd_hash_table section_htab;
|
||||
struct sec *sections;
|
||||
struct sec **section_tail;
|
||||
unsigned int section_count;
|
||||
};
|
||||
|
||||
/* Check to see if the file associated with ABFD matches the target vector
|
||||
that ABFD points to.
|
||||
|
||||
@ -536,11 +526,10 @@ elf_object_p (abfd)
|
||||
char *shstrtab; /* Internal copy of section header stringtab */
|
||||
struct elf_backend_data *ebd;
|
||||
struct bfd_preserve preserve;
|
||||
struct elf_obj_tdata *new_tdata = NULL;
|
||||
asection *s;
|
||||
bfd_size_type amt;
|
||||
|
||||
preserve.arch_info = abfd->arch_info;
|
||||
preserve.marker = NULL;
|
||||
|
||||
/* Read in the ELF header in external format. */
|
||||
|
||||
@ -584,23 +573,13 @@ elf_object_p (abfd)
|
||||
the tdata pointer in the bfd. */
|
||||
|
||||
amt = sizeof (struct elf_obj_tdata);
|
||||
new_tdata = (struct elf_obj_tdata *) bfd_zalloc (abfd, amt);
|
||||
if (new_tdata == NULL)
|
||||
preserve.marker = bfd_zalloc (abfd, amt);
|
||||
if (preserve.marker == NULL)
|
||||
goto got_no_match;
|
||||
if (!bfd_preserve_save (abfd, &preserve))
|
||||
goto got_no_match;
|
||||
preserve.tdata = elf_tdata (abfd);
|
||||
elf_tdata (abfd) = new_tdata;
|
||||
|
||||
/* Clear section information, since there might be a recognized bfd that
|
||||
we now check if we can replace, and we don't want to append to it. */
|
||||
preserve.sections = abfd->sections;
|
||||
preserve.section_tail = abfd->section_tail;
|
||||
preserve.section_count = abfd->section_count;
|
||||
preserve.section_htab = abfd->section_htab;
|
||||
abfd->sections = NULL;
|
||||
abfd->section_tail = &abfd->sections;
|
||||
abfd->section_count = 0;
|
||||
if (!bfd_hash_table_init (&abfd->section_htab, bfd_section_hash_newfunc))
|
||||
goto got_no_match;
|
||||
elf_tdata (abfd) = preserve.marker;
|
||||
|
||||
/* Now that we know the byte order, swap in the rest of the header */
|
||||
i_ehdrp = elf_elfheader (abfd);
|
||||
@ -633,8 +612,10 @@ elf_object_p (abfd)
|
||||
/* Check that the ELF e_machine field matches what this particular
|
||||
BFD format expects. */
|
||||
if (ebd->elf_machine_code != i_ehdrp->e_machine
|
||||
&& (ebd->elf_machine_alt1 == 0 || i_ehdrp->e_machine != ebd->elf_machine_alt1)
|
||||
&& (ebd->elf_machine_alt2 == 0 || i_ehdrp->e_machine != ebd->elf_machine_alt2))
|
||||
&& (ebd->elf_machine_alt1 == 0
|
||||
|| i_ehdrp->e_machine != ebd->elf_machine_alt1)
|
||||
&& (ebd->elf_machine_alt2 == 0
|
||||
|| i_ehdrp->e_machine != ebd->elf_machine_alt2))
|
||||
{
|
||||
const bfd_target * const *target_ptr;
|
||||
|
||||
@ -844,11 +825,8 @@ elf_object_p (abfd)
|
||||
}
|
||||
}
|
||||
|
||||
/* It would be nice to be able to free more memory here, eg. old
|
||||
elf_elfsections, old tdata, but that's not possible since these
|
||||
blocks are sitting inside obj_alloc'd memory. */
|
||||
bfd_hash_table_free (&preserve.section_htab);
|
||||
return (abfd->xvec);
|
||||
bfd_preserve_finish (abfd, &preserve);
|
||||
return abfd->xvec;
|
||||
|
||||
got_wrong_format_error:
|
||||
/* There is way too much undoing of half-known state here. The caller,
|
||||
@ -864,17 +842,8 @@ elf_object_p (abfd)
|
||||
|
||||
got_no_match:
|
||||
abfd->arch_info = preserve.arch_info;
|
||||
if (new_tdata != NULL)
|
||||
{
|
||||
/* bfd_release frees all memory more recently bfd_alloc'd than
|
||||
its arg, as well as its arg. */
|
||||
bfd_release (abfd, new_tdata);
|
||||
elf_tdata (abfd) = preserve.tdata;
|
||||
abfd->section_htab = preserve.section_htab;
|
||||
abfd->sections = preserve.sections;
|
||||
abfd->section_tail = preserve.section_tail;
|
||||
abfd->section_count = preserve.section_count;
|
||||
}
|
||||
if (preserve.marker != NULL)
|
||||
bfd_preserve_restore (abfd, &preserve);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
198
bfd/mach-o.c
198
bfd/mach-o.c
@ -691,7 +691,7 @@ bfd_mach_o_scan_read_symtab_symbol (abfd, sym, s, i)
|
||||
unsigned char type = -1;
|
||||
unsigned char section = -1;
|
||||
short desc = -1;
|
||||
long value = -1;
|
||||
unsigned long value = -1;
|
||||
unsigned long stroff = -1;
|
||||
unsigned int symtype = -1;
|
||||
|
||||
@ -1374,7 +1374,8 @@ bfd_mach_o_scan_read_segment (abfd, command)
|
||||
{
|
||||
bfd_vma segoff = command->offset + 48 + 8 + (i * 68);
|
||||
|
||||
if (bfd_mach_o_scan_read_section (abfd, &seg->sections[i], segoff) != 0)
|
||||
if (bfd_mach_o_scan_read_section (abfd, &seg->sections[i],
|
||||
segoff) != 0)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -1455,7 +1456,8 @@ bfd_mach_o_scan_read_command (abfd, command)
|
||||
return -1;
|
||||
|
||||
command->type = (bfd_h_get_32 (abfd, buf) & ~BFD_MACH_O_LC_REQ_DYLD);
|
||||
command->type_required = (bfd_h_get_32 (abfd, buf) & BFD_MACH_O_LC_REQ_DYLD) ? 1 : 0;
|
||||
command->type_required = (bfd_h_get_32 (abfd, buf) & BFD_MACH_O_LC_REQ_DYLD
|
||||
? 1 : 0);
|
||||
command->len = bfd_h_get_32 (abfd, buf + 4);
|
||||
|
||||
switch (command->type)
|
||||
@ -1531,20 +1533,24 @@ bfd_mach_o_flatten_sections (abfd)
|
||||
{
|
||||
if (mdata->commands[i].type == BFD_MACH_O_LC_SEGMENT)
|
||||
{
|
||||
bfd_mach_o_segment_command *seg = &mdata->commands[i].command.segment;
|
||||
bfd_mach_o_segment_command *seg;
|
||||
|
||||
seg = &mdata->commands[i].command.segment;
|
||||
mdata->nsects += seg->nsects;
|
||||
}
|
||||
}
|
||||
|
||||
mdata->sections = bfd_alloc (abfd, mdata->nsects * sizeof (bfd_mach_o_section *));
|
||||
mdata->sections = bfd_alloc (abfd,
|
||||
mdata->nsects * sizeof (bfd_mach_o_section *));
|
||||
csect = 0;
|
||||
|
||||
for (i = 0; i < mdata->header.ncmds; i++)
|
||||
{
|
||||
if (mdata->commands[i].type == BFD_MACH_O_LC_SEGMENT)
|
||||
{
|
||||
bfd_mach_o_segment_command *seg = &mdata->commands[i].command.segment;
|
||||
bfd_mach_o_segment_command *seg;
|
||||
|
||||
seg = &mdata->commands[i].command.segment;
|
||||
BFD_ASSERT (csect + seg->nsects <= mdata->nsects);
|
||||
|
||||
for (j = 0; j < seg->nsects; j++)
|
||||
@ -1579,7 +1585,8 @@ bfd_mach_o_scan_start_address (abfd)
|
||||
for (i = 0; i < cmd->nflavours; i++)
|
||||
{
|
||||
if ((mdata->header.cputype == BFD_MACH_O_CPU_TYPE_I386)
|
||||
&& (cmd->flavours[i].flavour == (unsigned long) BFD_MACH_O_i386_THREAD_STATE))
|
||||
&& (cmd->flavours[i].flavour
|
||||
== (unsigned long) BFD_MACH_O_i386_THREAD_STATE))
|
||||
{
|
||||
unsigned char buf[4];
|
||||
|
||||
@ -1608,27 +1615,24 @@ bfd_mach_o_scan_start_address (abfd)
|
||||
}
|
||||
|
||||
int
|
||||
bfd_mach_o_scan (abfd, header)
|
||||
bfd_mach_o_scan (abfd, header, mdata)
|
||||
bfd *abfd;
|
||||
bfd_mach_o_header *header;
|
||||
bfd_mach_o_data_struct *mdata;
|
||||
{
|
||||
unsigned int i;
|
||||
bfd_mach_o_data_struct *mdata = NULL;
|
||||
enum bfd_architecture cputype;
|
||||
unsigned long cpusubtype;
|
||||
|
||||
mdata = ((bfd_mach_o_data_struct *)
|
||||
bfd_alloc (abfd, sizeof (bfd_mach_o_data_struct)));
|
||||
if (mdata == NULL)
|
||||
return -1;
|
||||
|
||||
mdata->header = *header;
|
||||
mdata->symbols = NULL;
|
||||
|
||||
abfd->flags = abfd->xvec->object_flags | (abfd->flags & (BFD_IN_MEMORY | BFD_IO_FUNCS));
|
||||
abfd->flags = (abfd->xvec->object_flags
|
||||
| (abfd->flags & (BFD_IN_MEMORY | BFD_IO_FUNCS)));
|
||||
abfd->tdata.mach_o_data = mdata;
|
||||
|
||||
bfd_mach_o_convert_architecture (header->cputype, header->cpusubtype, &cputype, &cpusubtype);
|
||||
bfd_mach_o_convert_architecture (header->cputype, header->cpusubtype,
|
||||
&cputype, &cpusubtype);
|
||||
if (cputype == bfd_arch_unknown)
|
||||
{
|
||||
fprintf (stderr, "bfd_mach_o_scan: unknown architecture 0x%lx/0x%lx\n",
|
||||
@ -1712,84 +1716,99 @@ const bfd_target *
|
||||
bfd_mach_o_object_p (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
struct bfd_preserve preserve;
|
||||
bfd_mach_o_header header;
|
||||
|
||||
preserve.marker = NULL;
|
||||
if (bfd_mach_o_read_header (abfd, &header) != 0)
|
||||
goto wrong;
|
||||
|
||||
if (! (header.byteorder == BFD_ENDIAN_BIG
|
||||
|| header.byteorder == BFD_ENDIAN_LITTLE))
|
||||
{
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return NULL;
|
||||
fprintf (stderr, "unknown header byte-order value 0x%lx\n",
|
||||
(long) header.byteorder);
|
||||
goto wrong;
|
||||
}
|
||||
|
||||
if (! ((header.byteorder == BFD_ENDIAN_BIG)
|
||||
|| (header.byteorder == BFD_ENDIAN_LITTLE)))
|
||||
{
|
||||
fprintf (stderr, "unknown header byte-order value 0x%lx\n", (long) header.byteorder);
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return NULL;
|
||||
}
|
||||
if (! ((header.byteorder == BFD_ENDIAN_BIG
|
||||
&& abfd->xvec->byteorder == BFD_ENDIAN_BIG
|
||||
&& abfd->xvec->header_byteorder == BFD_ENDIAN_BIG)
|
||||
|| (header.byteorder == BFD_ENDIAN_LITTLE
|
||||
&& abfd->xvec->byteorder == BFD_ENDIAN_LITTLE
|
||||
&& abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE)))
|
||||
goto wrong;
|
||||
|
||||
if (! (((header.byteorder == BFD_ENDIAN_BIG)
|
||||
&& (abfd->xvec->byteorder == BFD_ENDIAN_BIG)
|
||||
&& (abfd->xvec->header_byteorder == BFD_ENDIAN_BIG))
|
||||
||
|
||||
((header.byteorder == BFD_ENDIAN_LITTLE)
|
||||
&& (abfd->xvec->byteorder == BFD_ENDIAN_LITTLE)
|
||||
&& (abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE))))
|
||||
{
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return NULL;
|
||||
}
|
||||
preserve.marker = bfd_zalloc (abfd, sizeof (bfd_mach_o_data_struct));
|
||||
if (preserve.marker == NULL
|
||||
|| !bfd_preserve_save (abfd, &preserve))
|
||||
goto fail;
|
||||
|
||||
abfd->tdata.mach_o_data = NULL;
|
||||
|
||||
if (bfd_mach_o_scan (abfd, &header) != 0)
|
||||
{
|
||||
abfd->tdata.mach_o_data = NULL;
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return NULL;
|
||||
}
|
||||
if (bfd_mach_o_scan (abfd, &header,
|
||||
(bfd_mach_o_data_struct *) preserve.marker) != 0)
|
||||
goto wrong;
|
||||
|
||||
bfd_preserve_finish (abfd, &preserve);
|
||||
return abfd->xvec;
|
||||
|
||||
wrong:
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
|
||||
fail:
|
||||
if (preserve.marker != NULL)
|
||||
bfd_preserve_restore (abfd, &preserve);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const bfd_target *
|
||||
bfd_mach_o_core_p (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
struct bfd_preserve preserve;
|
||||
bfd_mach_o_header header;
|
||||
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
|
||||
preserve.marker = NULL;
|
||||
if (bfd_mach_o_read_header (abfd, &header) != 0)
|
||||
return NULL;
|
||||
goto wrong;
|
||||
|
||||
if (! ((header.byteorder == BFD_ENDIAN_BIG)
|
||||
|| (header.byteorder == BFD_ENDIAN_LITTLE)))
|
||||
if (! (header.byteorder == BFD_ENDIAN_BIG
|
||||
|| header.byteorder == BFD_ENDIAN_LITTLE))
|
||||
{
|
||||
fprintf (stderr, "unknown header byte-order value 0x%lx\n", (long) header.byteorder);
|
||||
fprintf (stderr, "unknown header byte-order value 0x%lx\n",
|
||||
(long) header.byteorder);
|
||||
abort ();
|
||||
}
|
||||
|
||||
if (! (((header.byteorder == BFD_ENDIAN_BIG)
|
||||
&& (abfd->xvec->byteorder == BFD_ENDIAN_BIG)
|
||||
&& (abfd->xvec->header_byteorder == BFD_ENDIAN_BIG))
|
||||
||
|
||||
((header.byteorder == BFD_ENDIAN_LITTLE)
|
||||
&& (abfd->xvec->byteorder == BFD_ENDIAN_LITTLE)
|
||||
&& (abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE))))
|
||||
return NULL;
|
||||
if (! ((header.byteorder == BFD_ENDIAN_BIG
|
||||
&& abfd->xvec->byteorder == BFD_ENDIAN_BIG
|
||||
&& abfd->xvec->header_byteorder == BFD_ENDIAN_BIG)
|
||||
|| (header.byteorder == BFD_ENDIAN_LITTLE
|
||||
&& abfd->xvec->byteorder == BFD_ENDIAN_LITTLE
|
||||
&& abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE)))
|
||||
goto wrong;
|
||||
|
||||
if (header.filetype != BFD_MACH_O_MH_CORE)
|
||||
return NULL;
|
||||
goto wrong;
|
||||
|
||||
abfd->tdata.mach_o_data = NULL;
|
||||
if (bfd_mach_o_scan (abfd, &header) != 0)
|
||||
{
|
||||
abfd->tdata.mach_o_data = NULL;
|
||||
return NULL;
|
||||
}
|
||||
preserve.marker = bfd_zalloc (abfd, sizeof (bfd_mach_o_data_struct));
|
||||
if (preserve.marker == NULL
|
||||
|| !bfd_preserve_save (abfd, &preserve))
|
||||
goto fail;
|
||||
|
||||
if (bfd_mach_o_scan (abfd, &header,
|
||||
(bfd_mach_o_data_struct *) preserve.marker) != 0)
|
||||
goto wrong;
|
||||
|
||||
bfd_preserve_finish (abfd, &preserve);
|
||||
return abfd->xvec;
|
||||
|
||||
wrong:
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
|
||||
fail:
|
||||
if (preserve.marker != NULL)
|
||||
bfd_preserve_restore (abfd, &preserve);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
typedef struct mach_o_fat_archentry
|
||||
@ -1813,35 +1832,35 @@ const bfd_target *
|
||||
bfd_mach_o_archive_p (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
mach_o_fat_data_struct *adata;
|
||||
mach_o_fat_data_struct *adata = NULL;
|
||||
unsigned char buf[20];
|
||||
unsigned long i;
|
||||
|
||||
bfd_seek (abfd, 0, SEEK_SET);
|
||||
if (bfd_bread ((PTR) buf, 8, abfd) != 8)
|
||||
return NULL;
|
||||
goto error;
|
||||
|
||||
adata = (mach_o_fat_data_struct *)
|
||||
bfd_alloc (abfd, sizeof (mach_o_fat_data_struct));
|
||||
if (adata == NULL)
|
||||
return NULL;
|
||||
goto error;
|
||||
|
||||
adata->magic = bfd_getb32 (buf);
|
||||
adata->nfat_arch = bfd_getb32 (buf + 4);
|
||||
if (adata->magic != 0xcafebabe)
|
||||
return NULL;
|
||||
goto error;
|
||||
|
||||
adata->archentries = (mach_o_fat_archentry *)
|
||||
bfd_alloc (abfd, adata->nfat_arch * sizeof (mach_o_fat_archentry));
|
||||
if (adata->archentries == NULL)
|
||||
return NULL;
|
||||
goto error;
|
||||
|
||||
for (i = 0; i < adata->nfat_arch; i++)
|
||||
{
|
||||
bfd_seek (abfd, 8 + 20 * i, SEEK_SET);
|
||||
|
||||
if (bfd_bread ((PTR) buf, 20, abfd) != 20)
|
||||
return NULL;
|
||||
goto error;
|
||||
adata->archentries[i].cputype = bfd_getb32 (buf);
|
||||
adata->archentries[i].cpusubtype = bfd_getb32 (buf + 4);
|
||||
adata->archentries[i].offset = bfd_getb32 (buf + 8);
|
||||
@ -1852,6 +1871,12 @@ bfd_mach_o_archive_p (abfd)
|
||||
|
||||
abfd->tdata.mach_o_fat_data = adata;
|
||||
return abfd->xvec;
|
||||
|
||||
error:
|
||||
if (adata != NULL)
|
||||
bfd_release (abfd, adata);
|
||||
bfd_set_error (bfd_error_wrong_format);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bfd *
|
||||
@ -1859,10 +1884,11 @@ bfd_mach_o_openr_next_archived_file (archive, prev)
|
||||
bfd *archive;
|
||||
bfd *prev;
|
||||
{
|
||||
mach_o_fat_data_struct *adata = (mach_o_fat_data_struct *) archive->tdata.mach_o_fat_data;
|
||||
mach_o_fat_data_struct *adata;
|
||||
mach_o_fat_archentry *entry = NULL;
|
||||
unsigned long i;
|
||||
|
||||
adata = (mach_o_fat_data_struct *) archive->tdata.mach_o_fat_data;
|
||||
BFD_ASSERT (adata != NULL);
|
||||
|
||||
/* Find index of previous entry. */
|
||||
@ -1913,9 +1939,12 @@ bfd_mach_o_openr_next_archived_file (archive, prev)
|
||||
return entry->abfd;
|
||||
}
|
||||
|
||||
int bfd_mach_o_lookup_section
|
||||
(bfd *abfd, asection *section,
|
||||
bfd_mach_o_load_command **mcommand, bfd_mach_o_section **msection)
|
||||
int
|
||||
bfd_mach_o_lookup_section (abfd, section, mcommand, msection)
|
||||
bfd *abfd;
|
||||
asection *section;
|
||||
bfd_mach_o_load_command **mcommand;
|
||||
bfd_mach_o_section **msection;
|
||||
{
|
||||
struct mach_o_data_struct *md = abfd->tdata.mach_o_data;
|
||||
unsigned int i, j, num;
|
||||
@ -1962,9 +1991,10 @@ int bfd_mach_o_lookup_section
|
||||
}
|
||||
|
||||
int
|
||||
bfd_mach_o_lookup_command
|
||||
(bfd *abfd, bfd_mach_o_load_command_type type,
|
||||
bfd_mach_o_load_command **mcommand)
|
||||
bfd_mach_o_lookup_command (abfd, type, mcommand)
|
||||
bfd *abfd;
|
||||
bfd_mach_o_load_command_type type;
|
||||
bfd_mach_o_load_command **mcommand;
|
||||
{
|
||||
struct mach_o_data_struct *md = NULL;
|
||||
bfd_mach_o_load_command *ncmd = NULL;
|
||||
@ -2011,7 +2041,7 @@ bfd_mach_o_stack_addr (type)
|
||||
case BFD_MACH_O_CPU_TYPE_I860:
|
||||
return 0;
|
||||
case BFD_MACH_O_CPU_TYPE_HPPA:
|
||||
return (0xc0000000-0x04000000);
|
||||
return 0xc0000000 - 0x04000000;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@ -2063,8 +2093,9 @@ bfd_mach_o_core_fetch_environment (abfd, rbuf, rlen)
|
||||
|
||||
for (offset = 4; offset <= size; offset += 4)
|
||||
{
|
||||
unsigned long val = *((unsigned long *) (buf + size - offset));
|
||||
unsigned long val;
|
||||
|
||||
val = *((unsigned long *) (buf + size - offset));
|
||||
if (! found_nonnull)
|
||||
{
|
||||
if (val != 0)
|
||||
@ -2072,9 +2103,11 @@ bfd_mach_o_core_fetch_environment (abfd, rbuf, rlen)
|
||||
}
|
||||
else if (val == 0x0)
|
||||
{
|
||||
unsigned long bottom = seg->fileoff + seg->filesize - offset;
|
||||
unsigned long top = seg->fileoff + seg->filesize - 4;
|
||||
unsigned long bottom;
|
||||
unsigned long top;
|
||||
|
||||
bottom = seg->fileoff + seg->filesize - offset;
|
||||
top = seg->fileoff + seg->filesize - 4;
|
||||
*rbuf = bfd_malloc (top - bottom);
|
||||
*rlen = top - bottom;
|
||||
|
||||
@ -2159,4 +2192,3 @@ bfd_mach_o_core_file_matches_executable_p (core_bfd, exec_bfd)
|
||||
#undef TARGET_STRING
|
||||
#undef TARGET_BIG_ENDIAN
|
||||
#undef TARGET_ARCHIVE
|
||||
|
||||
|
32
bfd/mach-o.h
32
bfd/mach-o.h
@ -15,7 +15,7 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _BFD_MACH_O_H_
|
||||
@ -127,13 +127,13 @@ bfd_mach_o_filetype;
|
||||
typedef enum bfd_mach_o_section_type
|
||||
{
|
||||
/* Regular section. */
|
||||
BFD_MACH_O_S_REGULAR = 0x0,
|
||||
BFD_MACH_O_S_REGULAR = 0x0,
|
||||
|
||||
/* Zero fill on demand section. */
|
||||
BFD_MACH_O_S_ZEROFILL = 0x1,
|
||||
|
||||
/* Section with only literal C strings. */
|
||||
BFD_MACH_O_S_CSTRING_LITERALS = 0x2,
|
||||
BFD_MACH_O_S_CSTRING_LITERALS = 0x2,
|
||||
|
||||
/* Section with only 4 byte literals. */
|
||||
BFD_MACH_O_S_4BYTE_LITERALS = 0x3,
|
||||
@ -159,13 +159,13 @@ typedef enum bfd_mach_o_section_type
|
||||
|
||||
/* Section with only non-lazy symbol pointers. */
|
||||
BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS = 0x6,
|
||||
|
||||
|
||||
/* Section with only lazy symbol pointers. */
|
||||
BFD_MACH_O_S_LAZY_SYMBOL_POINTERS = 0x7,
|
||||
|
||||
|
||||
/* Section with only symbol stubs, byte size of stub in the reserved2 field. */
|
||||
BFD_MACH_O_S_SYMBOL_STUBS = 0x8,
|
||||
|
||||
|
||||
/* Section with only function pointers for initialization. */
|
||||
BFD_MACH_O_S_MOD_INIT_FUNC_POINTERS = 0x9
|
||||
}
|
||||
@ -232,7 +232,7 @@ bfd_mach_o_symtab_command;
|
||||
|
||||
/* This is the second set of the symbolic information which is used to support
|
||||
the data structures for the dynamicly link editor.
|
||||
|
||||
|
||||
The original set of symbolic information in the symtab_command which contains
|
||||
the symbol and string tables must also be present when this load command is
|
||||
present. When this load command is present the symbol table is organized
|
||||
@ -242,7 +242,7 @@ bfd_mach_o_symtab_command;
|
||||
undefined external symbols (sorted by name)
|
||||
In this load command there are offsets and counts to each of the three groups
|
||||
of symbols.
|
||||
|
||||
|
||||
This load command contains a the offsets and sizes of the following new
|
||||
symbolic information tables:
|
||||
table of contents
|
||||
@ -258,7 +258,7 @@ bfd_mach_o_symtab_command;
|
||||
module table - the file contains only one module so everything in the
|
||||
file is part of the module.
|
||||
reference symbol table - is the defined and undefined external symbols
|
||||
|
||||
|
||||
For dynamicly linked shared library files this load command also contains
|
||||
offsets and sizes to the pool of relocation entries for all sections
|
||||
separated into two groups:
|
||||
@ -274,11 +274,11 @@ typedef struct bfd_mach_o_dysymtab_command
|
||||
local symbols (further grouped by the module they are from)
|
||||
defined external symbols (further grouped by the module they are from)
|
||||
undefined symbols
|
||||
|
||||
|
||||
The local symbols are used only for debugging. The dynamic binding
|
||||
process may have to use them to indicate to the debugger the local
|
||||
symbols for a module that is being bound.
|
||||
|
||||
|
||||
The last two groups are used by the dynamic binding process to do the
|
||||
binding (indirectly through the module table and the reference symbol
|
||||
table when this is a dynamicly linked shared library file). */
|
||||
@ -368,11 +368,11 @@ typedef struct bfd_mach_o_dysymtab_command
|
||||
unsigned long locreloff; /* Offset to local relocation entries. */
|
||||
unsigned long nlocrel; /* Number of local relocation entries. */
|
||||
}
|
||||
bfd_mach_o_dysymtab_command;
|
||||
bfd_mach_o_dysymtab_command;
|
||||
|
||||
/* An indirect symbol table entry is simply a 32bit index into the symbol table
|
||||
/* An indirect symbol table entry is simply a 32bit index into the symbol table
|
||||
to the symbol that the pointer or stub is refering to. Unless it is for a
|
||||
non-lazy symbol pointer section for a defined symbol which strip(1) as
|
||||
non-lazy symbol pointer section for a defined symbol which strip(1) as
|
||||
removed. In which case it has the value INDIRECT_SYMBOL_LOCAL. If the
|
||||
symbol was also absolute INDIRECT_SYMBOL_ABS is or'ed with that. */
|
||||
|
||||
@ -390,7 +390,7 @@ bfd_mach_o_thread_flavour;
|
||||
typedef struct bfd_mach_o_thread_command
|
||||
{
|
||||
unsigned long nflavours;
|
||||
bfd_mach_o_thread_flavour *flavours;
|
||||
bfd_mach_o_thread_flavour *flavours;
|
||||
asection *section;
|
||||
}
|
||||
bfd_mach_o_thread_command;
|
||||
@ -469,7 +469,7 @@ int bfd_mach_o_scan_read_symtab_strtab PARAMS ((bfd *, bfd_mach
|
||||
int bfd_mach_o_scan_read_symtab_symbols PARAMS ((bfd *, bfd_mach_o_symtab_command *));
|
||||
int bfd_mach_o_scan_read_dysymtab_symbol PARAMS ((bfd *, bfd_mach_o_dysymtab_command *, bfd_mach_o_symtab_command *, asymbol *, unsigned long));
|
||||
int bfd_mach_o_scan_start_address PARAMS ((bfd *));
|
||||
int bfd_mach_o_scan PARAMS ((bfd *, bfd_mach_o_header *));
|
||||
int bfd_mach_o_scan PARAMS ((bfd *, bfd_mach_o_header *, bfd_mach_o_data_struct *));
|
||||
boolean bfd_mach_o_mkobject PARAMS ((bfd *));
|
||||
const bfd_target * bfd_mach_o_object_p PARAMS ((bfd *));
|
||||
const bfd_target * bfd_mach_o_core_p PARAMS ((bfd *));
|
||||
|
@ -15,7 +15,7 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "bfd.h"
|
||||
@ -43,7 +43,7 @@ struct bfd_pef_loader_header
|
||||
long main_section;
|
||||
unsigned long main_offset;
|
||||
long init_section;
|
||||
unsigned long init_offset;
|
||||
unsigned long init_offset;
|
||||
long term_section;
|
||||
unsigned long term_offset;
|
||||
unsigned long imported_library_count;
|
||||
@ -183,4 +183,4 @@ int bfd_pef_parse_imported_library PARAMS ((bfd *, unsigned char *, size_t, bfd
|
||||
int bfd_pef_parse_imported_symbol PARAMS ((bfd *, unsigned char *, size_t, bfd_pef_imported_symbol *));
|
||||
int bfd_pef_scan_section PARAMS ((bfd *, bfd_pef_section *));
|
||||
int bfd_pef_scan_start_address PARAMS ((bfd *));
|
||||
int bfd_pef_scan PARAMS ((bfd *, bfd_pef_header *));
|
||||
int bfd_pef_scan PARAMS ((bfd *, bfd_pef_header *, bfd_pef_data_struct *));
|
||||
|
@ -997,11 +997,8 @@ static const bfd_target * const _bfd_target_vector[] = {
|
||||
&pc532machaout_vec,
|
||||
&pc532netbsd_vec,
|
||||
&pdp11_aout_vec,
|
||||
#if 0
|
||||
/* bfd_pef_object_p and bfd_pef_xlib_object_p are broken. */
|
||||
&pef_vec,
|
||||
&pef_xlib_vec,
|
||||
#endif
|
||||
#if 0
|
||||
/* This has the same magic number as RS/6000. */
|
||||
&pmac_xcoff_vec,
|
||||
@ -1031,10 +1028,7 @@ static const bfd_target * const _bfd_target_vector[] = {
|
||||
&sparclynx_coff_vec,
|
||||
&sparcnetbsd_vec,
|
||||
&sunos_big_vec,
|
||||
#if 0
|
||||
/* bfd_sym_object_p is broken. */
|
||||
&sym_vec,
|
||||
#endif
|
||||
&tic30_aout_vec,
|
||||
&tic30_coff_vec,
|
||||
&tic54x_coff0_beh_vec,
|
||||
|
359
bfd/xsym.c
359
bfd/xsym.c
File diff suppressed because it is too large
Load Diff
62
bfd/xsym.h
62
bfd/xsym.h
@ -15,7 +15,7 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "bfd.h"
|
||||
@ -103,7 +103,7 @@ typedef struct bfd_sym_file_reference bfd_sym_file_reference;
|
||||
/* NAME TABLE (NTE). */
|
||||
|
||||
/* RESOURCES TABLE (RTE)
|
||||
|
||||
|
||||
All code and data is *defined* to reside in a resource. Even A5
|
||||
relative data is defined to reside in a dummy resource of ResType
|
||||
'gbld'. Code always resides in a resource. Because a code/data
|
||||
@ -128,7 +128,7 @@ struct bfd_sym_resources_table_entry
|
||||
typedef struct bfd_sym_resources_table_entry bfd_sym_resources_table_entry;
|
||||
|
||||
/* MODULES TABLE (MTE)
|
||||
|
||||
|
||||
Modules table entries are ordered by their appearance in a resource.
|
||||
(Note that having a single module copied into two resources is not
|
||||
possible). Modules map back to their resource via an index into the
|
||||
@ -159,19 +159,19 @@ struct bfd_sym_modules_table_entry
|
||||
unsigned long mte_ctte_index; /* Types contained in this. */
|
||||
unsigned long mte_csnte_idx_1; /* CSNTE index of mte_snbr_first. */
|
||||
unsigned long mte_csnte_idx_2; /* CSNTE index of mte_snbr_last. */
|
||||
};
|
||||
};
|
||||
typedef struct bfd_sym_modules_table_entry bfd_sym_modules_table_entry;
|
||||
|
||||
/* FILE REFERENCES TABLE (FRTE)
|
||||
|
||||
|
||||
The FILE REFERENCES TABLE maps from source file to module & offset.
|
||||
The table is ordered by increasing file offset. Each new offset
|
||||
references a module.
|
||||
|
||||
|
||||
FRT = FILE_SOURCE_START
|
||||
FILE_SOURCE_INCREMENT*
|
||||
END_OF_LIST.
|
||||
|
||||
|
||||
*** THIS MECHANISM IS VERY SLOW FOR FILE+STATEMENT_NUMBER TO
|
||||
*** MODULE/CODE ADDRESS OPERATIONS. ANOTHER MECHANISM IS
|
||||
*** REQUIRED!! */
|
||||
@ -193,7 +193,7 @@ union bfd_sym_file_references_table_entry
|
||||
unsigned long mod_date;
|
||||
}
|
||||
filename;
|
||||
|
||||
|
||||
struct
|
||||
{
|
||||
/* < FILE_NAME_INDEX. */
|
||||
@ -209,7 +209,7 @@ typedef union bfd_sym_file_references_table_entry bfd_sym_file_references_table_
|
||||
Contained Modules are lists of indices into the modules table. The
|
||||
lists are terminated by an END_OF_LIST index. All entries are of the
|
||||
same size, hence mapping an index into a CMTE list is simple.
|
||||
|
||||
|
||||
CMT = MTE_INDEX* END_OF_LIST. */
|
||||
|
||||
union bfd_sym_contained_modules_table_entry
|
||||
@ -220,7 +220,7 @@ union bfd_sym_contained_modules_table_entry
|
||||
unsigned long type;
|
||||
}
|
||||
generic;
|
||||
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned long mte_index; /* Index into the Modules Table. */
|
||||
@ -231,7 +231,7 @@ union bfd_sym_contained_modules_table_entry
|
||||
typedef union bfd_sym_contained_modules_table_entry bfd_sym_contained_modules_table_entry;
|
||||
|
||||
/* CONTAINED VARIABLES TABLE (CVTE)
|
||||
|
||||
|
||||
Contained Variables map into the module table, file table, name table, and type
|
||||
table. Contained Variables are a contiguous list of source file change record,
|
||||
giving the name of and offset into the source file corresponding to all variables
|
||||
@ -240,25 +240,25 @@ typedef union bfd_sym_contained_modules_table_entry bfd_sym_contained_modules_ta
|
||||
table giving the type of the variable, an increment added to the source file
|
||||
offset giving the start of the implementation of the variable, and a storage
|
||||
class address, giving information on variable's runtime address.
|
||||
|
||||
|
||||
CVT = SOURCE_FILE_CHANGE SYMBOL_INFO* END_OF_LIST.
|
||||
SYMBOL_INFO = SYMBOL_DEFINITION | SOURCE_FILE_CHANGE .
|
||||
|
||||
|
||||
All entries are of the same size, making the fetching of data simple. The
|
||||
variable entries in the list are in ALPHABETICAL ORDER to simplify the display of
|
||||
available variables for several of the debugger's windows. */
|
||||
|
||||
/* 'la_size' determines the variant used below:
|
||||
|
||||
|
||||
== BFD_SYM_CVTE_SCA
|
||||
Traditional STORAGE_CLASS_ADDRESS;
|
||||
|
||||
|
||||
<= BFD_SYM_CVTE_LA_MAX_SIZE
|
||||
That many logical address bytes ("in-situ");
|
||||
|
||||
|
||||
== BFD_SYM_CVTE_BIG_LA
|
||||
Logical address bytes in constant pool, at offset 'big_la'. */
|
||||
|
||||
|
||||
#define BFD_SYM_CVTE_SCA 0 /* Indicate SCA variant of CVTE. */
|
||||
#define BFD_SYM_CVTE_LA_MAX_SIZE 13 /* Max# of logical address bytes in a CVTE. */
|
||||
#define BFD_SYM_CVTE_BIG_LA 127 /* Indicates LA redirection to constant pool. */
|
||||
@ -322,7 +322,7 @@ union bfd_sym_contained_variables_table_entry
|
||||
typedef union bfd_sym_contained_variables_table_entry bfd_sym_contained_variables_table_entry;
|
||||
|
||||
/* CONTAINED STATEMENTS TABLE (CSNTE)
|
||||
|
||||
|
||||
Contained Statements table. This table is similar to the Contained
|
||||
Variables table except that instead of VARIABLE_DEFINITION entries, this
|
||||
module contains STATEMENT_NUMBER_DEFINITION entries. A statement number
|
||||
@ -332,7 +332,7 @@ typedef union bfd_sym_contained_variables_table_entry bfd_sym_contained_variable
|
||||
All entries are of the same size, making the fetching of data simple. The
|
||||
entries in the table are in order of increasing statement number within the
|
||||
source file.
|
||||
|
||||
|
||||
The Contained Statements table is indexed from two places. An MTE contains
|
||||
an index to the first statement number within the module. An FRTE contains
|
||||
an index to the first statement in the table (Possibly. This is slow.) Or
|
||||
@ -367,7 +367,7 @@ union bfd_sym_contained_statements_table_entry
|
||||
typedef union bfd_sym_contained_statements_table_entry bfd_sym_contained_statements_table_entry;
|
||||
|
||||
/* CONTAINED LABELS TABLE (CLTE)
|
||||
|
||||
|
||||
Contained Labels table names those labels local to the module. It is similar
|
||||
to the Contained Statements table. */
|
||||
|
||||
@ -402,7 +402,7 @@ union bfd_sym_contained_labels_table_entry
|
||||
typedef union bfd_sym_contained_labels_table_entry bfd_sym_contained_labels_table_entry;
|
||||
|
||||
/* CONTAINED TYPES TABLE (CTTE)
|
||||
|
||||
|
||||
Contained Types define the named types that are in the module. It is used to
|
||||
map name indices into type indices. The type entries in the table are in
|
||||
alphabetical order by type name. */
|
||||
@ -427,7 +427,7 @@ union bfd_sym_contained_types_table_entry
|
||||
struct
|
||||
{
|
||||
/* < SOURCE_FILE_CHANGE. */
|
||||
unsigned long tte_index;
|
||||
unsigned long tte_index;
|
||||
unsigned long nte_index;
|
||||
unsigned long file_delta; /* From last file definition. */
|
||||
}
|
||||
@ -451,7 +451,7 @@ struct bfd_sym_type_information_table_entry
|
||||
typedef struct bfd_sym_type_information_table_entry bfd_sym_type_information_table_entry;
|
||||
|
||||
/* FILE REFERENCES INDEX TABLE (FITE)
|
||||
|
||||
|
||||
The FRTE INDEX TABLE indexes into the FILE REFERENCE TABLE above. The FRTE
|
||||
at that index is the FILE_SOURCE_START for a series of files. The FRTEs are
|
||||
indexed from 1. The list is terminated with an END_OF_LIST. */
|
||||
@ -463,7 +463,7 @@ union bfd_sym_file_references_index_table_entry
|
||||
unsigned long type;
|
||||
}
|
||||
generic;
|
||||
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned long frte_index; /* Index into the FRTE table. */
|
||||
@ -474,15 +474,15 @@ union bfd_sym_file_references_index_table_entry
|
||||
typedef union bfd_sym_file_references_index_table_entry bfd_sym_file_references_index_table_entry;
|
||||
|
||||
/* CONSTANT POOL (CONST)
|
||||
|
||||
|
||||
The CONSTANT_POOL consists of entries that start on word boundaries. The entries
|
||||
are referenced by byte index into the constant pool, not by record number.
|
||||
|
||||
|
||||
Each entry takes the form:
|
||||
|
||||
|
||||
<16-bit size>
|
||||
<that many bytes of stuff>
|
||||
|
||||
|
||||
Entries do not cross page boundaries. */
|
||||
|
||||
typedef short bfd_sym_constant_pool_entry;
|
||||
@ -493,7 +493,7 @@ typedef short bfd_sym_constant_pool_entry;
|
||||
allocations. For the purposes of paging, the * file is considered
|
||||
to be an array of dshb_page_size blocks, with block 0 (and *
|
||||
possibly more) devoted to the DISK_SYMBOL_HEADER_BLOCK.
|
||||
|
||||
|
||||
The dti_object_count field means that the allowed indices for that
|
||||
type of object are 0 .. dti_object_count. An index of 0, although
|
||||
allowed, is never done. However, an 0th entry is created in the
|
||||
@ -510,7 +510,7 @@ struct bfd_sym_table_info
|
||||
};
|
||||
typedef struct bfd_sym_table_info bfd_sym_table_info;
|
||||
|
||||
struct bfd_sym_header_block
|
||||
struct bfd_sym_header_block
|
||||
{
|
||||
unsigned char dshb_id[32]; /* Version information. */
|
||||
unsigned short dshb_page_size; /* Size of the pages/blocks. */
|
||||
@ -683,6 +683,8 @@ extern void bfd_sym_display_constant_pool
|
||||
PARAMS ((bfd *, FILE *));
|
||||
extern void bfd_sym_display_type_information_table
|
||||
PARAMS ((bfd *, FILE *));
|
||||
extern int bfd_sym_scan
|
||||
PARAMS ((bfd *, bfd_sym_version, bfd_sym_data_struct *));
|
||||
extern const bfd_target * bfd_sym_object_p
|
||||
PARAMS ((bfd *));
|
||||
extern asymbol * bfd_sym_make_empty_symbol
|
||||
|
Loading…
Reference in New Issue
Block a user