* libbfd.c: Add signed versions of bfd_{h_,}{get,put}_signed_<size>.
libbfd.c, libbfd-in.h: Add _do*signed*. targets.c, all targets: Add bfd*signed*. bfd-in.h: Add bfd_signed_vma. Add comments.
This commit is contained in:
parent
5aefc1ca23
commit
14e3c2e47d
|
@ -1,5 +1,10 @@
|
||||||
Thu Apr 15 09:09:18 1993 Jim Kingdon (kingdon@cygnus.com)
|
Thu Apr 15 09:09:18 1993 Jim Kingdon (kingdon@cygnus.com)
|
||||||
|
|
||||||
|
* libbfd.c: Add signed versions of bfd_{h_,}{get,put}_signed_<size>.
|
||||||
|
libbfd.c, libbfd-in.h: Add _do*signed*.
|
||||||
|
targets.c, all targets: Add bfd*signed*.
|
||||||
|
bfd-in.h: Add bfd_signed_vma. Add comments.
|
||||||
|
|
||||||
* bfd-in.h (bfd_error), bfd.c (bfd_errmsgs): Add file_truncated.
|
* bfd-in.h (bfd_error), bfd.c (bfd_errmsgs): Add file_truncated.
|
||||||
|
|
||||||
* format.c (bfd_check_error): Check error return from
|
* format.c (bfd_check_error): Check error return from
|
||||||
|
|
29
bfd/bfd-in.h
29
bfd/bfd-in.h
|
@ -68,20 +68,37 @@ typedef enum bfd_boolean {false, true} boolean;
|
||||||
/* typedef off_t file_ptr; */
|
/* typedef off_t file_ptr; */
|
||||||
typedef long int file_ptr;
|
typedef long int file_ptr;
|
||||||
|
|
||||||
/* Support for different sizes of target format ints and addresses */
|
/* Support for different sizes of target format ints and addresses.
|
||||||
|
If the host implements--and wants BFD to use--64-bit values, it
|
||||||
|
defines HOST_64_BIT (in BFD and in every program that calls it --
|
||||||
|
since this affects declarations in bfd.h). */
|
||||||
|
|
||||||
#ifdef HOST_64_BIT
|
#ifdef HOST_64_BIT
|
||||||
typedef HOST_64_BIT bfd_vma;
|
typedef unsigned HOST_64_BIT bfd_vma;
|
||||||
typedef HOST_64_BIT bfd_size_type;
|
typedef HOST_64_BIT bfd_signed_vma;
|
||||||
typedef HOST_64_BIT symvalue;
|
typedef unsigned HOST_64_BIT bfd_size_type;
|
||||||
|
typedef unsigned HOST_64_BIT symvalue;
|
||||||
#define fprintf_vma(s,x) \
|
#define fprintf_vma(s,x) \
|
||||||
fprintf(s,"%08x%08x", uint64_typeHIGH(x), uint64_typeLOW(x))
|
fprintf(s,"%08x%08x", uint64_typeHIGH(x), uint64_typeLOW(x))
|
||||||
#else
|
#else /* not HOST_64_BIT. */
|
||||||
|
|
||||||
|
/* Represent a target address. Also used as a generic unsigned type
|
||||||
|
which is guaranteed to be big enough to hold any arithmetic types
|
||||||
|
we need to deal with. */
|
||||||
typedef unsigned long bfd_vma;
|
typedef unsigned long bfd_vma;
|
||||||
|
|
||||||
|
/* A generic signed type which is guaranteed to be big enough to hold any
|
||||||
|
arithmetic types we need to deal with. Can be assumed to be compatible
|
||||||
|
with bfd_vma in the same way that signed and unsigned ints are compatible
|
||||||
|
(as parameters, in assignment, etc). */
|
||||||
|
typedef long bfd_signed_vma;
|
||||||
|
|
||||||
typedef unsigned long symvalue;
|
typedef unsigned long symvalue;
|
||||||
typedef unsigned long bfd_size_type;
|
typedef unsigned long bfd_size_type;
|
||||||
|
|
||||||
|
/* Print a bfd_vma x on stream s. */
|
||||||
#define fprintf_vma(s,x) fprintf(s, "%08lx", x)
|
#define fprintf_vma(s,x) fprintf(s, "%08lx", x)
|
||||||
#endif
|
#endif /* not HOST_64_BIT. */
|
||||||
#define printf_vma(x) fprintf_vma(stdout,x)
|
#define printf_vma(x) fprintf_vma(stdout,x)
|
||||||
|
|
||||||
typedef unsigned int flagword; /* 32 bits of flags */
|
typedef unsigned int flagword; /* 32 bits of flags */
|
||||||
|
|
|
@ -307,11 +307,13 @@ bfd_target a29kcoff_big_vec =
|
||||||
15, /* ar_max_namelen */
|
15, /* ar_max_namelen */
|
||||||
2, /* minimum section alignment */
|
2, /* minimum section alignment */
|
||||||
/* data */
|
/* data */
|
||||||
_do_getb64, _do_putb64, _do_getb32,
|
_do_getb64, _do_getb_signed_64, _do_putb64,
|
||||||
_do_putb32, _do_getb16, _do_putb16,
|
_do_getb32, _do_getb_signed_32, _do_putb32,
|
||||||
|
_do_getb16, _do_getb_signed_16, _do_putb16,
|
||||||
/* hdrs */
|
/* hdrs */
|
||||||
_do_getb64, _do_putb64, _do_getb32,
|
_do_getb64, _do_getb_signed_64, _do_putb64,
|
||||||
_do_putb32, _do_getb16, _do_putb16,
|
_do_getb32, _do_getb_signed_32, _do_putb32,
|
||||||
|
_do_getb16, _do_getb_signed_16, _do_putb16,
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ typedef struct ecoff_symbol_struct
|
||||||
#define ecoffsymbol(asymbol) ((ecoff_symbol_type *) (&((asymbol)->the_bfd)))
|
#define ecoffsymbol(asymbol) ((ecoff_symbol_type *) (&((asymbol)->the_bfd)))
|
||||||
|
|
||||||
/* The page boundary used to align sections in the executable file. */
|
/* The page boundary used to align sections in the executable file. */
|
||||||
#define PAGE_SIZE 0x2000
|
#define ROUND_SIZE 0x1000
|
||||||
|
|
||||||
/* The linker needs a section to hold small common variables while
|
/* The linker needs a section to hold small common variables while
|
||||||
linking. There is no convenient way to create it when the linker
|
linking. There is no convenient way to create it when the linker
|
||||||
|
@ -2174,8 +2174,11 @@ ecoff_find_nearest_line (abfd,
|
||||||
pdr_ptr = ecoff_data (abfd)->external_pdr + fdr_ptr->ipdFirst;
|
pdr_ptr = ecoff_data (abfd)->external_pdr + fdr_ptr->ipdFirst;
|
||||||
pdr_end = pdr_ptr + fdr_ptr->cpd;
|
pdr_end = pdr_ptr + fdr_ptr->cpd;
|
||||||
ecoff_swap_pdr_in (abfd, pdr_ptr, &pdr);
|
ecoff_swap_pdr_in (abfd, pdr_ptr, &pdr);
|
||||||
if (offset < pdr.adr)
|
|
||||||
return false;
|
/* The address of the first PDR is an offset which applies to the
|
||||||
|
addresses of all the PDR's. */
|
||||||
|
offset += pdr.adr;
|
||||||
|
|
||||||
for (pdr_ptr++; pdr_ptr < pdr_end; pdr_ptr++)
|
for (pdr_ptr++; pdr_ptr < pdr_end; pdr_ptr++)
|
||||||
{
|
{
|
||||||
ecoff_swap_pdr_in (abfd, pdr_ptr, &pdr);
|
ecoff_swap_pdr_in (abfd, pdr_ptr, &pdr);
|
||||||
|
@ -3188,7 +3191,7 @@ ecoff_compute_section_file_positions (abfd)
|
||||||
&& first_data != false
|
&& first_data != false
|
||||||
&& (current->flags & SEC_CODE) == 0)
|
&& (current->flags & SEC_CODE) == 0)
|
||||||
{
|
{
|
||||||
sofar = (sofar + PAGE_SIZE - 1) &~ (PAGE_SIZE - 1);
|
sofar = (sofar + ROUND_SIZE - 1) &~ (ROUND_SIZE - 1);
|
||||||
first_data = false;
|
first_data = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3292,7 +3295,7 @@ ecoff_write_object_contents (abfd)
|
||||||
be aligned to a page boundary. FIXME: Is this true on other
|
be aligned to a page boundary. FIXME: Is this true on other
|
||||||
platforms? */
|
platforms? */
|
||||||
if ((abfd->flags & EXEC_P) != 0)
|
if ((abfd->flags & EXEC_P) != 0)
|
||||||
sym_base = (sym_base + PAGE_SIZE - 1) &~ (PAGE_SIZE - 1);
|
sym_base = (sym_base + ROUND_SIZE - 1) &~ (ROUND_SIZE - 1);
|
||||||
|
|
||||||
ecoff_data (abfd)->sym_filepos = sym_base;
|
ecoff_data (abfd)->sym_filepos = sym_base;
|
||||||
|
|
||||||
|
@ -3440,10 +3443,10 @@ ecoff_write_object_contents (abfd)
|
||||||
|
|
||||||
/* At least on Ultrix, these have to be rounded to page boundaries.
|
/* At least on Ultrix, these have to be rounded to page boundaries.
|
||||||
FIXME: Is this true on other platforms? */
|
FIXME: Is this true on other platforms? */
|
||||||
internal_a.tsize = (text_size + PAGE_SIZE - 1) &~ (PAGE_SIZE - 1);
|
internal_a.tsize = (text_size + ROUND_SIZE - 1) &~ (ROUND_SIZE - 1);
|
||||||
internal_a.text_start = text_start &~ (PAGE_SIZE - 1);
|
internal_a.text_start = text_start &~ (ROUND_SIZE - 1);
|
||||||
internal_a.dsize = (data_size + PAGE_SIZE - 1) &~ (PAGE_SIZE - 1);
|
internal_a.dsize = (data_size + ROUND_SIZE - 1) &~ (ROUND_SIZE - 1);
|
||||||
internal_a.data_start = data_start &~ (PAGE_SIZE - 1);
|
internal_a.data_start = data_start &~ (ROUND_SIZE - 1);
|
||||||
|
|
||||||
/* On Ultrix, the initial portions of the .sbss and .bss segments
|
/* On Ultrix, the initial portions of the .sbss and .bss segments
|
||||||
are at the end of the data section. The bsize field in the
|
are at the end of the data section. The bsize field in the
|
||||||
|
@ -4123,8 +4126,12 @@ bfd_target ecoff_little_vec =
|
||||||
'/', /* ar_pad_char */
|
'/', /* ar_pad_char */
|
||||||
15, /* ar_max_namelen */
|
15, /* ar_max_namelen */
|
||||||
3, /* minimum alignment power */
|
3, /* minimum alignment power */
|
||||||
_do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* data */
|
_do_getl64, _do_getl_signed_64, _do_putl64,
|
||||||
_do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16, /* hdrs */
|
_do_getl32, _do_getl_signed_32, _do_putl32,
|
||||||
|
_do_getl16, _do_getl_signed_16, _do_putl16, /* data */
|
||||||
|
_do_getl64, _do_getl_signed_64, _do_putl64,
|
||||||
|
_do_getl32, _do_getl_signed_32, _do_putl32,
|
||||||
|
_do_getl16, _do_getl_signed_16, _do_putl16, /* hdrs */
|
||||||
|
|
||||||
{_bfd_dummy_target, coff_object_p, /* bfd_check_format */
|
{_bfd_dummy_target, coff_object_p, /* bfd_check_format */
|
||||||
ecoff_archive_p, _bfd_dummy_target},
|
ecoff_archive_p, _bfd_dummy_target},
|
||||||
|
@ -4152,8 +4159,12 @@ bfd_target ecoff_big_vec =
|
||||||
' ', /* ar_pad_char */
|
' ', /* ar_pad_char */
|
||||||
16, /* ar_max_namelen */
|
16, /* ar_max_namelen */
|
||||||
3, /* minimum alignment power */
|
3, /* minimum alignment power */
|
||||||
_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16,
|
_do_getb64, _do_getb_signed_64, _do_putb64,
|
||||||
_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16,
|
_do_getb32, _do_getb_signed_32, _do_putb32,
|
||||||
|
_do_getb16, _do_getb_signed_16, _do_putb16,
|
||||||
|
_do_getb64, _do_getb_signed_64, _do_putb64,
|
||||||
|
_do_getb32, _do_getb_signed_32, _do_putb32,
|
||||||
|
_do_getb16, _do_getb_signed_16, _do_putb16,
|
||||||
{_bfd_dummy_target, coff_object_p, /* bfd_check_format */
|
{_bfd_dummy_target, coff_object_p, /* bfd_check_format */
|
||||||
ecoff_archive_p, _bfd_dummy_target},
|
ecoff_archive_p, _bfd_dummy_target},
|
||||||
{bfd_false, ecoff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
|
{bfd_false, ecoff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
|
||||||
|
|
|
@ -98,10 +98,14 @@ bfd_target TARGET_BIG_SYM =
|
||||||
3,
|
3,
|
||||||
|
|
||||||
/* Routines to byte-swap various sized integers from the data sections */
|
/* Routines to byte-swap various sized integers from the data sections */
|
||||||
_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16,
|
_do_getb64, _do_getb_signed_64, _do_putb64,
|
||||||
|
_do_getb32, _do_getb_signed_32, _do_putb32,
|
||||||
|
_do_getb16, _do_getb_signed_16, _do_putb16,
|
||||||
|
|
||||||
/* Routines to byte-swap various sized integers from the file headers */
|
/* Routines to byte-swap various sized integers from the file headers */
|
||||||
_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16,
|
_do_getb64, _do_getb_signed_64, _do_putb64,
|
||||||
|
_do_getb32, _do_getb_signed_32, _do_putb32,
|
||||||
|
_do_getb16, _do_getb_signed_16, _do_putb16,
|
||||||
|
|
||||||
/* bfd_check_format: check the format of a file being read */
|
/* bfd_check_format: check the format of a file being read */
|
||||||
{ _bfd_dummy_target, /* unknown format */
|
{ _bfd_dummy_target, /* unknown format */
|
||||||
|
@ -176,10 +180,14 @@ bfd_target TARGET_LITTLE_SYM =
|
||||||
3,
|
3,
|
||||||
|
|
||||||
/* Routines to byte-swap various sized integers from the data sections */
|
/* Routines to byte-swap various sized integers from the data sections */
|
||||||
_do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16,
|
_do_getl64, _do_getl_signed_64, _do_putl64,
|
||||||
|
_do_getl32, _do_getl_signed_32, _do_putl32,
|
||||||
|
_do_getl16, _do_getl_signed_16, _do_putl16,
|
||||||
|
|
||||||
/* Routines to byte-swap various sized integers from the file headers */
|
/* Routines to byte-swap various sized integers from the file headers */
|
||||||
_do_getl64, _do_putl64, _do_getl32, _do_putl32, _do_getl16, _do_putl16,
|
_do_getl64, _do_getl_signed_64, _do_putl64,
|
||||||
|
_do_getl32, _do_getl_signed_32, _do_putl32,
|
||||||
|
_do_getl16, _do_getl_signed_16, _do_putl16,
|
||||||
|
|
||||||
/* bfd_check_format: check the format of a file being read */
|
/* bfd_check_format: check the format of a file being read */
|
||||||
{ _bfd_dummy_target, /* unknown format */
|
{ _bfd_dummy_target, /* unknown format */
|
||||||
|
|
|
@ -666,8 +666,12 @@ bfd_target hppa_vec =
|
||||||
' ', /* ar_pad_char */
|
' ', /* ar_pad_char */
|
||||||
16, /* ar_max_namelen */
|
16, /* ar_max_namelen */
|
||||||
3, /* minimum alignment */
|
3, /* minimum alignment */
|
||||||
_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* data */
|
_do_getb64, _do_getb_signed_64, _do_putb64,
|
||||||
_do_getb64, _do_putb64, _do_getb32, _do_putb32, _do_getb16, _do_putb16, /* hdrs */
|
_do_getb32, _do_getb_signed_32, _do_putb32,
|
||||||
|
_do_getb16, _do_getb_signed_16, _do_putb16, /* data */
|
||||||
|
_do_getb64, _do_getb_signed_64, _do_putb64,
|
||||||
|
_do_getb32, _do_getb_signed_32, _do_putb32,
|
||||||
|
_do_getb16, _do_getb_signed_16, _do_putb16, /* hdrs */
|
||||||
{ _bfd_dummy_target,
|
{ _bfd_dummy_target,
|
||||||
hppa_object_p, /* bfd_check_format */
|
hppa_object_p, /* bfd_check_format */
|
||||||
bfd_generic_archive_p,
|
bfd_generic_archive_p,
|
||||||
|
|
160
bfd/libbfd-in.h
160
bfd/libbfd-in.h
|
@ -1,6 +1,6 @@
|
||||||
/* libbfd.h -- Declarations used by bfd library *implementation*.
|
/* libbfd.h -- Declarations used by bfd library *implementation*.
|
||||||
(This include file is not for users of the library.)
|
(This include file is not for users of the library.)
|
||||||
Copyright 1990, 1991 Free Software Foundation, Inc.
|
Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||||
Written by Cygnus Support.
|
Written by Cygnus Support.
|
||||||
|
|
||||||
This file is part of BFD, the Binary File Descriptor library.
|
This file is part of BFD, the Binary File Descriptor library.
|
||||||
|
@ -31,7 +31,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
/* Set a tdata field. Can't use the other macros for this, since they
|
/* Set a tdata field. Can't use the other macros for this, since they
|
||||||
do casts, and casting to the left of assignment isn't portable. */
|
do casts, and casting to the left of assignment isn't portable. */
|
||||||
#define set_tdata(bfd, v) ((bfd)->tdata = (PTR) (v))
|
#define set_tdata(bfd, v) ((bfd)->tdata.any = (PTR) (v))
|
||||||
|
|
||||||
/* tdata for an archive. For an input archive, cache
|
/* tdata for an archive. For an input archive, cache
|
||||||
needs to be free()'d. For an output archive, symdefs do. */
|
needs to be free()'d. For an output archive, symdefs do. */
|
||||||
|
@ -46,7 +46,7 @@ struct artdata {
|
||||||
char *extended_names; /* clever intel extension */
|
char *extended_names; /* clever intel extension */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define bfd_ardata(bfd) ((struct artdata *) ((bfd)->tdata))
|
#define bfd_ardata(bfd) ((bfd)->tdata.aout_ar_data)
|
||||||
|
|
||||||
/* Goes in bfd's arelt_data slot */
|
/* Goes in bfd's arelt_data slot */
|
||||||
struct areltdata {
|
struct areltdata {
|
||||||
|
@ -57,98 +57,103 @@ struct areltdata {
|
||||||
|
|
||||||
#define arelt_size(bfd) (((struct areltdata *)((bfd)->arelt_data))->parsed_size)
|
#define arelt_size(bfd) (((struct areltdata *)((bfd)->arelt_data))->parsed_size)
|
||||||
|
|
||||||
/* FIXME -- a lot of my code allocates a large block and subdivides it.
|
char *zalloc PARAMS ((bfd_size_type size));
|
||||||
This can't always work, because of alignment restrictions. We should change
|
|
||||||
it before it becomes a problem -- Gumby */
|
|
||||||
|
|
||||||
PROTO (char *, zalloc, (bfd_size_type size));
|
|
||||||
|
|
||||||
/* These routines allocate and free things on the BFD's obstack. Note
|
/* These routines allocate and free things on the BFD's obstack. Note
|
||||||
that realloc can never occur in place. */
|
that realloc can never occur in place. */
|
||||||
|
|
||||||
PROTO(PTR, bfd_alloc, (bfd *abfd, bfd_size_type size));
|
PTR bfd_alloc PARAMS ((bfd *abfd, bfd_size_type size));
|
||||||
PROTO(PTR, bfd_zalloc,(bfd *abfd, bfd_size_type size));
|
PTR bfd_zalloc PARAMS ((bfd *abfd, bfd_size_type size));
|
||||||
PROTO(PTR, bfd_realloc,(bfd *abfd, PTR orig, bfd_size_type new));
|
PTR bfd_realloc PARAMS ((bfd *abfd, PTR orig, bfd_size_type new));
|
||||||
PROTO(void, bfd_alloc_grow,(bfd *abfd, PTR thing, bfd_size_type size));
|
void bfd_alloc_grow PARAMS ((bfd *abfd, PTR thing, bfd_size_type size));
|
||||||
PROTO(PTR, bfd_alloc_finish,(bfd *abfd));
|
PTR bfd_alloc_finish PARAMS ((bfd *abfd));
|
||||||
|
PTR bfd_alloc_by_size_t PARAMS ((bfd *abfd, size_t wanted));
|
||||||
|
|
||||||
#define bfd_release(x,y) (void) obstack_free(&(x->memory),y)
|
#define bfd_release(x,y) (void) obstack_free(&(x->memory),y)
|
||||||
|
|
||||||
|
|
||||||
PROTO (bfd_size_type, bfd_read, (PTR ptr, bfd_size_type size, bfd_size_type nitems, bfd *abfd));
|
bfd_size_type bfd_read PARAMS ((PTR ptr, bfd_size_type size,
|
||||||
PROTO (bfd_size_type, bfd_write, (CONST PTR ptr, bfd_size_type size, bfd_size_type nitems, bfd *abfd));
|
bfd_size_type nitems, bfd *abfd));
|
||||||
|
bfd_size_type bfd_write PARAMS ((CONST PTR ptr, bfd_size_type size,
|
||||||
|
bfd_size_type nitems, bfd *abfd));
|
||||||
|
int bfd_seek PARAMS ((bfd* CONST abfd, CONST file_ptr fp,
|
||||||
|
CONST int direction));
|
||||||
|
long bfd_tell PARAMS ((bfd *abfd));
|
||||||
|
|
||||||
|
bfd * _bfd_create_empty_archive_element_shell PARAMS ((bfd *obfd));
|
||||||
|
bfd * look_for_bfd_in_cache PARAMS ((bfd *arch_bfd, file_ptr index));
|
||||||
PROTO (int, bfd_seek,(bfd* abfd, file_ptr fp , int direction));
|
boolean _bfd_generic_mkarchive PARAMS ((bfd *abfd));
|
||||||
PROTO (long, bfd_tell, (bfd *abfd));
|
struct areltdata * snarf_ar_hdr PARAMS ((bfd *abfd));
|
||||||
PROTO (bfd *, _bfd_create_empty_archive_element_shell, (bfd *obfd));
|
bfd_target * bfd_generic_archive_p PARAMS ((bfd *abfd));
|
||||||
PROTO (bfd *, look_for_bfd_in_cache, (bfd *arch_bfd, file_ptr index));
|
boolean bfd_slurp_armap PARAMS ((bfd *abfd));
|
||||||
PROTO (boolean, _bfd_generic_mkarchive, (bfd *abfd));
|
#define bfd_slurp_bsd_armap bfd_slurp_armap
|
||||||
PROTO (struct areltdata *, snarf_ar_hdr, (bfd *abfd));
|
#define bfd_slurp_coff_armap bfd_slurp_armap
|
||||||
PROTO (bfd_target *, bfd_generic_archive_p, (bfd *abfd));
|
boolean _bfd_slurp_extended_name_table PARAMS ((bfd *abfd));
|
||||||
PROTO (boolean, bfd_slurp_bsd_armap, (bfd *abfd));
|
boolean _bfd_write_archive_contents PARAMS ((bfd *abfd));
|
||||||
PROTO (boolean, bfd_slurp_coff_armap, (bfd *abfd));
|
bfd * new_bfd PARAMS (());
|
||||||
PROTO (boolean, _bfd_slurp_extended_name_table, (bfd *abfd));
|
|
||||||
PROTO (boolean, _bfd_write_archive_contents, (bfd *abfd));
|
|
||||||
PROTO (bfd *, new_bfd, ());
|
|
||||||
|
|
||||||
#define DEFAULT_STRING_SPACE_SIZE 0x2000
|
#define DEFAULT_STRING_SPACE_SIZE 0x2000
|
||||||
PROTO (boolean, bfd_add_to_string_table, (char **table, char *new_string,
|
boolean bfd_add_to_string_table PARAMS ((char **table, char *new_string,
|
||||||
unsigned int *table_length,
|
unsigned int *table_length,
|
||||||
char **free_ptr));
|
char **free_ptr));
|
||||||
PROTO (bfd_vma, _do_getb64, (unsigned char *addr));
|
bfd_vma _do_getb64 PARAMS ((unsigned char *addr));
|
||||||
PROTO (bfd_vma, _do_getl64, (unsigned char *addr));
|
bfd_vma _do_getl64 PARAMS ((unsigned char *addr));
|
||||||
PROTO (bfd_vma, _do_getb32, (unsigned char *addr));
|
bfd_signed_vma _do_getb_signed_64 PARAMS ((unsigned char *addr));
|
||||||
PROTO (bfd_vma, _do_getl32, (unsigned char *addr));
|
bfd_signed_vma _do_getl_signed_64 PARAMS ((unsigned char *addr));
|
||||||
PROTO (bfd_vma, _do_getb16, (unsigned char *addr));
|
bfd_vma _do_getb32 PARAMS ((unsigned char *addr));
|
||||||
PROTO (bfd_vma, _do_getl16, (unsigned char *addr));
|
bfd_vma _do_getl32 PARAMS ((unsigned char *addr));
|
||||||
PROTO (void, _do_putb64, (bfd_vma data, unsigned char *addr));
|
bfd_signed_vma _do_getb_signed_32 PARAMS ((unsigned char *addr));
|
||||||
PROTO (void, _do_putl64, (bfd_vma data, unsigned char *addr));
|
bfd_signed_vma _do_getl_signed_32 PARAMS ((unsigned char *addr));
|
||||||
PROTO (void, _do_putb32, (bfd_vma data, unsigned char *addr));
|
bfd_vma _do_getb16 PARAMS ((unsigned char *addr));
|
||||||
PROTO (void, _do_putl32, (bfd_vma data, unsigned char *addr));
|
bfd_vma _do_getl16 PARAMS ((unsigned char *addr));
|
||||||
PROTO (void, _do_putb16, (bfd_vma data, unsigned char *addr));
|
bfd_signed_vma _do_getb_signed_16 PARAMS ((unsigned char *addr));
|
||||||
PROTO (void, _do_putl16, (bfd_vma data, unsigned char *addr));
|
bfd_signed_vma _do_getl_signed_16 PARAMS ((unsigned char *addr));
|
||||||
|
void _do_putb64 PARAMS ((bfd_vma data, unsigned char *addr));
|
||||||
|
void _do_putl64 PARAMS ((bfd_vma data, unsigned char *addr));
|
||||||
|
void _do_putb32 PARAMS ((bfd_vma data, unsigned char *addr));
|
||||||
|
void _do_putl32 PARAMS ((bfd_vma data, unsigned char *addr));
|
||||||
|
void _do_putb16 PARAMS ((bfd_vma data, unsigned char *addr));
|
||||||
|
void _do_putl16 PARAMS ((bfd_vma data, unsigned char *addr));
|
||||||
|
|
||||||
PROTO (boolean, bfd_false, (bfd *ignore));
|
boolean bfd_false PARAMS ((bfd *ignore));
|
||||||
PROTO (boolean, bfd_true, (bfd *ignore));
|
boolean bfd_true PARAMS ((bfd *ignore));
|
||||||
PROTO (PTR, bfd_nullvoidptr, (bfd *ignore));
|
PTR bfd_nullvoidptr PARAMS ((bfd *ignore));
|
||||||
PROTO (int, bfd_0, (bfd *ignore));
|
int bfd_0 PARAMS ((bfd *ignore));
|
||||||
PROTO (unsigned int, bfd_0u, (bfd *ignore));
|
unsigned int bfd_0u PARAMS ((bfd *ignore));
|
||||||
PROTO (void, bfd_void, (bfd *ignore));
|
void bfd_void PARAMS ((bfd *ignore));
|
||||||
|
|
||||||
PROTO (bfd *,new_bfd_contained_in,(bfd *));
|
bfd * new_bfd_contained_in PARAMS ((bfd *));
|
||||||
PROTO (boolean, _bfd_dummy_new_section_hook, (bfd *ignore, asection *newsect));
|
boolean _bfd_dummy_new_section_hook PARAMS ((bfd *ignore, asection *newsect));
|
||||||
PROTO (char *, _bfd_dummy_core_file_failing_command, (bfd *abfd));
|
char * _bfd_dummy_core_file_failing_command PARAMS ((bfd *abfd));
|
||||||
PROTO (int, _bfd_dummy_core_file_failing_signal, (bfd *abfd));
|
int _bfd_dummy_core_file_failing_signal PARAMS ((bfd *abfd));
|
||||||
PROTO (boolean, _bfd_dummy_core_file_matches_executable_p, (bfd *core_bfd,
|
boolean _bfd_dummy_core_file_matches_executable_p PARAMS ((bfd *core_bfd,
|
||||||
bfd *exec_bfd));
|
bfd *exec_bfd));
|
||||||
PROTO (bfd_target *, _bfd_dummy_target, (bfd *abfd));
|
bfd_target * _bfd_dummy_target PARAMS ((bfd *abfd));
|
||||||
|
|
||||||
PROTO (void, bfd_dont_truncate_arname, (bfd *abfd, CONST char *filename,
|
void bfd_dont_truncate_arname PARAMS ((bfd *abfd, CONST char *filename,
|
||||||
char *hdr));
|
char *hdr));
|
||||||
PROTO (void, bfd_bsd_truncate_arname, (bfd *abfd, CONST char *filename,
|
void bfd_bsd_truncate_arname PARAMS ((bfd *abfd, CONST char *filename,
|
||||||
char *hdr));
|
char *hdr));
|
||||||
PROTO (void, bfd_gnu_truncate_arname, (bfd *abfd, CONST char *filename,
|
void bfd_gnu_truncate_arname PARAMS ((bfd *abfd, CONST char *filename,
|
||||||
char *hdr));
|
char *hdr));
|
||||||
|
|
||||||
PROTO (boolean, bsd_write_armap, (bfd *arch, unsigned int elength,
|
boolean bsd_write_armap PARAMS ((bfd *arch, unsigned int elength,
|
||||||
struct orl *map, unsigned int orl_count, int stridx));
|
struct orl *map, unsigned int orl_count, int stridx));
|
||||||
|
|
||||||
PROTO (boolean, coff_write_armap, (bfd *arch, unsigned int elength,
|
boolean coff_write_armap PARAMS ((bfd *arch, unsigned int elength,
|
||||||
struct orl *map, unsigned int orl_count, int stridx));
|
struct orl *map, unsigned int orl_count, int stridx));
|
||||||
|
|
||||||
PROTO (bfd *, bfd_generic_openr_next_archived_file, (bfd *archive,
|
bfd * bfd_generic_openr_next_archived_file PARAMS ((bfd *archive,
|
||||||
bfd *last_file));
|
bfd *last_file));
|
||||||
|
|
||||||
PROTO(int, bfd_generic_stat_arch_elt, (bfd *, struct stat *));
|
int bfd_generic_stat_arch_elt PARAMS ((bfd *, struct stat *));
|
||||||
|
|
||||||
PROTO(boolean, bfd_generic_get_section_contents,
|
boolean bfd_generic_get_section_contents PARAMS ((bfd *abfd, sec_ptr section,
|
||||||
(bfd *abfd, sec_ptr section, PTR location, file_ptr offset,
|
PTR location, file_ptr offset,
|
||||||
bfd_size_type count));
|
bfd_size_type count));
|
||||||
|
|
||||||
PROTO(boolean, bfd_generic_set_section_contents,
|
boolean bfd_generic_set_section_contents PARAMS ((bfd *abfd, sec_ptr section,
|
||||||
(bfd *abfd, sec_ptr section, PTR location, file_ptr offset,
|
PTR location, file_ptr offset,
|
||||||
bfd_size_type count));
|
bfd_size_type count));
|
||||||
|
|
||||||
/* Macros to tell if bfds are read or write enabled.
|
/* Macros to tell if bfds are read or write enabled.
|
||||||
|
@ -163,14 +168,15 @@ PROTO(boolean, bfd_generic_set_section_contents,
|
||||||
#define bfd_read_p(abfd) ((abfd)->direction == read_direction || (abfd)->direction == both_direction)
|
#define bfd_read_p(abfd) ((abfd)->direction == read_direction || (abfd)->direction == both_direction)
|
||||||
#define bfd_write_p(abfd) ((abfd)->direction == write_direction || (abfd)->direction == both_direction)
|
#define bfd_write_p(abfd) ((abfd)->direction == write_direction || (abfd)->direction == both_direction)
|
||||||
|
|
||||||
PROTO (void, bfd_assert,(char*,int));
|
void bfd_assert PARAMS ((char*,int));
|
||||||
|
|
||||||
#define BFD_ASSERT(x) \
|
#define BFD_ASSERT(x) \
|
||||||
{ if (!(x)) bfd_assert(__FILE__,__LINE__); }
|
{ if (!(x)) bfd_assert(__FILE__,__LINE__); }
|
||||||
|
|
||||||
#define BFD_FAIL() \
|
#define BFD_FAIL() \
|
||||||
{ bfd_assert(__FILE__,__LINE__); }
|
{ bfd_assert(__FILE__,__LINE__); }
|
||||||
|
|
||||||
PROTO (FILE *, bfd_cache_lookup_worker, (bfd *));
|
FILE * bfd_cache_lookup_worker PARAMS ((bfd *));
|
||||||
|
|
||||||
extern bfd *bfd_last_cache;
|
extern bfd *bfd_last_cache;
|
||||||
|
|
||||||
|
@ -186,23 +192,5 @@ extern bfd *bfd_last_cache;
|
||||||
/* Generic routine for close_and_cleanup is really just bfd_true. */
|
/* Generic routine for close_and_cleanup is really just bfd_true. */
|
||||||
#define bfd_generic_close_and_cleanup bfd_true
|
#define bfd_generic_close_and_cleanup bfd_true
|
||||||
|
|
||||||
/* THE FOLLOWING IS EXTRACTED FROM THE SOURCE*/
|
/* And more follows */
|
||||||
|
|
||||||
/*:init.c*/
|
|
||||||
|
|
||||||
/*:libbfd.c*/
|
|
||||||
|
|
||||||
/*:cache.c*/
|
|
||||||
|
|
||||||
/*:ctor.c*/
|
|
||||||
|
|
||||||
/*:reloc.c*/
|
|
||||||
|
|
||||||
/*:cpu-h8300.c*/
|
|
||||||
|
|
||||||
/*:cpu-i960.c*/
|
|
||||||
|
|
||||||
/*:cpu-empty.c*/
|
|
||||||
|
|
||||||
/*:archures.c*/
|
|
||||||
|
|
||||||
|
|
131
bfd/libbfd.c
131
bfd/libbfd.c
|
@ -400,24 +400,38 @@ DESCRIPTION
|
||||||
sections; each access (except for bytes) is vectored through
|
sections; each access (except for bytes) is vectored through
|
||||||
the target format of the BFD and mangled accordingly. The
|
the target format of the BFD and mangled accordingly. The
|
||||||
mangling performs any necessary endian translations and
|
mangling performs any necessary endian translations and
|
||||||
removes alignment restrictions.
|
removes alignment restrictions. Note that types accepted and
|
||||||
|
returned by these macros are identical so they can be swapped
|
||||||
|
around in macros--for example libaout.h defines GET_WORD to
|
||||||
|
either bfd_get_32 or bfd_get_64.
|
||||||
|
|
||||||
.#define bfd_put_8(abfd, val, ptr) \
|
.#define bfd_put_8(abfd, val, ptr) \
|
||||||
. (*((char *)ptr) = (char)val)
|
. (*((unsigned char *)ptr) = (unsigned char)val)
|
||||||
|
.#define bfd_put_signed_8(abfd, val, ptr) (*((char *)(ptr)) = (char)(val))
|
||||||
.#define bfd_get_8(abfd, ptr) \
|
.#define bfd_get_8(abfd, ptr) \
|
||||||
. (*((char *)ptr))
|
. (*((unsigned char *)(ptr)))
|
||||||
|
.#define bfd_get_signed_8(abfd, ptr) (((*(char *)(ptr) ^ 0x80) & 0xff) - 0x80)
|
||||||
.#define bfd_put_16(abfd, val, ptr) \
|
.#define bfd_put_16(abfd, val, ptr) \
|
||||||
. BFD_SEND(abfd, bfd_putx16, (val,ptr))
|
. BFD_SEND(abfd, bfd_putx16, ((bfd_vma)(val),(ptr)))
|
||||||
|
.#define bfd_put_signed_16 bfd_put_16
|
||||||
.#define bfd_get_16(abfd, ptr) \
|
.#define bfd_get_16(abfd, ptr) \
|
||||||
. BFD_SEND(abfd, bfd_getx16, (ptr))
|
. BFD_SEND(abfd, bfd_getx16, (ptr))
|
||||||
|
.#define bfd_get_signed_16(abfd, ptr) \
|
||||||
|
. BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
|
||||||
.#define bfd_put_32(abfd, val, ptr) \
|
.#define bfd_put_32(abfd, val, ptr) \
|
||||||
. BFD_SEND(abfd, bfd_putx32, (val,ptr))
|
. BFD_SEND(abfd, bfd_putx32, ((bfd_vma)(val),(ptr)))
|
||||||
|
.#define bfd_put_signed_32 bfd_put_32
|
||||||
.#define bfd_get_32(abfd, ptr) \
|
.#define bfd_get_32(abfd, ptr) \
|
||||||
. BFD_SEND(abfd, bfd_getx32, (ptr))
|
. BFD_SEND(abfd, bfd_getx32, (ptr))
|
||||||
|
.#define bfd_get_signed_32(abfd, ptr) \
|
||||||
|
. BFD_SEND(abfd, bfd_getx_signed_32, (ptr))
|
||||||
.#define bfd_put_64(abfd, val, ptr) \
|
.#define bfd_put_64(abfd, val, ptr) \
|
||||||
. BFD_SEND(abfd, bfd_putx64, (val, ptr))
|
. BFD_SEND(abfd, bfd_putx64, ((bfd_vma)(val), (ptr)))
|
||||||
|
.#define bfd_put_signed_64 bfd_put_64
|
||||||
.#define bfd_get_64(abfd, ptr) \
|
.#define bfd_get_64(abfd, ptr) \
|
||||||
. BFD_SEND(abfd, bfd_getx64, (ptr))
|
. BFD_SEND(abfd, bfd_getx64, (ptr))
|
||||||
|
.#define bfd_get_signed_64(abfd, ptr) \
|
||||||
|
. BFD_SEND(abfd, bfd_getx_signed_64, (ptr))
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -435,24 +449,41 @@ DESCRIPTION
|
||||||
order, and their data in little endan order.
|
order, and their data in little endan order.
|
||||||
|
|
||||||
.#define bfd_h_put_8(abfd, val, ptr) \
|
.#define bfd_h_put_8(abfd, val, ptr) \
|
||||||
. (*((char *)ptr) = (char)val)
|
. (*((unsigned char *)ptr) = (unsigned char)val)
|
||||||
|
.#define bfd_h_put_signed_8(abfd, val, ptr) (*((char *)(ptr)) = (char)(val))
|
||||||
.#define bfd_h_get_8(abfd, ptr) \
|
.#define bfd_h_get_8(abfd, ptr) \
|
||||||
. (*((char *)ptr))
|
. (*((unsigned char *)(ptr)))
|
||||||
|
.#define bfd_h_get_signed_8 bfd_get_signed_8
|
||||||
.#define bfd_h_put_16(abfd, val, ptr) \
|
.#define bfd_h_put_16(abfd, val, ptr) \
|
||||||
. BFD_SEND(abfd, bfd_h_putx16,(val,ptr))
|
. BFD_SEND(abfd, bfd_h_putx16,(val,ptr))
|
||||||
|
.#define bfd_h_put_signed_16 bfd_h_put_16
|
||||||
.#define bfd_h_get_16(abfd, ptr) \
|
.#define bfd_h_get_16(abfd, ptr) \
|
||||||
. BFD_SEND(abfd, bfd_h_getx16,(ptr))
|
. BFD_SEND(abfd, bfd_h_getx16,(ptr))
|
||||||
|
.#define bfd_h_get_signed_16(abfd, ptr) \
|
||||||
|
. BFD_SEND(abfd, bfd_h_getx_signed_16, (ptr))
|
||||||
.#define bfd_h_put_32(abfd, val, ptr) \
|
.#define bfd_h_put_32(abfd, val, ptr) \
|
||||||
. BFD_SEND(abfd, bfd_h_putx32,(val,ptr))
|
. BFD_SEND(abfd, bfd_h_putx32,(val,ptr))
|
||||||
|
.#define bfd_h_put_signed_32 bfd_h_put_32
|
||||||
.#define bfd_h_get_32(abfd, ptr) \
|
.#define bfd_h_get_32(abfd, ptr) \
|
||||||
. BFD_SEND(abfd, bfd_h_getx32,(ptr))
|
. BFD_SEND(abfd, bfd_h_getx32,(ptr))
|
||||||
|
.#define bfd_h_get_signed_32(abfd, ptr) \
|
||||||
|
. BFD_SEND(abfd, bfd_h_getx_signed_32, (ptr))
|
||||||
.#define bfd_h_put_64(abfd, val, ptr) \
|
.#define bfd_h_put_64(abfd, val, ptr) \
|
||||||
. BFD_SEND(abfd, bfd_h_putx64,(val, ptr))
|
. BFD_SEND(abfd, bfd_h_putx64,(val, ptr))
|
||||||
|
.#define bfd_h_put_signed_64 bfd_h_put_64
|
||||||
.#define bfd_h_get_64(abfd, ptr) \
|
.#define bfd_h_get_64(abfd, ptr) \
|
||||||
. BFD_SEND(abfd, bfd_h_getx64,(ptr))
|
. BFD_SEND(abfd, bfd_h_getx64,(ptr))
|
||||||
|
.#define bfd_h_get_signed_64(abfd, ptr) \
|
||||||
|
. BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Sign extension to bfd_signed_vma. */
|
||||||
|
#define COERCE16(x) ((bfd_signed_vma) (((x) ^ 0x8000) - 0x8000))
|
||||||
|
#define COERCE32(x) ((bfd_signed_vma) (((x) ^ 0x80000000) - 0x80000000))
|
||||||
|
#define COERCE64(x) ((bfd_signed_vma)\
|
||||||
|
(((x) ^ 0x8000000000000000) - 0x8000000000000000))
|
||||||
|
|
||||||
bfd_vma
|
bfd_vma
|
||||||
DEFUN(_do_getb16,(addr),
|
DEFUN(_do_getb16,(addr),
|
||||||
register bfd_byte *addr)
|
register bfd_byte *addr)
|
||||||
|
@ -467,6 +498,20 @@ DEFUN(_do_getl16,(addr),
|
||||||
return (addr[1] << 8) | addr[0];
|
return (addr[1] << 8) | addr[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bfd_signed_vma
|
||||||
|
DEFUN(_do_getb_signed_16,(addr),
|
||||||
|
register bfd_byte *addr)
|
||||||
|
{
|
||||||
|
return COERCE16((addr[0] << 8) | addr[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
bfd_signed_vma
|
||||||
|
DEFUN(_do_getl_signed_16,(addr),
|
||||||
|
register bfd_byte *addr)
|
||||||
|
{
|
||||||
|
return COERCE16((addr[1] << 8) | addr[0]);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DEFUN(_do_putb16,(data, addr),
|
DEFUN(_do_putb16,(data, addr),
|
||||||
bfd_vma data AND
|
bfd_vma data AND
|
||||||
|
@ -486,8 +531,8 @@ DEFUN(_do_putl16,(data, addr),
|
||||||
}
|
}
|
||||||
|
|
||||||
bfd_vma
|
bfd_vma
|
||||||
DEFUN(_do_getb32,(addr),
|
_do_getb32 (addr)
|
||||||
register bfd_byte *addr)
|
register bfd_byte *addr;
|
||||||
{
|
{
|
||||||
return ((((addr[0] << 8) | addr[1]) << 8) | addr[2]) << 8 | addr[3];
|
return ((((addr[0] << 8) | addr[1]) << 8) | addr[2]) << 8 | addr[3];
|
||||||
}
|
}
|
||||||
|
@ -499,6 +544,22 @@ _do_getl32 (addr)
|
||||||
return ((((addr[3] << 8) | addr[2]) << 8) | addr[1]) << 8 | addr[0];
|
return ((((addr[3] << 8) | addr[2]) << 8) | addr[1]) << 8 | addr[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bfd_signed_vma
|
||||||
|
_do_getb_signed_32 (addr)
|
||||||
|
register bfd_byte *addr;
|
||||||
|
{
|
||||||
|
return COERCE32(((((addr[0] << 8) | addr[1]) << 8)
|
||||||
|
| addr[2]) << 8 | addr[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
bfd_signed_vma
|
||||||
|
_do_getl_signed_32 (addr)
|
||||||
|
register bfd_byte *addr;
|
||||||
|
{
|
||||||
|
return COERCE32(((((addr[3] << 8) | addr[2]) << 8)
|
||||||
|
| addr[1]) << 8 | addr[0]);
|
||||||
|
}
|
||||||
|
|
||||||
bfd_vma
|
bfd_vma
|
||||||
DEFUN(_do_getb64,(addr),
|
DEFUN(_do_getb64,(addr),
|
||||||
register bfd_byte *addr)
|
register bfd_byte *addr)
|
||||||
|
@ -549,6 +610,56 @@ DEFUN(_do_getl64,(addr),
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bfd_signed_vma
|
||||||
|
DEFUN(_do_getb_signed_64,(addr),
|
||||||
|
register bfd_byte *addr)
|
||||||
|
{
|
||||||
|
#ifdef HOST_64_BIT
|
||||||
|
bfd_vma low, high;
|
||||||
|
|
||||||
|
high= ((((((((addr[0]) << 8) |
|
||||||
|
addr[1]) << 8) |
|
||||||
|
addr[2]) << 8) |
|
||||||
|
addr[3]) );
|
||||||
|
|
||||||
|
low = ((((((((addr[4]) << 8) |
|
||||||
|
addr[5]) << 8) |
|
||||||
|
addr[6]) << 8) |
|
||||||
|
addr[7]));
|
||||||
|
|
||||||
|
return COERCE64(high << 32 | low);
|
||||||
|
#else
|
||||||
|
BFD_FAIL();
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bfd_signed_vma
|
||||||
|
DEFUN(_do_getl_signed_64,(addr),
|
||||||
|
register bfd_byte *addr)
|
||||||
|
{
|
||||||
|
|
||||||
|
#ifdef HOST_64_BIT
|
||||||
|
bfd_vma low, high;
|
||||||
|
high= (((((((addr[7] << 8) |
|
||||||
|
addr[6]) << 8) |
|
||||||
|
addr[5]) << 8) |
|
||||||
|
addr[4]));
|
||||||
|
|
||||||
|
low = (((((((addr[3] << 8) |
|
||||||
|
addr[2]) << 8) |
|
||||||
|
addr[1]) << 8) |
|
||||||
|
addr[0]) );
|
||||||
|
|
||||||
|
return COERCE64(high << 32 | low);
|
||||||
|
#else
|
||||||
|
BFD_FAIL();
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DEFUN(_do_putb32,(data, addr),
|
DEFUN(_do_putb32,(data, addr),
|
||||||
bfd_vma data AND
|
bfd_vma data AND
|
||||||
|
|
33
bfd/libbfd.h
33
bfd/libbfd.h
|
@ -1,6 +1,6 @@
|
||||||
/* libbfd.h -- Declarations used by bfd library *implementation*.
|
/* libbfd.h -- Declarations used by bfd library *implementation*.
|
||||||
(This include file is not for users of the library.)
|
(This include file is not for users of the library.)
|
||||||
Copyright 1990, 1991 Free Software Foundation, Inc.
|
Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||||
Written by Cygnus Support.
|
Written by Cygnus Support.
|
||||||
|
|
||||||
This file is part of BFD, the Binary File Descriptor library.
|
This file is part of BFD, the Binary File Descriptor library.
|
||||||
|
@ -98,10 +98,16 @@ boolean bfd_add_to_string_table PARAMS ((char **table, char *new_string,
|
||||||
char **free_ptr));
|
char **free_ptr));
|
||||||
bfd_vma _do_getb64 PARAMS ((unsigned char *addr));
|
bfd_vma _do_getb64 PARAMS ((unsigned char *addr));
|
||||||
bfd_vma _do_getl64 PARAMS ((unsigned char *addr));
|
bfd_vma _do_getl64 PARAMS ((unsigned char *addr));
|
||||||
|
bfd_signed_vma _do_getb_signed_64 PARAMS ((unsigned char *addr));
|
||||||
|
bfd_signed_vma _do_getl_signed_64 PARAMS ((unsigned char *addr));
|
||||||
bfd_vma _do_getb32 PARAMS ((unsigned char *addr));
|
bfd_vma _do_getb32 PARAMS ((unsigned char *addr));
|
||||||
bfd_vma _do_getl32 PARAMS ((unsigned char *addr));
|
bfd_vma _do_getl32 PARAMS ((unsigned char *addr));
|
||||||
|
bfd_signed_vma _do_getb_signed_32 PARAMS ((unsigned char *addr));
|
||||||
|
bfd_signed_vma _do_getl_signed_32 PARAMS ((unsigned char *addr));
|
||||||
bfd_vma _do_getb16 PARAMS ((unsigned char *addr));
|
bfd_vma _do_getb16 PARAMS ((unsigned char *addr));
|
||||||
bfd_vma _do_getl16 PARAMS ((unsigned char *addr));
|
bfd_vma _do_getl16 PARAMS ((unsigned char *addr));
|
||||||
|
bfd_signed_vma _do_getb_signed_16 PARAMS ((unsigned char *addr));
|
||||||
|
bfd_signed_vma _do_getl_signed_16 PARAMS ((unsigned char *addr));
|
||||||
void _do_putb64 PARAMS ((bfd_vma data, unsigned char *addr));
|
void _do_putb64 PARAMS ((bfd_vma data, unsigned char *addr));
|
||||||
void _do_putl64 PARAMS ((bfd_vma data, unsigned char *addr));
|
void _do_putl64 PARAMS ((bfd_vma data, unsigned char *addr));
|
||||||
void _do_putb32 PARAMS ((bfd_vma data, unsigned char *addr));
|
void _do_putb32 PARAMS ((bfd_vma data, unsigned char *addr));
|
||||||
|
@ -200,18 +206,6 @@ bfd_write_bigendian_4byte_int PARAMS ((bfd *abfd, int i));
|
||||||
bfd_vma
|
bfd_vma
|
||||||
bfd_log2 PARAMS ((bfd_vma x));
|
bfd_log2 PARAMS ((bfd_vma x));
|
||||||
|
|
||||||
void
|
|
||||||
bfd_check_init PARAMS ((void));
|
|
||||||
|
|
||||||
PTR
|
|
||||||
bfd_xmalloc PARAMS (( bfd_size_type size));
|
|
||||||
|
|
||||||
void
|
|
||||||
bfd_write_bigendian_4byte_int PARAMS ((bfd *abfd, int i));
|
|
||||||
|
|
||||||
bfd_vma
|
|
||||||
bfd_log2 PARAMS ((bfd_vma x));
|
|
||||||
|
|
||||||
#define BFD_CACHE_MAX_OPEN 10
|
#define BFD_CACHE_MAX_OPEN 10
|
||||||
extern bfd *bfd_last_cache;
|
extern bfd *bfd_last_cache;
|
||||||
|
|
||||||
|
@ -238,7 +232,7 @@ bfd_constructor_entry PARAMS ((bfd *abfd,
|
||||||
|
|
||||||
CONST struct reloc_howto_struct *
|
CONST struct reloc_howto_struct *
|
||||||
bfd_default_reloc_type_lookup
|
bfd_default_reloc_type_lookup
|
||||||
PARAMS ((CONST struct bfd_arch_info *,
|
PARAMS ((bfd *abfd AND
|
||||||
bfd_reloc_code_real_type code));
|
bfd_reloc_code_real_type code));
|
||||||
|
|
||||||
boolean
|
boolean
|
||||||
|
@ -251,7 +245,14 @@ bfd_byte *
|
||||||
|
|
||||||
bfd_generic_get_relocated_section_contents PARAMS ((bfd *abfd,
|
bfd_generic_get_relocated_section_contents PARAMS ((bfd *abfd,
|
||||||
struct bfd_seclet *seclet,
|
struct bfd_seclet *seclet,
|
||||||
bfd_byte *data));
|
bfd_byte *data,
|
||||||
|
boolean relocateable));
|
||||||
|
|
||||||
|
boolean
|
||||||
|
bfd_generic_seclet_link
|
||||||
|
PARAMS ((bfd *abfd,
|
||||||
|
PTR data,
|
||||||
|
boolean relocateable));
|
||||||
|
|
||||||
extern bfd_arch_info_type bfd_default_arch_struct;
|
extern bfd_arch_info_type bfd_default_arch_struct;
|
||||||
boolean
|
boolean
|
||||||
|
@ -273,6 +274,6 @@ bfd_default_compatible
|
||||||
boolean
|
boolean
|
||||||
bfd_default_scan PARAMS ((CONST struct bfd_arch_info *, CONST char *));
|
bfd_default_scan PARAMS ((CONST struct bfd_arch_info *, CONST char *));
|
||||||
|
|
||||||
Elf_Internal_Shdr *
|
struct elf_internal_shdr *
|
||||||
bfd_elf_find_section PARAMS ((bfd *abfd, char *name));
|
bfd_elf_find_section PARAMS ((bfd *abfd, char *name));
|
||||||
|
|
||||||
|
|
|
@ -180,19 +180,25 @@ entry points, since they don't take BFD as first arg. Certain other handlers
|
||||||
could do the same.
|
could do the same.
|
||||||
|
|
||||||
. bfd_vma (*bfd_getx64) PARAMS ((bfd_byte *));
|
. bfd_vma (*bfd_getx64) PARAMS ((bfd_byte *));
|
||||||
|
. bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((bfd_byte *));
|
||||||
. void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));
|
. void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));
|
||||||
. bfd_vma (*bfd_getx32) PARAMS ((bfd_byte *));
|
. bfd_vma (*bfd_getx32) PARAMS ((bfd_byte *));
|
||||||
|
. bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((bfd_byte *));
|
||||||
. void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));
|
. void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));
|
||||||
. bfd_vma (*bfd_getx16) PARAMS ((bfd_byte *));
|
. bfd_vma (*bfd_getx16) PARAMS ((bfd_byte *));
|
||||||
|
. bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((bfd_byte *));
|
||||||
. void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));
|
. void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));
|
||||||
|
|
||||||
Byte swapping for the headers
|
Byte swapping for the headers
|
||||||
|
|
||||||
. bfd_vma (*bfd_h_getx64) PARAMS ((bfd_byte *));
|
. bfd_vma (*bfd_h_getx64) PARAMS ((bfd_byte *));
|
||||||
|
. bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((bfd_byte *));
|
||||||
. void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));
|
. void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));
|
||||||
. bfd_vma (*bfd_h_getx32) PARAMS ((bfd_byte *));
|
. bfd_vma (*bfd_h_getx32) PARAMS ((bfd_byte *));
|
||||||
|
. bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((bfd_byte *));
|
||||||
. void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));
|
. void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));
|
||||||
. bfd_vma (*bfd_h_getx16) PARAMS ((bfd_byte *));
|
. bfd_vma (*bfd_h_getx16) PARAMS ((bfd_byte *));
|
||||||
|
. bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((bfd_byte *));
|
||||||
. void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));
|
. void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));
|
||||||
|
|
||||||
Format dependent routines: these are vectors of entry points
|
Format dependent routines: these are vectors of entry points
|
||||||
|
@ -299,10 +305,8 @@ Symbols and relocations
|
||||||
. void *ptr,
|
. void *ptr,
|
||||||
. unsigned long size));
|
. unsigned long size));
|
||||||
|
|
||||||
Data for use by back-end routines; e.g., for a.out, includes whether
|
Data for use by back-end routines, which isn't generic enough to belong
|
||||||
this particular target maps ZMAGIC files contiguously or with text and
|
in this structure.
|
||||||
data separated. Could perhaps also be used to eliminate some of the
|
|
||||||
above COFF-specific fields.
|
|
||||||
|
|
||||||
. PTR backend_data;
|
. PTR backend_data;
|
||||||
.} bfd_target;
|
.} bfd_target;
|
||||||
|
@ -348,8 +352,10 @@ extern bfd_target b_out_vec_little_host;
|
||||||
extern bfd_target b_out_vec_big_host;
|
extern bfd_target b_out_vec_big_host;
|
||||||
extern bfd_target icoff_little_vec;
|
extern bfd_target icoff_little_vec;
|
||||||
extern bfd_target icoff_big_vec;
|
extern bfd_target icoff_big_vec;
|
||||||
extern bfd_target elf_little_vec;
|
extern bfd_target elf32_sparc_vec;
|
||||||
extern bfd_target elf_big_vec;
|
extern bfd_target elf32_i386_vec;
|
||||||
|
extern bfd_target elf32_m68k_vec;
|
||||||
|
extern bfd_target elf32_i860_vec;
|
||||||
extern bfd_target ieee_vec;
|
extern bfd_target ieee_vec;
|
||||||
extern bfd_target oasys_vec;
|
extern bfd_target oasys_vec;
|
||||||
extern bfd_target m88kbcs_vec;
|
extern bfd_target m88kbcs_vec;
|
||||||
|
@ -378,8 +384,10 @@ extern bfd_target DEFAULT_VECTOR;
|
||||||
bfd_target *target_vector[] = {
|
bfd_target *target_vector[] = {
|
||||||
|
|
||||||
#ifdef SELECT_VECS
|
#ifdef SELECT_VECS
|
||||||
|
|
||||||
SELECT_VECS,
|
SELECT_VECS,
|
||||||
#else /* SELECT_VECS */
|
|
||||||
|
#else /* not SELECT_VECS */
|
||||||
|
|
||||||
#ifdef DEFAULT_VECTOR
|
#ifdef DEFAULT_VECTOR
|
||||||
&DEFAULT_VECTOR,
|
&DEFAULT_VECTOR,
|
||||||
|
@ -412,8 +420,10 @@ bfd_target *target_vector[] = {
|
||||||
/* &tekhex_vec,*/
|
/* &tekhex_vec,*/
|
||||||
&icoff_little_vec,
|
&icoff_little_vec,
|
||||||
&icoff_big_vec,
|
&icoff_big_vec,
|
||||||
&elf_little_vec,
|
&elf32_sparc_vec,
|
||||||
&elf_big_vec,
|
&elf32_i386_vec,
|
||||||
|
&elf32_m68k_vec,
|
||||||
|
&elf32_i860_vec,
|
||||||
&a_out_adobe_vec,
|
&a_out_adobe_vec,
|
||||||
&b_out_vec_little_host,
|
&b_out_vec_little_host,
|
||||||
&b_out_vec_big_host,
|
&b_out_vec_big_host,
|
||||||
|
@ -435,7 +445,7 @@ bfd_target *target_vector[] = {
|
||||||
&aix386_core_vec,
|
&aix386_core_vec,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* SELECT_VECS */
|
#endif /* not SELECT_VECS */
|
||||||
NULL, /* end of list marker */
|
NULL, /* end of list marker */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -68,29 +68,37 @@ typedef enum bfd_boolean {false, true} boolean;
|
||||||
/* typedef off_t file_ptr; */
|
/* typedef off_t file_ptr; */
|
||||||
typedef long int file_ptr;
|
typedef long int file_ptr;
|
||||||
|
|
||||||
/* Support for different sizes of target format ints and addresses */
|
/* Support for different sizes of target format ints and addresses.
|
||||||
|
If the host implements--and wants BFD to use--64-bit values, it
|
||||||
|
defines HOST_64_BIT (in BFD and in every program that calls it --
|
||||||
|
since this affects declarations in bfd.h). */
|
||||||
|
|
||||||
#ifdef HOST_64_BIT
|
#ifdef HOST_64_BIT
|
||||||
typedef HOST_64_BIT rawdata_offset;
|
typedef unsigned HOST_64_BIT bfd_vma;
|
||||||
typedef HOST_64_BIT bfd_vma;
|
typedef HOST_64_BIT bfd_signed_vma;
|
||||||
typedef HOST_64_BIT bfd_word;
|
typedef unsigned HOST_64_BIT bfd_size_type;
|
||||||
typedef HOST_64_BIT bfd_offset;
|
typedef unsigned HOST_64_BIT symvalue;
|
||||||
typedef HOST_64_BIT bfd_size_type;
|
|
||||||
typedef HOST_64_BIT symvalue;
|
|
||||||
typedef HOST_64_BIT bfd_64_type;
|
|
||||||
#define fprintf_vma(s,x) \
|
#define fprintf_vma(s,x) \
|
||||||
fprintf(s,"%08x%08x", uint64_typeHIGH(x), uint64_typeLOW(x))
|
fprintf(s,"%08x%08x", uint64_typeHIGH(x), uint64_typeLOW(x))
|
||||||
#else
|
#else /* not HOST_64_BIT. */
|
||||||
typedef struct {int a,b;} bfd_64_type;
|
|
||||||
typedef unsigned long rawdata_offset;
|
/* Represent a target address. Also used as a generic unsigned type
|
||||||
|
which is guaranteed to be big enough to hold any arithmetic types
|
||||||
|
we need to deal with. */
|
||||||
typedef unsigned long bfd_vma;
|
typedef unsigned long bfd_vma;
|
||||||
typedef unsigned long bfd_offset;
|
|
||||||
typedef unsigned long bfd_word;
|
/* A generic signed type which is guaranteed to be big enough to hold any
|
||||||
typedef unsigned long bfd_size;
|
arithmetic types we need to deal with. Can be assumed to be compatible
|
||||||
|
with bfd_vma in the same way that signed and unsigned ints are compatible
|
||||||
|
(as parameters, in assignment, etc). */
|
||||||
|
typedef long bfd_signed_vma;
|
||||||
|
|
||||||
typedef unsigned long symvalue;
|
typedef unsigned long symvalue;
|
||||||
typedef unsigned long bfd_size_type;
|
typedef unsigned long bfd_size_type;
|
||||||
|
|
||||||
|
/* Print a bfd_vma x on stream s. */
|
||||||
#define fprintf_vma(s,x) fprintf(s, "%08lx", x)
|
#define fprintf_vma(s,x) fprintf(s, "%08lx", x)
|
||||||
#endif
|
#endif /* not HOST_64_BIT. */
|
||||||
#define printf_vma(x) fprintf_vma(stdout,x)
|
#define printf_vma(x) fprintf_vma(stdout,x)
|
||||||
|
|
||||||
typedef unsigned int flagword; /* 32 bits of flags */
|
typedef unsigned int flagword; /* 32 bits of flags */
|
||||||
|
@ -364,37 +372,59 @@ bfd *
|
||||||
bfd_create PARAMS ((CONST char *filename, bfd *template));
|
bfd_create PARAMS ((CONST char *filename, bfd *template));
|
||||||
|
|
||||||
#define bfd_put_8(abfd, val, ptr) \
|
#define bfd_put_8(abfd, val, ptr) \
|
||||||
(*((char *)ptr) = (char)val)
|
(*((unsigned char *)ptr) = (unsigned char)val)
|
||||||
|
#define bfd_put_signed_8(abfd, val, ptr) (*((char *)(ptr)) = (char)(val))
|
||||||
#define bfd_get_8(abfd, ptr) \
|
#define bfd_get_8(abfd, ptr) \
|
||||||
(*((char *)ptr))
|
(*((unsigned char *)(ptr)))
|
||||||
|
#define bfd_get_signed_8(abfd, ptr) (((*(char *)(ptr) ^ 0x80) & 0xff) - 0x80)
|
||||||
#define bfd_put_16(abfd, val, ptr) \
|
#define bfd_put_16(abfd, val, ptr) \
|
||||||
BFD_SEND(abfd, bfd_putx16, (val,ptr))
|
BFD_SEND(abfd, bfd_putx16, ((bfd_vma)(val),(ptr)))
|
||||||
|
#define bfd_put_signed_16 bfd_put_16
|
||||||
#define bfd_get_16(abfd, ptr) \
|
#define bfd_get_16(abfd, ptr) \
|
||||||
BFD_SEND(abfd, bfd_getx16, (ptr))
|
BFD_SEND(abfd, bfd_getx16, (ptr))
|
||||||
|
#define bfd_get_signed_16(abfd, ptr) \
|
||||||
|
BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
|
||||||
#define bfd_put_32(abfd, val, ptr) \
|
#define bfd_put_32(abfd, val, ptr) \
|
||||||
BFD_SEND(abfd, bfd_putx32, (val,ptr))
|
BFD_SEND(abfd, bfd_putx32, ((bfd_vma)(val),(ptr)))
|
||||||
|
#define bfd_put_signed_32 bfd_put_32
|
||||||
#define bfd_get_32(abfd, ptr) \
|
#define bfd_get_32(abfd, ptr) \
|
||||||
BFD_SEND(abfd, bfd_getx32, (ptr))
|
BFD_SEND(abfd, bfd_getx32, (ptr))
|
||||||
|
#define bfd_get_signed_32(abfd, ptr) \
|
||||||
|
BFD_SEND(abfd, bfd_getx_signed_32, (ptr))
|
||||||
#define bfd_put_64(abfd, val, ptr) \
|
#define bfd_put_64(abfd, val, ptr) \
|
||||||
BFD_SEND(abfd, bfd_putx64, (val, ptr))
|
BFD_SEND(abfd, bfd_putx64, ((bfd_vma)(val), (ptr)))
|
||||||
|
#define bfd_put_signed_64 bfd_put_64
|
||||||
#define bfd_get_64(abfd, ptr) \
|
#define bfd_get_64(abfd, ptr) \
|
||||||
BFD_SEND(abfd, bfd_getx64, (ptr))
|
BFD_SEND(abfd, bfd_getx64, (ptr))
|
||||||
|
#define bfd_get_signed_64(abfd, ptr) \
|
||||||
|
BFD_SEND(abfd, bfd_getx_signed_64, (ptr))
|
||||||
#define bfd_h_put_8(abfd, val, ptr) \
|
#define bfd_h_put_8(abfd, val, ptr) \
|
||||||
(*((char *)ptr) = (char)val)
|
(*((unsigned char *)ptr) = (unsigned char)val)
|
||||||
|
#define bfd_h_put_signed_8(abfd, val, ptr) (*((char *)(ptr)) = (char)(val))
|
||||||
#define bfd_h_get_8(abfd, ptr) \
|
#define bfd_h_get_8(abfd, ptr) \
|
||||||
(*((char *)ptr))
|
(*((unsigned char *)(ptr)))
|
||||||
|
#define bfd_h_get_signed_8 bfd_get_signed_8
|
||||||
#define bfd_h_put_16(abfd, val, ptr) \
|
#define bfd_h_put_16(abfd, val, ptr) \
|
||||||
BFD_SEND(abfd, bfd_h_putx16,(val,ptr))
|
BFD_SEND(abfd, bfd_h_putx16,(val,ptr))
|
||||||
|
#define bfd_h_put_signed_16 bfd_h_put_16
|
||||||
#define bfd_h_get_16(abfd, ptr) \
|
#define bfd_h_get_16(abfd, ptr) \
|
||||||
BFD_SEND(abfd, bfd_h_getx16,(ptr))
|
BFD_SEND(abfd, bfd_h_getx16,(ptr))
|
||||||
|
#define bfd_h_get_signed_16(abfd, ptr) \
|
||||||
|
BFD_SEND(abfd, bfd_h_getx_signed_16, (ptr))
|
||||||
#define bfd_h_put_32(abfd, val, ptr) \
|
#define bfd_h_put_32(abfd, val, ptr) \
|
||||||
BFD_SEND(abfd, bfd_h_putx32,(val,ptr))
|
BFD_SEND(abfd, bfd_h_putx32,(val,ptr))
|
||||||
|
#define bfd_h_put_signed_32 bfd_h_put_32
|
||||||
#define bfd_h_get_32(abfd, ptr) \
|
#define bfd_h_get_32(abfd, ptr) \
|
||||||
BFD_SEND(abfd, bfd_h_getx32,(ptr))
|
BFD_SEND(abfd, bfd_h_getx32,(ptr))
|
||||||
|
#define bfd_h_get_signed_32(abfd, ptr) \
|
||||||
|
BFD_SEND(abfd, bfd_h_getx_signed_32, (ptr))
|
||||||
#define bfd_h_put_64(abfd, val, ptr) \
|
#define bfd_h_put_64(abfd, val, ptr) \
|
||||||
BFD_SEND(abfd, bfd_h_putx64,(val, ptr))
|
BFD_SEND(abfd, bfd_h_putx64,(val, ptr))
|
||||||
|
#define bfd_h_put_signed_64 bfd_h_put_64
|
||||||
#define bfd_h_get_64(abfd, ptr) \
|
#define bfd_h_get_64(abfd, ptr) \
|
||||||
BFD_SEND(abfd, bfd_h_getx64,(ptr))
|
BFD_SEND(abfd, bfd_h_getx64,(ptr))
|
||||||
|
#define bfd_h_get_signed_64(abfd, ptr) \
|
||||||
|
BFD_SEND(abfd, bfd_h_getx_signed_64, (ptr))
|
||||||
typedef struct sec
|
typedef struct sec
|
||||||
{
|
{
|
||||||
/* The name of the section, the name isn't a copy, the pointer is
|
/* The name of the section, the name isn't a copy, the pointer is
|
||||||
|
@ -787,7 +817,7 @@ typedef enum bfd_reloc_status
|
||||||
/* The relocation was performed, but there was an overflow. */
|
/* The relocation was performed, but there was an overflow. */
|
||||||
bfd_reloc_overflow,
|
bfd_reloc_overflow,
|
||||||
|
|
||||||
/* The address to relocate was not within the section supplied*/
|
/* The address to relocate was not within the section supplied. */
|
||||||
bfd_reloc_outofrange,
|
bfd_reloc_outofrange,
|
||||||
|
|
||||||
/* Used by special functions */
|
/* Used by special functions */
|
||||||
|
@ -816,7 +846,7 @@ typedef struct reloc_cache_entry
|
||||||
struct symbol_cache_entry **sym_ptr_ptr;
|
struct symbol_cache_entry **sym_ptr_ptr;
|
||||||
|
|
||||||
/* offset in section */
|
/* offset in section */
|
||||||
rawdata_offset address;
|
bfd_size_type address;
|
||||||
|
|
||||||
/* addend for relocation value */
|
/* addend for relocation value */
|
||||||
bfd_vma addend;
|
bfd_vma addend;
|
||||||
|
@ -889,13 +919,13 @@ typedef CONST struct reloc_howto_struct
|
||||||
sun4 extended relocs, the value in the offset part of a
|
sun4 extended relocs, the value in the offset part of a
|
||||||
relocating field is garbage so we never use it. In this case
|
relocating field is garbage so we never use it. In this case
|
||||||
the mask would be 0x00000000. */
|
the mask would be 0x00000000. */
|
||||||
bfd_word src_mask;
|
bfd_vma src_mask;
|
||||||
|
|
||||||
/* The dst_mask is what parts of the instruction are replaced
|
/* The dst_mask is what parts of the instruction are replaced
|
||||||
into the instruction. In most cases src_mask == dst_mask,
|
into the instruction. In most cases src_mask == dst_mask,
|
||||||
except in the above special case, where dst_mask would be
|
except in the above special case, where dst_mask would be
|
||||||
0x000000ff, and src_mask would be 0x00000000. */
|
0x000000ff, and src_mask would be 0x00000000. */
|
||||||
bfd_word dst_mask;
|
bfd_vma dst_mask;
|
||||||
|
|
||||||
/* When some formats create PC relative instructions, they leave
|
/* When some formats create PC relative instructions, they leave
|
||||||
the value of the pc of the place being relocated in the offset
|
the value of the pc of the place being relocated in the offset
|
||||||
|
@ -1406,16 +1436,22 @@ typedef struct bfd_target
|
||||||
unsigned short ar_max_namelen;
|
unsigned short ar_max_namelen;
|
||||||
unsigned int align_power_min;
|
unsigned int align_power_min;
|
||||||
bfd_vma (*bfd_getx64) PARAMS ((bfd_byte *));
|
bfd_vma (*bfd_getx64) PARAMS ((bfd_byte *));
|
||||||
|
bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((bfd_byte *));
|
||||||
void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));
|
void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));
|
||||||
bfd_vma (*bfd_getx32) PARAMS ((bfd_byte *));
|
bfd_vma (*bfd_getx32) PARAMS ((bfd_byte *));
|
||||||
|
bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((bfd_byte *));
|
||||||
void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));
|
void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));
|
||||||
bfd_vma (*bfd_getx16) PARAMS ((bfd_byte *));
|
bfd_vma (*bfd_getx16) PARAMS ((bfd_byte *));
|
||||||
|
bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((bfd_byte *));
|
||||||
void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));
|
void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));
|
||||||
bfd_vma (*bfd_h_getx64) PARAMS ((bfd_byte *));
|
bfd_vma (*bfd_h_getx64) PARAMS ((bfd_byte *));
|
||||||
|
bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((bfd_byte *));
|
||||||
void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));
|
void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));
|
||||||
bfd_vma (*bfd_h_getx32) PARAMS ((bfd_byte *));
|
bfd_vma (*bfd_h_getx32) PARAMS ((bfd_byte *));
|
||||||
|
bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((bfd_byte *));
|
||||||
void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));
|
void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));
|
||||||
bfd_vma (*bfd_h_getx16) PARAMS ((bfd_byte *));
|
bfd_vma (*bfd_h_getx16) PARAMS ((bfd_byte *));
|
||||||
|
bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((bfd_byte *));
|
||||||
void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));
|
void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));
|
||||||
struct bfd_target * (*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *));
|
struct bfd_target * (*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *));
|
||||||
boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
|
boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
|
||||||
|
|
Loading…
Reference in New Issue