Convert to C90 and a few tweaks.

This commit is contained in:
Alan Modra 2003-06-29 10:06:40 +00:00
parent 58611256d8
commit c58b95236c
26 changed files with 2352 additions and 3028 deletions

View File

@ -1,3 +1,37 @@
2003-06-29 Alan Modra <amodra@bigpond.net.au>
* archive.c: Convert to C90, remove unnecessary prototypes and casts.
Replace PTR with void *. Formatting.
* archive64.c: Likewise.
* archures.c: Likewise.
* bfd-in.h: Likewise.
* bfd.c: Likewise.
* bfdio.c: Likewise.
* bfdwin.c: Likewise.
* cache.c: Likewise.
* corefile.c: Likewise.
* format.c: Likewise.
* init.c: Likewise.
* libbfd-in.h: Likewise.
* libbfd.c: Likewise.
* linker.c: Likewise.
* opncls.c: Likewise.
* reloc.c: Likewise.
* section.c: Likewise.
* simple.c: Likewise.
* syms.c: Likewise.
* targets.c: Likewise.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* ecoff.c (bfd_debug_section): Add missing kept_section initialization.
* libbfd-in.h (_bfd_sh_align_load_span): Don't declare if defined.
* libbfd.c (COERCE32, EIGHT_GAZILLION): Simplify.
(bfd_getb64): Rewrite without parens.
(bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
* cache.c (insert, snip): Remove INLINE.
* linker.c (bfd_link_add_undef): Likewise.
2003-06-29 Andreas Jaeger <aj@suse.de>
* elf64-x86-64.c: Convert to ISO C90 prototypes, remove

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* MIPS-specific support for 64-bit ELF
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Ian Lance Taylor, Cygnus Support
Linker support added by Mark Mitchell, CodeSourcery, LLC.
@ -31,15 +31,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Irix 6 defines a 64bit archive map format, so that they can
have archives more than 4 GB in size. */
bfd_boolean bfd_elf64_archive_slurp_armap PARAMS ((bfd *));
bfd_boolean bfd_elf64_archive_slurp_armap (bfd *);
bfd_boolean bfd_elf64_archive_write_armap
PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
(bfd *, unsigned int, struct orl *, unsigned int, int);
/* Read an Irix 6 armap. */
bfd_boolean
bfd_elf64_archive_slurp_armap (abfd)
bfd *abfd;
bfd_elf64_archive_slurp_armap (bfd *abfd)
{
struct artdata *ardata = bfd_ardata (abfd);
char nextname[17];
@ -56,7 +55,7 @@ bfd_elf64_archive_slurp_armap (abfd)
/* Get the name of the first element. */
arhdrpos = bfd_tell (abfd);
i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd);
i = bfd_bread (nextname, 16, abfd);
if (i == 0)
return TRUE;
if (i != 16)
@ -79,9 +78,9 @@ bfd_elf64_archive_slurp_armap (abfd)
if (mapdata == NULL)
return FALSE;
parsed_size = mapdata->parsed_size;
bfd_release (abfd, (PTR) mapdata);
bfd_release (abfd, mapdata);
if (bfd_bread (int_buf, (bfd_size_type) 8, abfd) != 8)
if (bfd_bread (int_buf, 8, abfd) != 8)
{
if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_malformed_archive);
@ -95,13 +94,13 @@ bfd_elf64_archive_slurp_armap (abfd)
ptrsize = 8 * nsymz;
amt = carsym_size + stringsize + 1;
ardata->symdefs = (carsym *) bfd_zalloc (abfd, amt);
ardata->symdefs = bfd_zalloc (abfd, amt);
if (ardata->symdefs == NULL)
return FALSE;
carsyms = ardata->symdefs;
stringbase = ((char *) ardata->symdefs) + carsym_size;
raw_armap = (bfd_byte *) bfd_alloc (abfd, ptrsize);
raw_armap = bfd_alloc (abfd, ptrsize);
if (raw_armap == NULL)
goto release_symdefs;
@ -144,12 +143,11 @@ release_symdefs:
linker crashes. */
bfd_boolean
bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx)
bfd *arch;
unsigned int elength;
struct orl *map;
unsigned int symbol_count;
int stridx;
bfd_elf64_archive_write_armap (bfd *arch,
unsigned int elength,
struct orl *map,
unsigned int symbol_count,
int stridx)
{
unsigned int ranlibsize = (symbol_count * 8) + 8;
unsigned int stringsize = stridx;
@ -171,7 +169,7 @@ bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx)
+ sizeof (struct ar_hdr)
+ SARMAG);
memset ((char *) (&hdr), 0, sizeof (struct ar_hdr));
memset (&hdr, 0, sizeof (struct ar_hdr));
strcpy (hdr.ar_name, "/SYM64/");
sprintf (hdr.ar_size, "%-10d", (int) mapsize);
sprintf (hdr.ar_date, "%ld", (long) time (NULL));
@ -187,12 +185,12 @@ bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx)
/* Write the ar header for this item and the number of symbols */
if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch)
if (bfd_bwrite (&hdr, sizeof (struct ar_hdr), arch)
!= sizeof (struct ar_hdr))
return FALSE;
bfd_putb64 ((bfd_vma) symbol_count, buf);
if (bfd_bwrite (buf, (bfd_size_type) 8, arch) != 8)
if (bfd_bwrite (buf, 8, arch) != 8)
return FALSE;
/* Two passes, first write the file offsets for each symbol -
@ -203,7 +201,7 @@ bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx)
current = arch->archive_head;
count = 0;
while (current != (bfd *) NULL && count < symbol_count)
while (current != NULL && count < symbol_count)
{
/* For each symbol which is used defined in this object, write out
the object file's address in the archive */
@ -211,7 +209,7 @@ bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx)
while (map[count].u.abfd == current)
{
bfd_putb64 ((bfd_vma) archive_member_file_ptr, buf);
if (bfd_bwrite (buf, (bfd_size_type) 8, arch) != 8)
if (bfd_bwrite (buf, 8, arch) != 8)
return FALSE;
count++;
}
@ -228,7 +226,7 @@ bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx)
{
size_t len = strlen (*map[count].name) + 1;
if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len)
if (bfd_bwrite (*map[count].name, len, arch) != len)
return FALSE;
}
@ -236,7 +234,7 @@ bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx)
However, the Irix 6.2 tools do not appear to do this. */
while (padding != 0)
{
if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1)
if (bfd_bwrite ("", 1, arch) != 1)
return FALSE;
--padding;
}

View File

@ -342,10 +342,9 @@ DESCRIPTION
. all the entries for that arch can be accessed via <<next>>. *}
. bfd_boolean the_default;
. const struct bfd_arch_info * (*compatible)
. PARAMS ((const struct bfd_arch_info *a,
. const struct bfd_arch_info *b));
. (const struct bfd_arch_info *a, const struct bfd_arch_info *b);
.
. bfd_boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *));
. bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
.
. const struct bfd_arch_info *next;
.}
@ -474,7 +473,7 @@ FUNCTION
bfd_printable_name
SYNOPSIS
const char *bfd_printable_name(bfd *abfd);
const char *bfd_printable_name (bfd *abfd);
DESCRIPTION
Return a printable string representing the architecture and machine
@ -483,8 +482,7 @@ DESCRIPTION
*/
const char *
bfd_printable_name (abfd)
bfd *abfd;
bfd_printable_name (bfd *abfd)
{
return abfd->arch_info->printable_name;
}
@ -494,7 +492,7 @@ FUNCTION
bfd_scan_arch
SYNOPSIS
const bfd_arch_info_type *bfd_scan_arch(const char *string);
const bfd_arch_info_type *bfd_scan_arch (const char *string);
DESCRIPTION
Figure out if BFD supports any cpu which could be described with
@ -503,8 +501,7 @@ DESCRIPTION
*/
const bfd_arch_info_type *
bfd_scan_arch (string)
const char *string;
bfd_scan_arch (const char *string)
{
const bfd_arch_info_type * const *app, *ap;
@ -526,7 +523,7 @@ FUNCTION
bfd_arch_list
SYNOPSIS
const char **bfd_arch_list(void);
const char **bfd_arch_list (void);
DESCRIPTION
Return a freshly malloced NULL-terminated vector of the names
@ -534,7 +531,7 @@ DESCRIPTION
*/
const char **
bfd_arch_list ()
bfd_arch_list (void)
{
int vec_length = 0;
const char **name_ptr;
@ -554,7 +551,7 @@ bfd_arch_list ()
}
amt = (vec_length + 1) * sizeof (char **);
name_list = (const char **) bfd_malloc (amt);
name_list = bfd_malloc (amt);
if (name_list == NULL)
return NULL;
@ -579,10 +576,8 @@ FUNCTION
bfd_arch_get_compatible
SYNOPSIS
const bfd_arch_info_type *bfd_arch_get_compatible(
const bfd *abfd,
const bfd *bbfd,
bfd_boolean accept_unknowns);
const bfd_arch_info_type *bfd_arch_get_compatible
(const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
DESCRIPTION
Determine whether two BFDs' architectures and machine types
@ -593,10 +588,9 @@ DESCRIPTION
*/
const bfd_arch_info_type *
bfd_arch_get_compatible (abfd, bbfd, accept_unknowns)
const bfd *abfd;
const bfd *bbfd;
bfd_boolean accept_unknowns;
bfd_arch_get_compatible (const bfd *abfd,
const bfd *bbfd,
bfd_boolean accept_unknowns)
{
const bfd * ubfd = NULL;
@ -645,16 +639,14 @@ FUNCTION
bfd_set_arch_info
SYNOPSIS
void bfd_set_arch_info(bfd *abfd, const bfd_arch_info_type *arg);
void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
DESCRIPTION
Set the architecture info of @var{abfd} to @var{arg}.
*/
void
bfd_set_arch_info (abfd, arg)
bfd *abfd;
const bfd_arch_info_type *arg;
bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg)
{
abfd->arch_info = arg;
}
@ -664,9 +656,8 @@ INTERNAL_FUNCTION
bfd_default_set_arch_mach
SYNOPSIS
bfd_boolean bfd_default_set_arch_mach(bfd *abfd,
enum bfd_architecture arch,
unsigned long mach);
bfd_boolean bfd_default_set_arch_mach
(bfd *abfd, enum bfd_architecture arch, unsigned long mach);
DESCRIPTION
Set the architecture and machine type in BFD @var{abfd}
@ -676,10 +667,9 @@ DESCRIPTION
*/
bfd_boolean
bfd_default_set_arch_mach (abfd, arch, mach)
bfd *abfd;
enum bfd_architecture arch;
unsigned long mach;
bfd_default_set_arch_mach (bfd *abfd,
enum bfd_architecture arch,
unsigned long mach)
{
abfd->arch_info = bfd_lookup_arch (arch, mach);
if (abfd->arch_info != NULL)
@ -695,7 +685,7 @@ FUNCTION
bfd_get_arch
SYNOPSIS
enum bfd_architecture bfd_get_arch(bfd *abfd);
enum bfd_architecture bfd_get_arch (bfd *abfd);
DESCRIPTION
Return the enumerated type which describes the BFD @var{abfd}'s
@ -703,8 +693,7 @@ DESCRIPTION
*/
enum bfd_architecture
bfd_get_arch (abfd)
bfd *abfd;
bfd_get_arch (bfd *abfd)
{
return abfd->arch_info->arch;
}
@ -714,7 +703,7 @@ FUNCTION
bfd_get_mach
SYNOPSIS
unsigned long bfd_get_mach(bfd *abfd);
unsigned long bfd_get_mach (bfd *abfd);
DESCRIPTION
Return the long type which describes the BFD @var{abfd}'s
@ -722,8 +711,7 @@ DESCRIPTION
*/
unsigned long
bfd_get_mach (abfd)
bfd *abfd;
bfd_get_mach (bfd *abfd)
{
return abfd->arch_info->mach;
}
@ -733,7 +721,7 @@ FUNCTION
bfd_arch_bits_per_byte
SYNOPSIS
unsigned int bfd_arch_bits_per_byte(bfd *abfd);
unsigned int bfd_arch_bits_per_byte (bfd *abfd);
DESCRIPTION
Return the number of bits in one of the BFD @var{abfd}'s
@ -741,8 +729,7 @@ DESCRIPTION
*/
unsigned int
bfd_arch_bits_per_byte (abfd)
bfd *abfd;
bfd_arch_bits_per_byte (bfd *abfd)
{
return abfd->arch_info->bits_per_byte;
}
@ -752,7 +739,7 @@ FUNCTION
bfd_arch_bits_per_address
SYNOPSIS
unsigned int bfd_arch_bits_per_address(bfd *abfd);
unsigned int bfd_arch_bits_per_address (bfd *abfd);
DESCRIPTION
Return the number of bits in one of the BFD @var{abfd}'s
@ -760,8 +747,7 @@ DESCRIPTION
*/
unsigned int
bfd_arch_bits_per_address (abfd)
bfd *abfd;
bfd_arch_bits_per_address (bfd *abfd)
{
return abfd->arch_info->bits_per_address;
}
@ -772,17 +758,15 @@ INTERNAL_FUNCTION
SYNOPSIS
const bfd_arch_info_type *bfd_default_compatible
(const bfd_arch_info_type *a,
const bfd_arch_info_type *b);
(const bfd_arch_info_type *a, const bfd_arch_info_type *b);
DESCRIPTION
The default function for testing for compatibility.
*/
const bfd_arch_info_type *
bfd_default_compatible (a, b)
const bfd_arch_info_type *a;
const bfd_arch_info_type *b;
bfd_default_compatible (const bfd_arch_info_type *a,
const bfd_arch_info_type *b)
{
if (a->arch != b->arch)
return NULL;
@ -804,7 +788,8 @@ INTERNAL_FUNCTION
bfd_default_scan
SYNOPSIS
bfd_boolean bfd_default_scan(const struct bfd_arch_info *info, const char *string);
bfd_boolean bfd_default_scan
(const struct bfd_arch_info *info, const char *string);
DESCRIPTION
The default function for working out whether this is an
@ -812,9 +797,7 @@ DESCRIPTION
*/
bfd_boolean
bfd_default_scan (info, string)
const bfd_arch_info_type *info;
const char *string;
bfd_default_scan (const bfd_arch_info_type *info, const char *string)
{
const char *ptr_src;
const char *ptr_tst;
@ -1023,15 +1006,14 @@ FUNCTION
bfd_get_arch_info
SYNOPSIS
const bfd_arch_info_type * bfd_get_arch_info(bfd *abfd);
const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
DESCRIPTION
Return the architecture info struct in @var{abfd}.
*/
const bfd_arch_info_type *
bfd_get_arch_info (abfd)
bfd *abfd;
bfd_get_arch_info (bfd *abfd)
{
return abfd->arch_info;
}
@ -1042,9 +1024,7 @@ FUNCTION
SYNOPSIS
const bfd_arch_info_type *bfd_lookup_arch
(enum bfd_architecture
arch,
unsigned long machine);
(enum bfd_architecture arch, unsigned long machine);
DESCRIPTION
Look for the architecure info structure which matches the
@ -1054,9 +1034,7 @@ DESCRIPTION
*/
const bfd_arch_info_type *
bfd_lookup_arch (arch, machine)
enum bfd_architecture arch;
unsigned long machine;
bfd_lookup_arch (enum bfd_architecture arch, unsigned long machine)
{
const bfd_arch_info_type * const *app, *ap;
@ -1080,7 +1058,7 @@ FUNCTION
SYNOPSIS
const char *bfd_printable_arch_mach
(enum bfd_architecture arch, unsigned long machine);
(enum bfd_architecture arch, unsigned long machine);
DESCRIPTION
Return a printable string representing the architecture and
@ -1090,9 +1068,7 @@ DESCRIPTION
*/
const char *
bfd_printable_arch_mach (arch, machine)
enum bfd_architecture arch;
unsigned long machine;
bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine)
{
const bfd_arch_info_type *ap = bfd_lookup_arch (arch, machine);
@ -1106,7 +1082,7 @@ FUNCTION
bfd_octets_per_byte
SYNOPSIS
unsigned int bfd_octets_per_byte(bfd *abfd);
unsigned int bfd_octets_per_byte (bfd *abfd);
DESCRIPTION
Return the number of octets (8-bit quantities) per target byte
@ -1115,8 +1091,7 @@ DESCRIPTION
*/
unsigned int
bfd_octets_per_byte (abfd)
bfd *abfd;
bfd_octets_per_byte (bfd *abfd)
{
return bfd_arch_mach_octets_per_byte (bfd_get_arch (abfd),
bfd_get_mach (abfd));
@ -1127,8 +1102,8 @@ FUNCTION
bfd_arch_mach_octets_per_byte
SYNOPSIS
unsigned int bfd_arch_mach_octets_per_byte(enum bfd_architecture arch,
unsigned long machine);
unsigned int bfd_arch_mach_octets_per_byte
(enum bfd_architecture arch, unsigned long machine);
DESCRIPTION
See bfd_octets_per_byte.
@ -1138,9 +1113,8 @@ DESCRIPTION
*/
unsigned int
bfd_arch_mach_octets_per_byte (arch, mach)
enum bfd_architecture arch;
unsigned long mach;
bfd_arch_mach_octets_per_byte (enum bfd_architecture arch,
unsigned long mach)
{
const bfd_arch_info_type *ap = bfd_lookup_arch (arch, mach);

View File

@ -172,10 +172,8 @@ typedef unsigned long bfd_size_type;
typedef bfd_signed_vma file_ptr;
typedef bfd_vma ufile_ptr;
extern void bfd_sprintf_vma
PARAMS ((bfd *, char *, bfd_vma));
extern void bfd_fprintf_vma
PARAMS ((bfd *, PTR, bfd_vma));
extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
#define printf_vma(x) fprintf_vma(stdout,x)
#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
@ -361,8 +359,7 @@ typedef struct _symbol_info
/* Get the name of a stabs type code. */
extern const char *bfd_get_stab_name
PARAMS ((int));
extern const char *bfd_get_stab_name (int);
/* Hash table routines. There is no way to free up a hash table. */
@ -396,80 +393,73 @@ struct bfd_hash_table
each function should be written to allocate a new block of memory
only if the argument is NULL. */
struct bfd_hash_entry *(*newfunc)
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
/* An objalloc for this hash table. This is a struct objalloc *,
but we use PTR to avoid requiring the inclusion of objalloc.h. */
PTR memory;
but we use void * to avoid requiring the inclusion of objalloc.h. */
void *memory;
};
/* Initialize a hash table. */
extern bfd_boolean bfd_hash_table_init
PARAMS ((struct bfd_hash_table *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *)));
(struct bfd_hash_table *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *));
/* Initialize a hash table specifying a size. */
extern bfd_boolean bfd_hash_table_init_n
PARAMS ((struct bfd_hash_table *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *),
unsigned int size));
(struct bfd_hash_table *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *),
unsigned int size);
/* Free up a hash table. */
extern void bfd_hash_table_free
PARAMS ((struct bfd_hash_table *));
(struct bfd_hash_table *);
/* Look up a string in a hash table. If CREATE is TRUE, a new entry
will be created for this string if one does not already exist. The
COPY argument must be TRUE if this routine should copy the string
into newly allocated memory when adding an entry. */
extern struct bfd_hash_entry *bfd_hash_lookup
PARAMS ((struct bfd_hash_table *, const char *, bfd_boolean create,
bfd_boolean copy));
(struct bfd_hash_table *, const char *, bfd_boolean create,
bfd_boolean copy);
/* Replace an entry in a hash table. */
extern void bfd_hash_replace
PARAMS ((struct bfd_hash_table *, struct bfd_hash_entry *old,
struct bfd_hash_entry *nw));
(struct bfd_hash_table *, struct bfd_hash_entry *old,
struct bfd_hash_entry *nw);
/* Base method for creating a hash table entry. */
extern struct bfd_hash_entry *bfd_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *,
const char *));
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
/* Grab some space for a hash table entry. */
extern PTR bfd_hash_allocate
PARAMS ((struct bfd_hash_table *, unsigned int));
extern void *bfd_hash_allocate
(struct bfd_hash_table *, unsigned int);
/* Traverse a hash table in a random order, calling a function on each
element. If the function returns FALSE, the traversal stops. The
INFO argument is passed to the function. */
extern void bfd_hash_traverse
PARAMS ((struct bfd_hash_table *,
bfd_boolean (*) (struct bfd_hash_entry *, PTR),
PTR info));
(struct bfd_hash_table *,
bfd_boolean (*) (struct bfd_hash_entry *, void *),
void *info);
#define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table
#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
/* User program access to BFD facilities. */
/* Direct I/O routines, for programs which know more about the object
file than BFD does. Use higher level routines if possible. */
extern bfd_size_type bfd_bread
PARAMS ((PTR, bfd_size_type, bfd *));
extern bfd_size_type bfd_bwrite
PARAMS ((const PTR, bfd_size_type, bfd *));
extern int bfd_seek
PARAMS ((bfd *, file_ptr, int));
extern ufile_ptr bfd_tell
PARAMS ((bfd *));
extern int bfd_flush
PARAMS ((bfd *));
extern int bfd_stat
PARAMS ((bfd *, struct stat *));
extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
extern int bfd_seek (bfd *, file_ptr, int);
extern ufile_ptr bfd_tell (bfd *);
extern int bfd_flush (bfd *);
extern int bfd_stat (bfd *, struct stat *);
/* Deprecated old routines. */
#if __GNUC__
@ -487,8 +477,7 @@ extern int bfd_stat
(warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
#endif
extern void warn_deprecated
PARAMS ((const char *, const char *, int, const char *));
extern void warn_deprecated (const char *, const char *, int, const char *);
/* Cast from const char * to char * so that caller can assign to
a char * without a warning. */
@ -527,58 +516,38 @@ extern void warn_deprecated
#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
extern bfd_boolean bfd_cache_close
PARAMS ((bfd *abfd));
(bfd *abfd);
/* NB: This declaration should match the autogenerated one in libbfd.h. */
extern bfd_boolean bfd_record_phdr
PARAMS ((bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
bfd_boolean, bfd_boolean, unsigned int, struct sec **));
(bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
bfd_boolean, bfd_boolean, unsigned int, struct sec **);
/* Byte swapping routines. */
bfd_vma bfd_getb64
PARAMS ((const unsigned char *));
bfd_vma bfd_getl64
PARAMS ((const unsigned char *));
bfd_signed_vma bfd_getb_signed_64
PARAMS ((const unsigned char *));
bfd_signed_vma bfd_getl_signed_64
PARAMS ((const unsigned char *));
bfd_vma bfd_getb32
PARAMS ((const unsigned char *));
bfd_vma bfd_getl32
PARAMS ((const unsigned char *));
bfd_signed_vma bfd_getb_signed_32
PARAMS ((const unsigned char *));
bfd_signed_vma bfd_getl_signed_32
PARAMS ((const unsigned char *));
bfd_vma bfd_getb16
PARAMS ((const unsigned char *));
bfd_vma bfd_getl16
PARAMS ((const unsigned char *));
bfd_signed_vma bfd_getb_signed_16
PARAMS ((const unsigned char *));
bfd_signed_vma bfd_getl_signed_16
PARAMS ((const unsigned char *));
void bfd_putb64
PARAMS ((bfd_vma, unsigned char *));
void bfd_putl64
PARAMS ((bfd_vma, unsigned char *));
void bfd_putb32
PARAMS ((bfd_vma, unsigned char *));
void bfd_putl32
PARAMS ((bfd_vma, unsigned char *));
void bfd_putb16
PARAMS ((bfd_vma, unsigned char *));
void bfd_putl16
PARAMS ((bfd_vma, unsigned char *));
bfd_vma bfd_getb64 (const unsigned char *);
bfd_vma bfd_getl64 (const unsigned char *);
bfd_signed_vma bfd_getb_signed_64 (const unsigned char *);
bfd_signed_vma bfd_getl_signed_64 (const unsigned char *);
bfd_vma bfd_getb32 (const unsigned char *);
bfd_vma bfd_getl32 (const unsigned char *);
bfd_signed_vma bfd_getb_signed_32 (const unsigned char *);
bfd_signed_vma bfd_getl_signed_32 (const unsigned char *);
bfd_vma bfd_getb16 (const unsigned char *);
bfd_vma bfd_getl16 (const unsigned char *);
bfd_signed_vma bfd_getb_signed_16 (const unsigned char *);
bfd_signed_vma bfd_getl_signed_16 (const unsigned char *);
void bfd_putb64 (bfd_vma, unsigned char *);
void bfd_putl64 (bfd_vma, unsigned char *);
void bfd_putb32 (bfd_vma, unsigned char *);
void bfd_putl32 (bfd_vma, unsigned char *);
void bfd_putb16 (bfd_vma, unsigned char *);
void bfd_putl16 (bfd_vma, unsigned char *);
/* Byte swapping routines which take size and endiannes as arguments. */
bfd_vma bfd_get_bits
PARAMS ((bfd_byte *, int, bfd_boolean));
void bfd_put_bits
PARAMS ((bfd_vma, bfd_byte *, int, bfd_boolean));
bfd_vma bfd_get_bits (bfd_byte *, int, bfd_boolean);
void bfd_put_bits (bfd_vma, bfd_byte *, int, bfd_boolean);
/* Externally visible ECOFF routines. */
@ -592,55 +561,48 @@ struct bfd_link_hash_entry;
struct bfd_elf_version_tree;
#endif
extern bfd_vma bfd_ecoff_get_gp_value
PARAMS ((bfd * abfd));
(bfd * abfd);
extern bfd_boolean bfd_ecoff_set_gp_value
PARAMS ((bfd *abfd, bfd_vma gp_value));
(bfd *abfd, bfd_vma gp_value);
extern bfd_boolean bfd_ecoff_set_regmasks
PARAMS ((bfd *abfd, unsigned long gprmask, unsigned long fprmask,
unsigned long *cprmask));
extern PTR bfd_ecoff_debug_init
PARAMS ((bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap,
struct bfd_link_info *));
(bfd *abfd, unsigned long gprmask, unsigned long fprmask,
unsigned long *cprmask);
extern void *bfd_ecoff_debug_init
(bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
extern void bfd_ecoff_debug_free
PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap,
struct bfd_link_info *));
(void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
extern bfd_boolean bfd_ecoff_debug_accumulate
PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap,
bfd *input_bfd, struct ecoff_debug_info *input_debug,
const struct ecoff_debug_swap *input_swap,
struct bfd_link_info *));
(void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
struct ecoff_debug_info *input_debug,
const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
extern bfd_boolean bfd_ecoff_debug_accumulate_other
PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
struct bfd_link_info *));
(void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
struct bfd_link_info *);
extern bfd_boolean bfd_ecoff_debug_externals
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap,
bfd_boolean relocatable,
bfd_boolean (*get_extr) (struct symbol_cache_entry *,
struct ecoff_extr *),
void (*set_index) (struct symbol_cache_entry *,
bfd_size_type)));
(bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
bfd_boolean (*get_extr) (struct symbol_cache_entry *, struct ecoff_extr *),
void (*set_index) (struct symbol_cache_entry *, bfd_size_type));
extern bfd_boolean bfd_ecoff_debug_one_external
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap,
const char *name, struct ecoff_extr *esym));
(bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap, const char *name,
struct ecoff_extr *esym);
extern bfd_size_type bfd_ecoff_debug_size
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap));
(bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap);
extern bfd_boolean bfd_ecoff_write_debug
PARAMS ((bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap, file_ptr where));
(bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap, file_ptr where);
extern bfd_boolean bfd_ecoff_write_accumulated_debug
PARAMS ((PTR handle, bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap,
struct bfd_link_info *info, file_ptr where));
(void *handle, bfd *abfd, struct ecoff_debug_info *debug,
const struct ecoff_debug_swap *swap,
struct bfd_link_info *info, file_ptr where);
extern bfd_boolean bfd_mips_ecoff_create_embedded_relocs
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
char **));
(bfd *, struct bfd_link_info *, struct sec *, struct sec *, char **);
/* Externally visible ELF routines. */
@ -652,37 +614,35 @@ struct bfd_link_needed_list
};
extern bfd_boolean bfd_elf_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *, bfd_boolean));
(bfd *, struct bfd_link_info *, const char *, bfd_boolean);
extern struct bfd_link_needed_list *bfd_elf_get_needed_list
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_elf_get_bfd_needed_list
PARAMS ((bfd *, struct bfd_link_needed_list **));
(bfd *, struct bfd_link_needed_list **);
extern bfd_boolean bfd_elf32_size_dynamic_sections
PARAMS ((bfd *, const char *, const char *, const char *,
const char * const *, struct bfd_link_info *, struct sec **,
struct bfd_elf_version_tree *));
(bfd *, const char *, const char *, const char *, const char * const *,
struct bfd_link_info *, struct sec **, struct bfd_elf_version_tree *);
extern bfd_boolean bfd_elf64_size_dynamic_sections
PARAMS ((bfd *, const char *, const char *, const char *,
const char * const *, struct bfd_link_info *, struct sec **,
struct bfd_elf_version_tree *));
(bfd *, const char *, const char *, const char *, const char * const *,
struct bfd_link_info *, struct sec **, struct bfd_elf_version_tree *);
extern void bfd_elf_set_dt_needed_name
PARAMS ((bfd *, const char *));
(bfd *, const char *);
extern void bfd_elf_set_dt_needed_soname
PARAMS ((bfd *, const char *));
(bfd *, const char *);
extern const char *bfd_elf_get_dt_soname
PARAMS ((bfd *));
(bfd *);
extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_elf32_discard_info
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_elf64_discard_info
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
/* Return an upper bound on the number of bytes required to store a
copy of ABFD's program header table entries. Return -1 if an error
occurs; bfd_get_error will return an appropriate code. */
extern long bfd_get_elf_phdr_upper_bound
PARAMS ((bfd *abfd));
(bfd *abfd);
/* Copy ABFD's program header table entries to *PHDRS. The entries
will be stored as an array of Elf_Internal_Phdr structures, as
@ -692,7 +652,7 @@ extern long bfd_get_elf_phdr_upper_bound
Return the number of program header table entries read, or -1 if an
error occurs; bfd_get_error will return an appropriate code. */
extern int bfd_get_elf_phdrs
PARAMS ((bfd *abfd, void *phdrs));
(bfd *abfd, void *phdrs);
/* Create a new BFD as if by bfd_openr. Rather than opening a file,
reconstruct an ELF file by reading the segments out of remote memory
@ -707,42 +667,39 @@ extern int bfd_get_elf_phdrs
be a BFD for an ELF target with the word size and byte order found in
the remote memory. */
extern bfd *bfd_elf_bfd_from_remote_memory
PARAMS ((bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
int (*target_read_memory) (bfd_vma vma, char *myaddr, int len)));
(bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
int (*target_read_memory) (bfd_vma vma, char *myaddr, int len));
/* Return the arch_size field of an elf bfd, or -1 if not elf. */
extern int bfd_get_arch_size
PARAMS ((bfd *));
(bfd *);
/* Return TRUE if address "naturally" sign extends, or -1 if not elf. */
extern int bfd_get_sign_extend_vma
PARAMS ((bfd *));
(bfd *);
extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
char **));
(bfd *, struct bfd_link_info *, struct sec *, struct sec *, char **);
extern bfd_boolean bfd_mips_elf32_create_embedded_relocs
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
char **));
(bfd *, struct bfd_link_info *, struct sec *, struct sec *, char **);
/* SunOS shared library support routines for the linker. */
extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_sunos_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *));
(bfd *, struct bfd_link_info *, const char *);
extern bfd_boolean bfd_sunos_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *, struct sec **, struct sec **,
struct sec **));
(bfd *, struct bfd_link_info *, struct sec **, struct sec **, struct sec **);
/* Linux shared library support routines for the linker. */
extern bfd_boolean bfd_i386linux_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_m68klinux_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_sparclinux_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
/* mmap hacks */
@ -752,7 +709,7 @@ typedef struct _bfd_window_internal bfd_window_internal;
typedef struct _bfd_window
{
/* What the user asked for. */
PTR data;
void *data;
bfd_size_type size;
/* The actual window used by BFD. Small user-requested read-only
regions sharing a page may share a single window into the object
@ -765,36 +722,35 @@ typedef struct _bfd_window
bfd_window;
extern void bfd_init_window
PARAMS ((bfd_window *));
(bfd_window *);
extern void bfd_free_window
PARAMS ((bfd_window *));
(bfd_window *);
extern bfd_boolean bfd_get_file_window
PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean));
(bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
/* XCOFF support routines for the linker. */
extern bfd_boolean bfd_xcoff_link_record_set
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
bfd_size_type));
(bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
extern bfd_boolean bfd_xcoff_import_symbol
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *,
bfd_vma, const char *, const char *, const char *, unsigned int));
(bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
const char *, const char *, const char *, unsigned int);
extern bfd_boolean bfd_xcoff_export_symbol
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *));
(bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
extern bfd_boolean bfd_xcoff_link_count_reloc
PARAMS ((bfd *, struct bfd_link_info *, const char *));
(bfd *, struct bfd_link_info *, const char *);
extern bfd_boolean bfd_xcoff_record_link_assignment
PARAMS ((bfd *, struct bfd_link_info *, const char *));
(bfd *, struct bfd_link_info *, const char *);
extern bfd_boolean bfd_xcoff_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *, const char *, const char *,
unsigned long, unsigned long, unsigned long, bfd_boolean,
int, bfd_boolean, bfd_boolean, struct sec **, bfd_boolean));
(bfd *, struct bfd_link_info *, const char *, const char *,
unsigned long, unsigned long, unsigned long, bfd_boolean,
int, bfd_boolean, bfd_boolean, struct sec **, bfd_boolean);
extern bfd_boolean bfd_xcoff_link_generate_rtinit
PARAMS ((bfd *, const char *, const char *, bfd_boolean));
(bfd *, const char *, const char *, bfd_boolean);
/* XCOFF support routines for ar. */
extern bfd_boolean bfd_xcoff_ar_archive_set_magic
PARAMS ((bfd *, char *));
(bfd *, char *);
/* Externally visible COFF routines. */
@ -804,65 +760,64 @@ union internal_auxent;
#endif
extern bfd_boolean bfd_coff_get_syment
PARAMS ((bfd *, struct symbol_cache_entry *, struct internal_syment *));
(bfd *, struct symbol_cache_entry *, struct internal_syment *);
extern bfd_boolean bfd_coff_get_auxent
PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *));
(bfd *, struct symbol_cache_entry *, int, union internal_auxent *);
extern bfd_boolean bfd_coff_set_symbol_class
PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int));
(bfd *, struct symbol_cache_entry *, unsigned int);
extern bfd_boolean bfd_m68k_coff_create_embedded_relocs
PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *,
char **));
(bfd *, struct bfd_link_info *, struct sec *, struct sec *, char **);
/* ARM Interworking support. Called from linker. */
extern bfd_boolean bfd_arm_allocate_interworking_sections
PARAMS ((struct bfd_link_info *));
(struct bfd_link_info *);
extern bfd_boolean bfd_arm_process_before_allocation
PARAMS ((bfd *, struct bfd_link_info *, int));
(bfd *, struct bfd_link_info *, int);
extern bfd_boolean bfd_arm_get_bfd_for_interworking
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
/* PE ARM Interworking support. Called from linker. */
extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
PARAMS ((struct bfd_link_info *));
(struct bfd_link_info *);
extern bfd_boolean bfd_arm_pe_process_before_allocation
PARAMS ((bfd *, struct bfd_link_info *, int));
(bfd *, struct bfd_link_info *, int);
extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
/* ELF ARM Interworking support. Called from linker. */
extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
PARAMS ((struct bfd_link_info *));
(struct bfd_link_info *);
extern bfd_boolean bfd_elf32_arm_process_before_allocation
PARAMS ((bfd *, struct bfd_link_info *, int));
(bfd *, struct bfd_link_info *, int);
extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
/* ARM Note section processing. */
extern bfd_boolean bfd_arm_merge_machines
PARAMS ((bfd *, bfd *));
(bfd *, bfd *);
extern bfd_boolean bfd_arm_update_notes
PARAMS ((bfd *, const char *));
(bfd *, const char *);
extern unsigned int bfd_arm_get_mach_from_notes
PARAMS ((bfd *, const char *));
(bfd *, const char *);
/* TI COFF load page support. */
extern void bfd_ticoff_set_section_load_page
PARAMS ((struct sec *, int));
(struct sec *, int);
extern int bfd_ticoff_get_section_load_page
PARAMS ((struct sec *));
(struct sec *);

File diff suppressed because it is too large Load Diff

227
bfd/bfd.c
View File

@ -52,7 +52,7 @@ CODE_FRAGMENT
. is the result of an fopen on the filename. However, if the
. BFD_IN_MEMORY flag is set, then iostream is actually a pointer
. to a bfd_in_memory struct. *}
. PTR iostream;
. void *iostream;
.
. {* Is the file descriptor being cached? That is, can it be closed as
. needed, and re-opened when accessed later? *}
@ -138,7 +138,7 @@ CODE_FRAGMENT
. const struct bfd_arch_info *arch_info;
.
. {* Stuff only useful for archives. *}
. PTR arelt_data;
. void *arelt_data;
. struct bfd *my_archive; {* The containing archive BFD. *}
. struct bfd *next; {* The next BFD in the archive. *}
. struct bfd *archive_head; {* The first BFD in the archive. *}
@ -188,17 +188,17 @@ CODE_FRAGMENT
. struct bfd_pef_data_struct *pef_data;
. struct bfd_pef_xlib_data_struct *pef_xlib_data;
. struct bfd_sym_data_struct *sym_data;
. PTR any;
. void *any;
. }
. tdata;
.
. {* Used by the application to hold private data. *}
. PTR usrdata;
. void *usrdata;
.
. {* Where all the allocated stuff under this BFD goes. This is a
. struct objalloc *, but we use PTR to avoid requiring the inclusion of
. objalloc.h. *}
. PTR memory;
. struct objalloc *, but we use void * to avoid requiring the inclusion
. of objalloc.h. *}
. void *memory;
.};
.
*/
@ -206,13 +206,7 @@ CODE_FRAGMENT
#include "bfd.h"
#include "bfdver.h"
#include "sysdep.h"
#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "libiberty.h"
#include "safe-ctype.h"
#include "bfdlink.h"
@ -317,7 +311,7 @@ DESCRIPTION
*/
bfd_error_type
bfd_get_error ()
bfd_get_error (void)
{
return bfd_error;
}
@ -334,8 +328,7 @@ DESCRIPTION
*/
void
bfd_set_error (error_tag)
bfd_error_type error_tag;
bfd_set_error (bfd_error_type error_tag)
{
bfd_error = error_tag;
}
@ -353,8 +346,7 @@ DESCRIPTION
*/
const char *
bfd_errmsg (error_tag)
bfd_error_type error_tag;
bfd_errmsg (bfd_error_type error_tag)
{
#ifndef errno
extern int errno;
@ -362,11 +354,10 @@ bfd_errmsg (error_tag)
if (error_tag == bfd_error_system_call)
return xstrerror (errno);
if ((((int) error_tag < (int) bfd_error_no_error) ||
((int) error_tag > (int) bfd_error_invalid_error_code)))
error_tag = bfd_error_invalid_error_code;/* sanity check */
if (error_tag > bfd_error_invalid_error_code)
error_tag = bfd_error_invalid_error_code; /* sanity check */
return _(bfd_errmsgs [(int)error_tag]);
return _(bfd_errmsgs [error_tag]);
}
/*
@ -385,12 +376,11 @@ DESCRIPTION
*/
void
bfd_perror (message)
const char *message;
bfd_perror (const char *message)
{
if (bfd_get_error () == bfd_error_system_call)
/* Must be a system error then. */
perror ((char *)message);
perror ((char *) message);
else
{
if (message == NULL || *message == '\0')
@ -412,7 +402,7 @@ SUBSECTION
CODE_FRAGMENT
.
.typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...));
.typedef void (*bfd_error_handler_type) (const char *, ...);
.
*/
@ -422,20 +412,19 @@ static const char *_bfd_error_program_name;
/* This is the default routine to handle BFD error messages. */
static void _bfd_default_error_handler PARAMS ((const char *s, ...));
static void
_bfd_default_error_handler VPARAMS ((const char *s, ...))
_bfd_default_error_handler (const char *s, ...)
{
va_list p;
if (_bfd_error_program_name != NULL)
fprintf (stderr, "%s: ", _bfd_error_program_name);
else
fprintf (stderr, "BFD: ");
VA_OPEN (p, s);
VA_FIXEDARG (p, const char *, s);
va_start (p, s);
vfprintf (stderr, s, p);
VA_CLOSE (p);
va_end (p);
fprintf (stderr, "\n");
}
@ -461,8 +450,7 @@ DESCRIPTION
*/
bfd_error_handler_type
bfd_set_error_handler (pnew)
bfd_error_handler_type pnew;
bfd_set_error_handler (bfd_error_handler_type pnew)
{
bfd_error_handler_type pold;
@ -486,8 +474,7 @@ DESCRIPTION
*/
void
bfd_set_error_program_name (name)
const char *name;
bfd_set_error_program_name (const char *name)
{
_bfd_error_program_name = name;
}
@ -504,7 +491,7 @@ DESCRIPTION
*/
bfd_error_handler_type
bfd_get_error_handler ()
bfd_get_error_handler (void)
{
return _bfd_error_handler;
}
@ -523,8 +510,7 @@ DESCRIPTION
*/
const char *
bfd_archive_filename (abfd)
bfd *abfd;
bfd_archive_filename (bfd *abfd)
{
if (abfd->my_archive)
{
@ -539,7 +525,7 @@ bfd_archive_filename (abfd)
if (curr)
free (buf);
curr = needed + (needed >> 1);
buf = bfd_malloc ((bfd_size_type) curr);
buf = bfd_malloc (curr);
/* If we can't malloc, fail safe by returning just the file
name. This function is only used when building error
messages. */
@ -577,9 +563,7 @@ DESCRIPTION
*/
long
bfd_get_reloc_upper_bound (abfd, asect)
bfd *abfd;
sec_ptr asect;
bfd_get_reloc_upper_bound (bfd *abfd, sec_ptr asect)
{
if (abfd->format != bfd_object)
{
@ -596,10 +580,7 @@ FUNCTION
SYNOPSIS
long bfd_canonicalize_reloc
(bfd *abfd,
asection *sec,
arelent **loc,
asymbol **syms);
(bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
DESCRIPTION
Call the back end associated with the open BFD
@ -615,11 +596,10 @@ DESCRIPTION
*/
long
bfd_canonicalize_reloc (abfd, asect, location, symbols)
bfd *abfd;
sec_ptr asect;
arelent **location;
asymbol **symbols;
bfd_canonicalize_reloc (bfd *abfd,
sec_ptr asect,
arelent **location,
asymbol **symbols)
{
if (abfd->format != bfd_object)
{
@ -647,11 +627,10 @@ DESCRIPTION
*/
void
bfd_set_reloc (ignore_abfd, asect, location, count)
bfd *ignore_abfd ATTRIBUTE_UNUSED;
sec_ptr asect;
arelent **location;
unsigned int count;
bfd_set_reloc (bfd *ignore_abfd ATTRIBUTE_UNUSED,
sec_ptr asect,
arelent **location,
unsigned int count)
{
asect->orelocation = location;
asect->reloc_count = count;
@ -678,9 +657,7 @@ DESCRIPTION
*/
bfd_boolean
bfd_set_file_flags (abfd, flags)
bfd *abfd;
flagword flags;
bfd_set_file_flags (bfd *abfd, flagword flags)
{
if (abfd->format != bfd_object)
{
@ -705,9 +682,7 @@ bfd_set_file_flags (abfd, flags)
}
void
bfd_assert (file, line)
const char *file;
int line;
bfd_assert (const char *file, int line)
{
(*_bfd_error_handler) (_("BFD %s assertion fail %s:%d"),
BFD_VERSION_STRING, file, line);
@ -721,10 +696,7 @@ bfd_assert (file, line)
#endif
void
_bfd_abort (file, line, fn)
const char *file;
int line;
const char *fn;
_bfd_abort (const char *file, int line, const char *fn)
{
if (fn != NULL)
(*_bfd_error_handler)
@ -755,11 +727,10 @@ RETURNS
*/
int
bfd_get_arch_size (abfd)
bfd *abfd;
bfd_get_arch_size (bfd *abfd)
{
if (abfd->xvec->flavour == bfd_target_elf_flavour)
return (get_elf_backend_data (abfd))->s->arch_size;
return get_elf_backend_data (abfd)->s->arch_size;
return -1;
}
@ -786,13 +757,12 @@ RETURNS
*/
int
bfd_get_sign_extend_vma (abfd)
bfd *abfd;
bfd_get_sign_extend_vma (bfd *abfd)
{
char *name;
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
return (get_elf_backend_data (abfd)->sign_extend_vma);
return get_elf_backend_data (abfd)->sign_extend_vma;
name = bfd_get_target (abfd);
@ -823,9 +793,7 @@ RETURNS
*/
bfd_boolean
bfd_set_start_address (abfd, vma)
bfd *abfd;
bfd_vma vma;
bfd_set_start_address (bfd *abfd, bfd_vma vma)
{
abfd->start_address = vma;
return TRUE;
@ -845,8 +813,7 @@ DESCRIPTION
*/
unsigned int
bfd_get_gp_size (abfd)
bfd *abfd;
bfd_get_gp_size (bfd *abfd)
{
if (abfd->format == bfd_object)
{
@ -872,9 +839,7 @@ DESCRIPTION
*/
void
bfd_set_gp_size (abfd, i)
bfd *abfd;
unsigned int i;
bfd_set_gp_size (bfd *abfd, unsigned int i)
{
/* Don't try to set GP size on an archive or core file! */
if (abfd->format != bfd_object)
@ -891,8 +856,7 @@ bfd_set_gp_size (abfd, i)
register. */
bfd_vma
_bfd_get_gp_value (abfd)
bfd *abfd;
_bfd_get_gp_value (bfd *abfd)
{
if (! abfd)
return 0;
@ -910,9 +874,7 @@ _bfd_get_gp_value (abfd)
/* Set the GP value. */
void
_bfd_set_gp_value (abfd, v)
bfd *abfd;
bfd_vma v;
_bfd_set_gp_value (bfd *abfd, bfd_vma v)
{
if (! abfd)
BFD_FAIL ();
@ -947,10 +909,7 @@ DESCRIPTION
*/
bfd_vma
bfd_scan_vma (string, end, base)
const char *string;
const char **end;
int base;
bfd_scan_vma (const char *string, const char **end, int base)
{
bfd_vma value;
bfd_vma cutoff;
@ -959,7 +918,7 @@ bfd_scan_vma (string, end, base)
/* Let the host do it if possible. */
if (sizeof (bfd_vma) <= sizeof (unsigned long))
return (bfd_vma) strtoul (string, (char **) end, base);
return strtoul (string, (char **) end, base);
if (base == 0)
{
@ -1155,27 +1114,23 @@ DESCRIPTION
. BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
.
.extern bfd_byte *bfd_get_relocated_section_contents
. PARAMS ((bfd *, struct bfd_link_info *,
. struct bfd_link_order *, bfd_byte *,
. bfd_boolean, asymbol **));
. (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
. bfd_boolean, asymbol **);
.
*/
bfd_byte *
bfd_get_relocated_section_contents (abfd, link_info, link_order, data,
relocatable, symbols)
bfd *abfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
bfd_byte *data;
bfd_boolean relocatable;
asymbol **symbols;
bfd_get_relocated_section_contents (bfd *abfd,
struct bfd_link_info *link_info,
struct bfd_link_order *link_order,
bfd_byte *data,
bfd_boolean relocatable,
asymbol **symbols)
{
bfd *abfd2;
bfd_byte *(*fn) PARAMS ((bfd *, struct bfd_link_info *,
struct bfd_link_order *, bfd_byte *, bfd_boolean,
asymbol **));
bfd_byte *(*fn) (bfd *, struct bfd_link_info *, struct bfd_link_order *,
bfd_byte *, bfd_boolean, asymbol **);
if (link_order->type == bfd_indirect_link_order)
{
@ -1194,18 +1149,16 @@ bfd_get_relocated_section_contents (abfd, link_info, link_order, data,
/* Record information about an ELF program header. */
bfd_boolean
bfd_record_phdr (abfd, type, flags_valid, flags, at_valid, at,
includes_filehdr, includes_phdrs, count, secs)
bfd *abfd;
unsigned long type;
bfd_boolean flags_valid;
flagword flags;
bfd_boolean at_valid;
bfd_vma at;
bfd_boolean includes_filehdr;
bfd_boolean includes_phdrs;
unsigned int count;
asection **secs;
bfd_record_phdr (bfd *abfd,
unsigned long type,
bfd_boolean flags_valid,
flagword flags,
bfd_boolean at_valid,
bfd_vma at,
bfd_boolean includes_filehdr,
bfd_boolean includes_phdrs,
unsigned int count,
asection **secs)
{
struct elf_segment_map *m, **pm;
bfd_size_type amt;
@ -1215,7 +1168,7 @@ bfd_record_phdr (abfd, type, flags_valid, flags, at_valid, at,
amt = sizeof (struct elf_segment_map);
amt += ((bfd_size_type) count - 1) * sizeof (asection *);
m = (struct elf_segment_map *) bfd_alloc (abfd, amt);
m = bfd_alloc (abfd, amt);
if (m == NULL)
return FALSE;
@ -1223,10 +1176,10 @@ bfd_record_phdr (abfd, type, flags_valid, flags, at_valid, at,
m->p_type = type;
m->p_flags = flags;
m->p_paddr = at;
m->p_flags_valid = (unsigned int) flags_valid;
m->p_paddr_valid = (unsigned int) at_valid;
m->includes_filehdr = (unsigned int) includes_filehdr;
m->includes_phdrs = (unsigned int) includes_phdrs;
m->p_flags_valid = flags_valid;
m->p_paddr_valid = at_valid;
m->includes_filehdr = includes_filehdr;
m->includes_phdrs = includes_phdrs;
m->count = count;
if (count > 0)
memcpy (m->sections, secs, count * sizeof (asection *));
@ -1239,10 +1192,7 @@ bfd_record_phdr (abfd, type, flags_valid, flags, at_valid, at,
}
void
bfd_sprintf_vma (abfd, buf, value)
bfd *abfd;
char *buf;
bfd_vma value;
bfd_sprintf_vma (bfd *abfd, char *buf, bfd_vma value)
{
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
get_elf_backend_data (abfd)->elf_backend_sprintf_vma (abfd, buf, value);
@ -1251,10 +1201,7 @@ bfd_sprintf_vma (abfd, buf, value)
}
void
bfd_fprintf_vma (abfd, stream, value)
bfd *abfd;
PTR stream;
bfd_vma value;
bfd_fprintf_vma (bfd *abfd, void *stream, bfd_vma value)
{
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
get_elf_backend_data (abfd)->elf_backend_fprintf_vma (abfd, stream, value);
@ -1279,9 +1226,7 @@ DESCRIPTION
*/
bfd_boolean
bfd_alt_mach_code (abfd, alternative)
bfd *abfd;
int alternative;
bfd_alt_mach_code (bfd *abfd, int alternative)
{
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
{
@ -1322,8 +1267,8 @@ CODE_FRAGMENT
.struct bfd_preserve
.{
. PTR marker;
. PTR tdata;
. void *marker;
. void *tdata;
. flagword flags;
. const struct bfd_arch_info *arch_info;
. struct sec *sections;
@ -1355,9 +1300,7 @@ DESCRIPTION
*/
bfd_boolean
bfd_preserve_save (abfd, preserve)
bfd *abfd;
struct bfd_preserve *preserve;
bfd_preserve_save (bfd *abfd, struct bfd_preserve *preserve)
{
preserve->tdata = abfd->tdata.any;
preserve->arch_info = abfd->arch_info;
@ -1395,9 +1338,7 @@ DESCRIPTION
*/
void
bfd_preserve_restore (abfd, preserve)
bfd *abfd;
struct bfd_preserve *preserve;
bfd_preserve_restore (bfd *abfd, struct bfd_preserve *preserve)
{
bfd_hash_table_free (&abfd->section_htab);
@ -1433,9 +1374,7 @@ DESCRIPTION
*/
void
bfd_preserve_finish (abfd, preserve)
bfd *abfd ATTRIBUTE_UNUSED;
struct bfd_preserve *preserve;
bfd_preserve_finish (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

View File

@ -43,13 +43,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
contents (0 for non-archive elements). For archive entries this is the
first octet in the file, NOT the beginning of the archive header. */
static size_t real_read PARAMS ((PTR where, size_t a, size_t b, FILE *file));
static size_t
real_read (where, a, b, file)
PTR where;
size_t a;
size_t b;
FILE *file;
real_read (void *where, size_t a, size_t b, FILE *file)
{
/* FIXME - this looks like an optimization, but it's really to cover
up for a feature of some OSs (not solaris - sigh) that
@ -76,10 +71,7 @@ real_read (where, a, b, file)
/* Return value is amount read. */
bfd_size_type
bfd_bread (ptr, size, abfd)
PTR ptr;
bfd_size_type size;
bfd *abfd;
bfd_bread (void *ptr, bfd_size_type size, bfd *abfd)
{
size_t nread;
@ -88,7 +80,7 @@ bfd_bread (ptr, size, abfd)
struct bfd_in_memory *bim;
bfd_size_type get;
bim = (struct bfd_in_memory *) abfd->iostream;
bim = abfd->iostream;
get = size;
if (abfd->where + get > bim->size)
{
@ -126,16 +118,13 @@ bfd_bread (ptr, size, abfd)
}
bfd_size_type
bfd_bwrite (ptr, size, abfd)
const PTR ptr;
bfd_size_type size;
bfd *abfd;
bfd_bwrite (const void *ptr, bfd_size_type size, bfd *abfd)
{
size_t nwrote;
if ((abfd->flags & BFD_IN_MEMORY) != 0)
{
struct bfd_in_memory *bim = (struct bfd_in_memory *) (abfd->iostream);
struct bfd_in_memory *bim = abfd->iostream;
size = (size_t) size;
if (abfd->where + size > bim->size)
{
@ -147,7 +136,7 @@ bfd_bwrite (ptr, size, abfd)
newsize = (bim->size + 127) & ~(bfd_size_type) 127;
if (newsize > oldsize)
{
bim->buffer = (bfd_byte *) bfd_realloc (bim->buffer, newsize);
bim->buffer = bfd_realloc (bim->buffer, newsize);
if (bim->buffer == 0)
{
bim->size = 0;
@ -174,8 +163,7 @@ bfd_bwrite (ptr, size, abfd)
}
bfd_vma
bfd_tell (abfd)
bfd *abfd;
bfd_tell (bfd *abfd)
{
file_ptr ptr;
@ -191,8 +179,7 @@ bfd_tell (abfd)
}
int
bfd_flush (abfd)
bfd *abfd;
bfd_flush (bfd *abfd)
{
if ((abfd->flags & BFD_IN_MEMORY) != 0)
return 0;
@ -202,9 +189,7 @@ bfd_flush (abfd)
/* Returns 0 for success, negative value for failure (in which case
bfd_get_error can retrieve the error code). */
int
bfd_stat (abfd, statbuf)
bfd *abfd;
struct stat *statbuf;
bfd_stat (bfd *abfd, struct stat *statbuf)
{
FILE *f;
int result;
@ -228,10 +213,7 @@ bfd_stat (abfd, statbuf)
can retrieve the error code). */
int
bfd_seek (abfd, position, direction)
bfd *abfd;
file_ptr position;
int direction;
bfd_seek (bfd *abfd, file_ptr position, int direction)
{
int result;
FILE *f;
@ -249,7 +231,7 @@ bfd_seek (abfd, position, direction)
{
struct bfd_in_memory *bim;
bim = (struct bfd_in_memory *) abfd->iostream;
bim = abfd->iostream;
if (direction == SEEK_SET)
abfd->where = position;
@ -268,7 +250,7 @@ bfd_seek (abfd, position, direction)
newsize = (bim->size + 127) & ~(bfd_size_type) 127;
if (newsize > oldsize)
{
bim->buffer = (bfd_byte *) bfd_realloc (bim->buffer, newsize);
bim->buffer = bfd_realloc (bim->buffer, newsize);
if (bim->buffer == 0)
{
bim->size = 0;
@ -359,7 +341,7 @@ FUNCTION
bfd_get_mtime
SYNOPSIS
long bfd_get_mtime(bfd *abfd);
long bfd_get_mtime (bfd *abfd);
DESCRIPTION
Return the file modification time (as read from the file system, or
@ -368,8 +350,7 @@ DESCRIPTION
*/
long
bfd_get_mtime (abfd)
bfd *abfd;
bfd_get_mtime (bfd *abfd)
{
FILE *fp;
struct stat buf;
@ -390,7 +371,7 @@ FUNCTION
bfd_get_size
SYNOPSIS
long bfd_get_size(bfd *abfd);
long bfd_get_size (bfd *abfd);
DESCRIPTION
Return the file size (as read from file system) for the file
@ -419,8 +400,7 @@ DESCRIPTION
*/
long
bfd_get_size (abfd)
bfd *abfd;
bfd_get_size (bfd *abfd)
{
FILE *fp;
struct stat buf;

View File

@ -52,7 +52,7 @@ INTERNAL_DEFINITION
.struct _bfd_window_internal {
. struct _bfd_window_internal *next;
. PTR data;
. void *data;
. bfd_size_type size;
. int refcount : 31; {* should be enough... *}
. unsigned mapped : 1; {* 1 = mmap, 0 = malloc *}
@ -60,8 +60,7 @@ INTERNAL_DEFINITION
*/
void
bfd_init_window (windowp)
bfd_window *windowp;
bfd_init_window (bfd_window *windowp)
{
windowp->data = 0;
windowp->i = 0;
@ -69,8 +68,7 @@ bfd_init_window (windowp)
}
void
bfd_free_window (windowp)
bfd_window *windowp;
bfd_free_window (bfd_window *windowp)
{
bfd_window_internal *i = windowp->i;
windowp->i = 0;
@ -108,12 +106,11 @@ bfd_free_window (windowp)
static int ok_to_map = 1;
bfd_boolean
bfd_get_file_window (abfd, offset, size, windowp, writable)
bfd *abfd;
file_ptr offset;
bfd_size_type size;
bfd_window *windowp;
bfd_boolean writable;
bfd_get_file_window (bfd *abfd,
file_ptr offset,
bfd_size_type size,
bfd_window *windowp,
bfd_boolean writable)
{
static size_t pagesize;
bfd_window_internal *i = windowp->i;
@ -133,8 +130,7 @@ bfd_get_file_window (abfd, offset, size, windowp, writable)
if (i == 0)
{
i = ((bfd_window_internal *)
bfd_zmalloc ((bfd_size_type) sizeof (bfd_window_internal)));
i = bfd_zmalloc (sizeof (bfd_window_internal));
windowp->i = i;
if (i == 0)
return FALSE;
@ -180,7 +176,7 @@ bfd_get_file_window (abfd, offset, size, windowp, writable)
? MAP_FILE | MAP_PRIVATE
: MAP_FILE | MAP_SHARED),
fd, file_offset);
if (i->data == (PTR) -1)
if (i->data == (void *) -1)
{
/* An error happened. Report it, or try using malloc, or
something. */
@ -195,7 +191,7 @@ bfd_get_file_window (abfd, offset, size, windowp, writable)
fprintf (stderr, "\n\tmapped %ld at %p, offset is %ld\n",
(long) real_size, i->data, (long) offset2);
i->size = real_size;
windowp->data = (PTR) ((bfd_byte *) i->data + offset2);
windowp->data = (bfd_byte *) i->data + offset2;
windowp->size = size;
i->mapped = 1;
return TRUE;
@ -222,7 +218,7 @@ bfd_get_file_window (abfd, offset, size, windowp, writable)
if (debug_windows)
fprintf (stderr, "\n\t%s(%6ld)",
i->data ? "realloc" : " malloc", (long) size_to_alloc);
i->data = (PTR) bfd_realloc (i->data, size_to_alloc);
i->data = bfd_realloc (i->data, size_to_alloc);
if (debug_windows)
fprintf (stderr, "\t-> %p\n", i->data);
i->refcount = 1;

View File

@ -1,5 +1,5 @@
/* BFD library -- caching of file descriptors.
Copyright 1990, 1991, 1992, 1993, 1994, 1996, 2000, 2001, 2002
Copyright 1990, 1991, 1992, 1993, 1994, 1996, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
@ -40,10 +40,7 @@ SECTION
#include "sysdep.h"
#include "libbfd.h"
static void insert PARAMS ((bfd *));
static void snip PARAMS ((bfd *));
static bfd_boolean close_one PARAMS ((void));
static bfd_boolean bfd_cache_delete PARAMS ((bfd *));
static bfd_boolean bfd_cache_delete (bfd *);
/*
INTERNAL_FUNCTION
@ -95,9 +92,8 @@ bfd *bfd_last_cache;
/* Insert a BFD into the cache. */
static INLINE void
insert (abfd)
bfd *abfd;
static void
insert (bfd *abfd)
{
if (bfd_last_cache == NULL)
{
@ -116,9 +112,8 @@ insert (abfd)
/* Remove a BFD from the cache. */
static INLINE void
snip (abfd)
bfd *abfd;
static void
snip (bfd *abfd)
{
abfd->lru_prev->lru_next = abfd->lru_next;
abfd->lru_next->lru_prev = abfd->lru_prev;
@ -134,7 +129,7 @@ snip (abfd)
recently used cacheable BFD and close it. */
static bfd_boolean
close_one ()
close_one (void)
{
register bfd *kill;
@ -168,8 +163,7 @@ close_one ()
/* Close a BFD and remove it from the cache. */
static bfd_boolean
bfd_cache_delete (abfd)
bfd *abfd;
bfd_cache_delete (bfd *abfd)
{
bfd_boolean ret;
@ -201,8 +195,7 @@ DESCRIPTION
*/
bfd_boolean
bfd_cache_init (abfd)
bfd *abfd;
bfd_cache_init (bfd *abfd)
{
BFD_ASSERT (abfd->iostream != NULL);
if (open_files >= BFD_CACHE_MAX_OPEN)
@ -232,8 +225,7 @@ RETURNS
*/
bfd_boolean
bfd_cache_close (abfd)
bfd *abfd;
bfd_cache_close (bfd *abfd)
{
if (abfd->iostream == NULL
|| (abfd->flags & BFD_IN_MEMORY) != 0)
@ -247,7 +239,7 @@ INTERNAL_FUNCTION
bfd_open_file
SYNOPSIS
FILE* bfd_open_file(bfd *abfd);
FILE* bfd_open_file (bfd *abfd);
DESCRIPTION
Call the OS to open a file for @var{abfd}. Return the <<FILE *>>
@ -258,8 +250,7 @@ DESCRIPTION
*/
FILE *
bfd_open_file (abfd)
bfd *abfd;
bfd_open_file (bfd *abfd)
{
abfd->cacheable = TRUE; /* Allow it to be closed later. */
@ -331,7 +322,7 @@ INTERNAL_FUNCTION
bfd_cache_lookup_worker
SYNOPSIS
FILE *bfd_cache_lookup_worker(bfd *abfd);
FILE *bfd_cache_lookup_worker (bfd *abfd);
DESCRIPTION
Called when the macro <<bfd_cache_lookup>> fails to find a
@ -342,8 +333,7 @@ DESCRIPTION
*/
FILE *
bfd_cache_lookup_worker (abfd)
bfd *abfd;
bfd_cache_lookup_worker (bfd *abfd)
{
if ((abfd->flags & BFD_IN_MEMORY) != 0)
abort ();

View File

@ -1,5 +1,5 @@
/* Core file generic interface routines for BFD.
Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2002
Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -36,7 +36,7 @@ FUNCTION
bfd_core_file_failing_command
SYNOPSIS
const char *bfd_core_file_failing_command(bfd *abfd);
const char *bfd_core_file_failing_command (bfd *abfd);
DESCRIPTION
Return a read-only string explaining which program was running
@ -45,13 +45,13 @@ DESCRIPTION
*/
const char *
bfd_core_file_failing_command (abfd)
bfd *abfd;
bfd_core_file_failing_command (bfd *abfd)
{
if (abfd->format != bfd_core) {
bfd_set_error (bfd_error_invalid_operation);
return NULL;
}
if (abfd->format != bfd_core)
{
bfd_set_error (bfd_error_invalid_operation);
return NULL;
}
return BFD_SEND (abfd, _core_file_failing_command, (abfd));
}
@ -60,7 +60,7 @@ FUNCTION
bfd_core_file_failing_signal
SYNOPSIS
int bfd_core_file_failing_signal(bfd *abfd);
int bfd_core_file_failing_signal (bfd *abfd);
DESCRIPTION
Returns the signal number which caused the core dump which
@ -68,13 +68,13 @@ DESCRIPTION
*/
int
bfd_core_file_failing_signal (abfd)
bfd *abfd;
bfd_core_file_failing_signal (bfd *abfd)
{
if (abfd->format != bfd_core) {
bfd_set_error (bfd_error_invalid_operation);
return 0;
}
if (abfd->format != bfd_core)
{
bfd_set_error (bfd_error_invalid_operation);
return 0;
}
return BFD_SEND (abfd, _core_file_failing_signal, (abfd));
}
@ -84,22 +84,23 @@ FUNCTION
SYNOPSIS
bfd_boolean core_file_matches_executable_p
(bfd *core_bfd, bfd *exec_bfd);
(bfd *core_bfd, bfd *exec_bfd);
DESCRIPTION
Return <<TRUE>> if the core file attached to @var{core_bfd}
was generated by a run of the executable file attached to
@var{exec_bfd}, <<FALSE>> otherwise.
*/
bfd_boolean
core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd, *exec_bfd;
{
if ((core_bfd->format != bfd_core) || (exec_bfd->format != bfd_object)) {
bfd_set_error (bfd_error_wrong_format);
return FALSE;
}
return BFD_SEND (core_bfd, _core_file_matches_executable_p,
(core_bfd, exec_bfd));
bfd_boolean
core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd)
{
if (core_bfd->format != bfd_core || exec_bfd->format != bfd_object)
{
bfd_set_error (bfd_error_wrong_format);
return FALSE;
}
return BFD_SEND (core_bfd, _core_file_matches_executable_p,
(core_bfd, exec_bfd));
}

View File

@ -1,3 +1,7 @@
2003-06-29 Alan Modra <amodra@bigpond.net.au>
* chew.c (paramstuff): Don't emit PARAMS.
2003-02-12 Bob Wilson <bob.wilson@acm.org>
* bfd.texinfo: Fix quotes for texinfo. Make section title

View File

@ -1,6 +1,6 @@
/* chew
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001,
2002
2002, 2003
Free Software Foundation, Inc.
Contributed by steve chamberlain @cygnus
@ -494,8 +494,11 @@ paramstuff ()
string_type out;
init_string (&out);
#define NO_PARAMS 1
/* Make sure that it's not already param'd or proto'd. */
if (find (tos, "PARAMS") || find (tos, "PROTO") || !find (tos, "("))
if (NO_PARAMS
|| find (tos, "PARAMS") || find (tos, "PROTO") || !find (tos, "("))
{
catstr (&out, tos);
}

View File

@ -95,8 +95,8 @@ static asection bfd_debug_section =
NULL, NULL, 0, 0, 0,
/* line_filepos, userdata, contents, lineno, lineno_count, */
0, NULL, NULL, NULL, 0,
/* entsize, comdat, moving_line_filepos, */
0, NULL, 0,
/* entsize, comdat, kept_section, moving_line_filepos, */
0, NULL, NULL, 0,
/* target_index, used_by_bfd, constructor_chain, owner, */
0, NULL, NULL, NULL,
/* symbol, */

View File

@ -86,9 +86,7 @@ DESCRIPTION
*/
bfd_boolean
bfd_check_format (abfd, format)
bfd *abfd;
bfd_format format;
bfd_check_format (bfd *abfd, bfd_format format)
{
return bfd_check_format_matches (abfd, format, NULL);
}
@ -98,8 +96,8 @@ FUNCTION
bfd_check_format_matches
SYNOPSIS
bfd_boolean bfd_check_format_matches (bfd *abfd, bfd_format format,
char ***matching);
bfd_boolean bfd_check_format_matches
(bfd *abfd, bfd_format format, char ***matching);
DESCRIPTION
Like <<bfd_check_format>>, except when it returns FALSE with
@ -114,10 +112,7 @@ DESCRIPTION
*/
bfd_boolean
bfd_check_format_matches (abfd, format, matching)
bfd *abfd;
bfd_format format;
char ***matching;
bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
{
extern const bfd_target binary_vec;
const bfd_target * const *target;
@ -148,7 +143,7 @@ bfd_check_format_matches (abfd, format, matching)
*matching = NULL;
amt = sizeof (*matching_vector) * 2 * _bfd_target_vector_entries;
matching_vector = (const bfd_target **) bfd_malloc (amt);
matching_vector = bfd_malloc (amt);
if (!matching_vector)
return FALSE;
}
@ -165,7 +160,7 @@ bfd_check_format_matches (abfd, format, matching)
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) /* rewind! */
{
if (matching)
free ((PTR) matching_vector);
free (matching_vector);
return FALSE;
}
@ -176,7 +171,7 @@ bfd_check_format_matches (abfd, format, matching)
abfd->xvec = right_targ; /* Set the target as returned. */
if (matching)
free ((PTR) matching_vector);
free (matching_vector);
return TRUE; /* File position has moved, BTW. */
}
@ -199,7 +194,7 @@ bfd_check_format_matches (abfd, format, matching)
abfd->format = bfd_unknown;
if (matching)
free ((PTR) matching_vector);
free (matching_vector);
bfd_set_error (bfd_error_file_not_recognized);
@ -220,7 +215,7 @@ bfd_check_format_matches (abfd, format, matching)
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
{
if (matching)
free ((PTR) matching_vector);
free (matching_vector);
return FALSE;
}
@ -279,7 +274,7 @@ bfd_check_format_matches (abfd, format, matching)
abfd->format = bfd_unknown;
if (matching)
free ((PTR) matching_vector);
free (matching_vector);
return FALSE;
}
@ -332,7 +327,7 @@ bfd_check_format_matches (abfd, format, matching)
abfd->xvec = right_targ; /* Change BFD's target permanently. */
if (matching)
free ((PTR) matching_vector);
free (matching_vector);
return TRUE; /* File position has moved, BTW. */
}
@ -345,7 +340,7 @@ bfd_check_format_matches (abfd, format, matching)
bfd_set_error (bfd_error_file_not_recognized);
if (matching)
free ((PTR) matching_vector);
free (matching_vector);
}
else
{
@ -383,9 +378,7 @@ DESCRIPTION
*/
bfd_boolean
bfd_set_format (abfd, format)
bfd *abfd;
bfd_format format;
bfd_set_format (bfd *abfd, bfd_format format)
{
if (bfd_read_p (abfd)
|| (unsigned int) abfd->format >= (unsigned int) bfd_type_end)
@ -423,11 +416,10 @@ DESCRIPTION
*/
const char *
bfd_format_string (format)
bfd_format format;
bfd_format_string (bfd_format format)
{
if (((int)format <(int) bfd_unknown)
|| ((int)format >=(int) bfd_type_end))
if (((int) format < (int) bfd_unknown)
|| ((int) format >= (int) bfd_type_end))
return "invalid";
switch (format)

View File

@ -35,7 +35,7 @@ FUNCTION
bfd_init
SYNOPSIS
void bfd_init(void);
void bfd_init (void);
DESCRIPTION
This routine must be called before any other BFD function to
@ -46,6 +46,6 @@ DESCRIPTION
However, someday it may be needed, so keep it around. */
void
bfd_init ()
bfd_init (void)
{
}

View File

@ -1,7 +1,7 @@
/* libbfd.h -- Declarations used by bfd library *implementation*.
(This include file is not for users of the library.)
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002
2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -36,7 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* 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. */
#define set_tdata(bfd, v) ((bfd)->tdata.any = (PTR) (v))
#define set_tdata(bfd, v) ((bfd)->tdata.any = (v))
/* If BFD_IN_MEMORY is set for a BFD, then the iostream fields points
to an instance of this structure. */
@ -69,7 +69,7 @@ struct artdata {
archive. */
file_ptr armap_datepos; /* Position within archive to seek to
rewrite the date field. */
PTR tdata; /* Backend specific information. */
void *tdata; /* Backend specific information. */
};
#define bfd_ardata(bfd) ((bfd)->tdata.aout_ar_data)
@ -83,105 +83,105 @@ struct areltdata {
#define arelt_size(bfd) (((struct areltdata *)((bfd)->arelt_data))->parsed_size)
extern PTR bfd_malloc
PARAMS ((bfd_size_type));
extern PTR bfd_realloc
PARAMS ((PTR, bfd_size_type));
extern PTR bfd_zmalloc
PARAMS ((bfd_size_type));
extern void *bfd_malloc
(bfd_size_type);
extern void *bfd_realloc
(void *, bfd_size_type);
extern void *bfd_zmalloc
(bfd_size_type);
extern bfd_error_handler_type _bfd_error_handler;
/* These routines allocate and free things on the BFD's objalloc. */
extern PTR bfd_alloc
PARAMS ((bfd *, bfd_size_type));
extern PTR bfd_zalloc
PARAMS ((bfd *, bfd_size_type));
extern void *bfd_alloc
(bfd *, bfd_size_type);
extern void *bfd_zalloc
(bfd *, bfd_size_type);
extern void bfd_release
PARAMS ((bfd *, PTR));
(bfd *, void *);
bfd * _bfd_create_empty_archive_element_shell
PARAMS ((bfd *obfd));
(bfd *obfd);
bfd * _bfd_look_for_bfd_in_cache
PARAMS ((bfd *, file_ptr));
(bfd *, file_ptr);
bfd_boolean _bfd_add_bfd_to_archive_cache
PARAMS ((bfd *, file_ptr, bfd *));
(bfd *, file_ptr, bfd *);
bfd_boolean _bfd_generic_mkarchive
PARAMS ((bfd *abfd));
(bfd *abfd);
const bfd_target *bfd_generic_archive_p
PARAMS ((bfd *abfd));
(bfd *abfd);
bfd_boolean bfd_slurp_armap
PARAMS ((bfd *abfd));
(bfd *abfd);
bfd_boolean bfd_slurp_bsd_armap_f2
PARAMS ((bfd *abfd));
(bfd *abfd);
#define bfd_slurp_bsd_armap bfd_slurp_armap
#define bfd_slurp_coff_armap bfd_slurp_armap
bfd_boolean _bfd_slurp_extended_name_table
PARAMS ((bfd *abfd));
(bfd *abfd);
extern bfd_boolean _bfd_construct_extended_name_table
PARAMS ((bfd *, bfd_boolean, char **, bfd_size_type *));
(bfd *, bfd_boolean, char **, bfd_size_type *);
bfd_boolean _bfd_write_archive_contents
PARAMS ((bfd *abfd));
(bfd *abfd);
bfd_boolean _bfd_compute_and_write_armap
PARAMS ((bfd *, unsigned int elength));
(bfd *, unsigned int elength);
bfd *_bfd_get_elt_at_filepos
PARAMS ((bfd *archive, file_ptr filepos));
(bfd *archive, file_ptr filepos);
extern bfd *_bfd_generic_get_elt_at_index
PARAMS ((bfd *, symindex));
(bfd *, symindex);
bfd * _bfd_new_bfd
PARAMS ((void));
(void);
void _bfd_delete_bfd
PARAMS ((bfd *));
(bfd *);
bfd_boolean bfd_false
PARAMS ((bfd *ignore));
(bfd *ignore);
bfd_boolean bfd_true
PARAMS ((bfd *ignore));
PTR bfd_nullvoidptr
PARAMS ((bfd *ignore));
(bfd *ignore);
void *bfd_nullvoidptr
(bfd *ignore);
int bfd_0
PARAMS ((bfd *ignore));
(bfd *ignore);
unsigned int bfd_0u
PARAMS ((bfd *ignore));
(bfd *ignore);
long bfd_0l
PARAMS ((bfd *ignore));
(bfd *ignore);
long _bfd_n1
PARAMS ((bfd *ignore));
(bfd *ignore);
void bfd_void
PARAMS ((bfd *ignore));
(bfd *ignore);
bfd *_bfd_new_bfd_contained_in
PARAMS ((bfd *));
(bfd *);
const bfd_target *_bfd_dummy_target
PARAMS ((bfd *abfd));
(bfd *abfd);
void bfd_dont_truncate_arname
PARAMS ((bfd *abfd, const char *filename, char *hdr));
(bfd *abfd, const char *filename, char *hdr);
void bfd_bsd_truncate_arname
PARAMS ((bfd *abfd, const char *filename, char *hdr));
(bfd *abfd, const char *filename, char *hdr);
void bfd_gnu_truncate_arname
PARAMS ((bfd *abfd, const char *filename, char *hdr));
(bfd *abfd, const char *filename, char *hdr);
bfd_boolean bsd_write_armap
PARAMS ((bfd *arch, unsigned int elength, struct orl *map,
unsigned int orl_count, int stridx));
(bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count,
int stridx);
bfd_boolean coff_write_armap
PARAMS ((bfd *arch, unsigned int elength, struct orl *map,
unsigned int orl_count, int stridx));
(bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count,
int stridx);
extern PTR _bfd_generic_read_ar_hdr
PARAMS ((bfd *));
extern void *_bfd_generic_read_ar_hdr
(bfd *);
extern PTR _bfd_generic_read_ar_hdr_mag
PARAMS ((bfd *, const char *));
extern void *_bfd_generic_read_ar_hdr_mag
(bfd *, const char *);
bfd * bfd_generic_openr_next_archived_file
PARAMS ((bfd *archive, bfd *last_file));
(bfd *archive, bfd *last_file);
int bfd_generic_stat_arch_elt
PARAMS ((bfd *, struct stat *));
(bfd *, struct stat *);
#define _bfd_read_ar_hdr(abfd) \
BFD_SEND (abfd, _bfd_read_ar_hdr_fn, (abfd))
@ -192,37 +192,37 @@ int bfd_generic_stat_arch_elt
#define _bfd_generic_close_and_cleanup bfd_true
#define _bfd_generic_bfd_free_cached_info bfd_true
#define _bfd_generic_new_section_hook \
((bfd_boolean (*) PARAMS ((bfd *, asection *))) bfd_true)
((bfd_boolean (*) (bfd *, asection *)) bfd_true)
extern bfd_boolean _bfd_generic_get_section_contents
PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
(bfd *, asection *, void *, file_ptr, bfd_size_type);
extern bfd_boolean _bfd_generic_get_section_contents_in_window
PARAMS ((bfd *, asection *, bfd_window *, file_ptr, bfd_size_type));
(bfd *, asection *, bfd_window *, file_ptr, bfd_size_type);
/* Generic routines to use for BFD_JUMP_TABLE_COPY. Use
BFD_JUMP_TABLE_COPY (_bfd_generic). */
#define _bfd_generic_bfd_copy_private_bfd_data \
((bfd_boolean (*) PARAMS ((bfd *, bfd *))) bfd_true)
((bfd_boolean (*) (bfd *, bfd *)) bfd_true)
#define _bfd_generic_bfd_merge_private_bfd_data \
((bfd_boolean (*) PARAMS ((bfd *, bfd *))) bfd_true)
((bfd_boolean (*) (bfd *, bfd *)) bfd_true)
#define _bfd_generic_bfd_set_private_flags \
((bfd_boolean (*) PARAMS ((bfd *, flagword))) bfd_true)
((bfd_boolean (*) (bfd *, flagword)) bfd_true)
#define _bfd_generic_bfd_copy_private_section_data \
((bfd_boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_true)
((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true)
#define _bfd_generic_bfd_copy_private_symbol_data \
((bfd_boolean (*) PARAMS ((bfd *, asymbol *, bfd *, asymbol *))) bfd_true)
((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true)
#define _bfd_generic_bfd_print_private_bfd_data \
((bfd_boolean (*) PARAMS ((bfd *, PTR))) bfd_true)
((bfd_boolean (*) (bfd *, void *)) bfd_true)
/* Routines to use for BFD_JUMP_TABLE_CORE when there is no core file
support. Use BFD_JUMP_TABLE_CORE (_bfd_nocore). */
extern char *_bfd_nocore_core_file_failing_command
PARAMS ((bfd *));
(bfd *);
extern int _bfd_nocore_core_file_failing_signal
PARAMS ((bfd *));
(bfd *);
extern bfd_boolean _bfd_nocore_core_file_matches_executable_p
PARAMS ((bfd *, bfd *));
(bfd *, bfd *);
/* Routines to use for BFD_JUMP_TABLE_ARCHIVE when there is no archive
file support. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive). */
@ -230,20 +230,18 @@ extern bfd_boolean _bfd_nocore_core_file_matches_executable_p
#define _bfd_noarchive_slurp_armap bfd_false
#define _bfd_noarchive_slurp_extended_name_table bfd_false
#define _bfd_noarchive_construct_extended_name_table \
((bfd_boolean (*) \
PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \
((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) \
bfd_false)
#define _bfd_noarchive_truncate_arname \
((void (*) PARAMS ((bfd *, const char *, char *))) bfd_void)
((void (*) (bfd *, const char *, char *)) bfd_void)
#define _bfd_noarchive_write_armap \
((bfd_boolean (*) \
PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int))) \
((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) \
bfd_false)
#define _bfd_noarchive_read_ar_hdr bfd_nullvoidptr
#define _bfd_noarchive_openr_next_archived_file \
((bfd *(*) PARAMS ((bfd *, bfd *))) bfd_nullvoidptr)
((bfd *(*) (bfd *, bfd *)) bfd_nullvoidptr)
#define _bfd_noarchive_get_elt_at_index \
((bfd *(*) PARAMS ((bfd *, symindex))) bfd_nullvoidptr)
((bfd *(*) (bfd *, symindex)) bfd_nullvoidptr)
#define _bfd_noarchive_generic_stat_arch_elt bfd_generic_stat_arch_elt
#define _bfd_noarchive_update_armap_timestamp bfd_false
@ -254,7 +252,7 @@ extern bfd_boolean _bfd_nocore_core_file_matches_executable_p
#define _bfd_archive_bsd_slurp_extended_name_table \
_bfd_slurp_extended_name_table
extern bfd_boolean _bfd_archive_bsd_construct_extended_name_table
PARAMS ((bfd *, char **, bfd_size_type *, const char **));
(bfd *, char **, bfd_size_type *, const char **);
#define _bfd_archive_bsd_truncate_arname bfd_bsd_truncate_arname
#define _bfd_archive_bsd_write_armap bsd_write_armap
#define _bfd_archive_bsd_read_ar_hdr _bfd_generic_read_ar_hdr
@ -264,7 +262,7 @@ extern bfd_boolean _bfd_archive_bsd_construct_extended_name_table
#define _bfd_archive_bsd_generic_stat_arch_elt \
bfd_generic_stat_arch_elt
extern bfd_boolean _bfd_archive_bsd_update_armap_timestamp
PARAMS ((bfd *));
(bfd *);
/* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get COFF style
archives. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff). */
@ -273,7 +271,7 @@ extern bfd_boolean _bfd_archive_bsd_update_armap_timestamp
#define _bfd_archive_coff_slurp_extended_name_table \
_bfd_slurp_extended_name_table
extern bfd_boolean _bfd_archive_coff_construct_extended_name_table
PARAMS ((bfd *, char **, bfd_size_type *, const char **));
(bfd *, char **, bfd_size_type *, const char **);
#define _bfd_archive_coff_truncate_arname bfd_dont_truncate_arname
#define _bfd_archive_coff_write_armap coff_write_armap
#define _bfd_archive_coff_read_ar_hdr _bfd_generic_read_ar_hdr
@ -289,49 +287,46 @@ extern bfd_boolean _bfd_archive_coff_construct_extended_name_table
#define _bfd_nosymbols_get_symtab_upper_bound _bfd_n1
#define _bfd_nosymbols_get_symtab \
((long (*) PARAMS ((bfd *, asymbol **))) _bfd_n1)
((long (*) (bfd *, asymbol **)) _bfd_n1)
#define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol
#define _bfd_nosymbols_print_symbol \
((void (*) PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type))) bfd_void)
((void (*) (bfd *, void *, asymbol *, bfd_print_symbol_type)) bfd_void)
#define _bfd_nosymbols_get_symbol_info \
((void (*) PARAMS ((bfd *, asymbol *, symbol_info *))) bfd_void)
((void (*) (bfd *, asymbol *, symbol_info *)) bfd_void)
#define _bfd_nosymbols_bfd_is_local_label_name \
((bfd_boolean (*) PARAMS ((bfd *, const char *))) bfd_false)
((bfd_boolean (*) (bfd *, const char *)) bfd_false)
#define _bfd_nosymbols_get_lineno \
((alent *(*) PARAMS ((bfd *, asymbol *))) bfd_nullvoidptr)
((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr)
#define _bfd_nosymbols_find_nearest_line \
((bfd_boolean (*) \
PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, \
const char **, unsigned int *))) \
((bfd_boolean (*) (bfd *, asection *, asymbol **, bfd_vma, const char **, \
const char **, unsigned int *)) \
bfd_false)
#define _bfd_nosymbols_bfd_make_debug_symbol \
((asymbol *(*) PARAMS ((bfd *, PTR, unsigned long))) bfd_nullvoidptr)
((asymbol *(*) (bfd *, void *, unsigned long)) bfd_nullvoidptr)
#define _bfd_nosymbols_read_minisymbols \
((long (*) PARAMS ((bfd *, bfd_boolean, PTR *, unsigned int *))) _bfd_n1)
((long (*) (bfd *, bfd_boolean, void **, unsigned int *)) _bfd_n1)
#define _bfd_nosymbols_minisymbol_to_symbol \
((asymbol *(*) PARAMS ((bfd *, bfd_boolean, const PTR, asymbol *))) \
((asymbol *(*) (bfd *, bfd_boolean, const void *, asymbol *)) \
bfd_nullvoidptr)
/* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc
support. Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs). */
#define _bfd_norelocs_get_reloc_upper_bound \
((long (*) PARAMS ((bfd *, asection *))) _bfd_n1)
((long (*) (bfd *, asection *)) _bfd_n1)
#define _bfd_norelocs_canonicalize_reloc \
((long (*) PARAMS ((bfd *, asection *, arelent **, asymbol **))) _bfd_n1)
((long (*) (bfd *, asection *, arelent **, asymbol **)) _bfd_n1)
#define _bfd_norelocs_bfd_reloc_type_lookup \
((reloc_howto_type *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) \
bfd_nullvoidptr)
((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr)
/* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not
be written. Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite). */
#define _bfd_nowrite_set_arch_mach \
((bfd_boolean (*) PARAMS ((bfd *, enum bfd_architecture, unsigned long))) \
((bfd_boolean (*) (bfd *, enum bfd_architecture, unsigned long)) \
bfd_false)
#define _bfd_nowrite_set_section_contents \
((bfd_boolean (*) \
PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type))) \
((bfd_boolean (*) (bfd *, asection *, void *, file_ptr, bfd_size_type)) \
bfd_false)
/* Generic routines to use for BFD_JUMP_TABLE_WRITE. Use
@ -339,45 +334,41 @@ extern bfd_boolean _bfd_archive_coff_construct_extended_name_table
#define _bfd_generic_set_arch_mach bfd_default_set_arch_mach
extern bfd_boolean _bfd_generic_set_section_contents
PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
(bfd *, asection *, void *, file_ptr, bfd_size_type);
/* Routines to use for BFD_JUMP_TABLE_LINK for targets which do not
support linking. Use BFD_JUMP_TABLE_LINK (_bfd_nolink). */
#define _bfd_nolink_sizeof_headers ((int (*) PARAMS ((bfd *, bfd_boolean))) bfd_0)
#define _bfd_nolink_sizeof_headers ((int (*) (bfd *, bfd_boolean)) bfd_0)
#define _bfd_nolink_bfd_get_relocated_section_contents \
((bfd_byte *(*) \
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, \
bfd_byte *, bfd_boolean, asymbol **))) \
((bfd_byte *(*) (bfd *, struct bfd_link_info *, struct bfd_link_order *, \
bfd_byte *, bfd_boolean, asymbol **)) \
bfd_nullvoidptr)
#define _bfd_nolink_bfd_relax_section \
((bfd_boolean (*) \
PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *))) \
(bfd *, asection *, struct bfd_link_info *, bfd_boolean *)) \
bfd_false)
#define _bfd_nolink_bfd_gc_sections \
((bfd_boolean (*) \
PARAMS ((bfd *, struct bfd_link_info *))) \
((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \
bfd_false)
#define _bfd_nolink_bfd_merge_sections \
((bfd_boolean (*) \
PARAMS ((bfd *, struct bfd_link_info *))) \
((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \
bfd_false)
#define _bfd_nolink_bfd_discard_group \
((bfd_boolean (*) \
PARAMS ((bfd *, struct sec *))) \
((bfd_boolean (*) (bfd *, struct sec *)) \
bfd_false)
#define _bfd_nolink_bfd_link_hash_table_create \
((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr)
((struct bfd_link_hash_table *(*) (bfd *)) bfd_nullvoidptr)
#define _bfd_nolink_bfd_link_hash_table_free \
((void (*) PARAMS ((struct bfd_link_hash_table *))) bfd_void)
((void (*) (struct bfd_link_hash_table *)) bfd_void)
#define _bfd_nolink_bfd_link_add_symbols \
((bfd_boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false)
((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
#define _bfd_nolink_bfd_link_just_syms \
((void (*) PARAMS ((asection *, struct bfd_link_info *))) bfd_void)
((void (*) (asection *, struct bfd_link_info *)) bfd_void)
#define _bfd_nolink_bfd_final_link \
((bfd_boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false)
((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
#define _bfd_nolink_bfd_link_split_section \
((bfd_boolean (*) PARAMS ((bfd *, struct sec *))) bfd_false)
((bfd_boolean (*) (bfd *, struct sec *)) bfd_false)
/* Routines to use for BFD_JUMP_TABLE_DYNAMIC for targets which do not
have dynamic symbols or relocs. Use BFD_JUMP_TABLE_DYNAMIC
@ -385,195 +376,189 @@ extern bfd_boolean _bfd_generic_set_section_contents
#define _bfd_nodynamic_get_dynamic_symtab_upper_bound _bfd_n1
#define _bfd_nodynamic_canonicalize_dynamic_symtab \
((long (*) PARAMS ((bfd *, asymbol **))) _bfd_n1)
((long (*) (bfd *, asymbol **)) _bfd_n1)
#define _bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_n1
#define _bfd_nodynamic_canonicalize_dynamic_reloc \
((long (*) PARAMS ((bfd *, arelent **, asymbol **))) _bfd_n1)
((long (*) (bfd *, arelent **, asymbol **)) _bfd_n1)
/* Generic routine to determine of the given symbol is a local
label. */
extern bfd_boolean bfd_generic_is_local_label_name
PARAMS ((bfd *, const char *));
(bfd *, const char *);
/* Generic minisymbol routines. */
extern long _bfd_generic_read_minisymbols
PARAMS ((bfd *, bfd_boolean, PTR *, unsigned int *));
(bfd *, bfd_boolean, void **, unsigned int *);
extern asymbol *_bfd_generic_minisymbol_to_symbol
PARAMS ((bfd *, bfd_boolean, const PTR, asymbol *));
(bfd *, bfd_boolean, const void *, asymbol *);
/* Find the nearest line using .stab/.stabstr sections. */
extern bfd_boolean _bfd_stab_section_find_nearest_line
PARAMS ((bfd *, asymbol **, asection *, bfd_vma, bfd_boolean *,
const char **, const char **, unsigned int *, PTR *));
(bfd *, asymbol **, asection *, bfd_vma, bfd_boolean *,
const char **, const char **, unsigned int *, void **);
/* Find the neaderst line using DWARF 1 debugging information. */
extern bfd_boolean _bfd_dwarf1_find_nearest_line
PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
const char **, unsigned int *));
(bfd *, asection *, asymbol **, bfd_vma, const char **,
const char **, unsigned int *);
/* Find the nearest line using DWARF 2 debugging information. */
extern bfd_boolean _bfd_dwarf2_find_nearest_line
PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
const char **, unsigned int *, unsigned int,
PTR *));
(bfd *, asection *, asymbol **, bfd_vma, const char **, const char **,
unsigned int *, unsigned int, void **);
/* Create a new section entry. */
extern struct bfd_hash_entry *bfd_section_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
/* A routine to create entries for a bfd_link_hash_table. */
extern struct bfd_hash_entry *_bfd_link_hash_newfunc
PARAMS ((struct bfd_hash_entry *entry,
struct bfd_hash_table *table,
const char *string));
(struct bfd_hash_entry *entry, struct bfd_hash_table *table,
const char *string);
/* Initialize a bfd_link_hash_table. */
extern bfd_boolean _bfd_link_hash_table_init
PARAMS ((struct bfd_link_hash_table *, bfd *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *)));
(struct bfd_link_hash_table *, bfd *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *));
/* Generic link hash table creation routine. */
extern struct bfd_link_hash_table *_bfd_generic_link_hash_table_create
PARAMS ((bfd *));
(bfd *);
/* Generic link hash table destruction routine. */
extern void _bfd_generic_link_hash_table_free
PARAMS ((struct bfd_link_hash_table *));
(struct bfd_link_hash_table *);
/* Generic add symbol routine. */
extern bfd_boolean _bfd_generic_link_add_symbols
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
/* Generic add symbol routine. This version is used by targets for
which the linker must collect constructors and destructors by name,
as the collect2 program does. */
extern bfd_boolean _bfd_generic_link_add_symbols_collect
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
/* Generic archive add symbol routine. */
extern bfd_boolean _bfd_generic_link_add_archive_symbols
PARAMS ((bfd *, struct bfd_link_info *,
bfd_boolean (*) (bfd *, struct bfd_link_info *, bfd_boolean *)));
(bfd *, struct bfd_link_info *,
bfd_boolean (*) (bfd *, struct bfd_link_info *, bfd_boolean *));
/* Forward declaration to avoid prototype errors. */
typedef struct bfd_link_hash_entry _bfd_link_hash_entry;
/* Generic routine to add a single symbol. */
extern bfd_boolean _bfd_generic_link_add_one_symbol
PARAMS ((struct bfd_link_info *, bfd *, const char *name, flagword,
asection *, bfd_vma, const char *, bfd_boolean copy,
bfd_boolean constructor, struct bfd_link_hash_entry **));
(struct bfd_link_info *, bfd *, const char *name, flagword,
asection *, bfd_vma, const char *, bfd_boolean copy,
bfd_boolean constructor, struct bfd_link_hash_entry **);
/* Generic routine to mark section as supplying symbols only. */
extern void _bfd_generic_link_just_syms
PARAMS ((asection *, struct bfd_link_info *));
(asection *, struct bfd_link_info *);
/* Generic link routine. */
extern bfd_boolean _bfd_generic_final_link
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_generic_link_split_section
PARAMS ((bfd *, struct sec *));
(bfd *, struct sec *);
/* Generic reloc_link_order processing routine. */
extern bfd_boolean _bfd_generic_reloc_link_order
PARAMS ((bfd *, struct bfd_link_info *, asection *,
struct bfd_link_order *));
(bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *);
/* Default link order processing routine. */
extern bfd_boolean _bfd_default_link_order
PARAMS ((bfd *, struct bfd_link_info *, asection *,
struct bfd_link_order *));
(bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *);
/* Count the number of reloc entries in a link order list. */
extern unsigned int _bfd_count_link_order_relocs
PARAMS ((struct bfd_link_order *));
(struct bfd_link_order *);
/* Final link relocation routine. */
extern bfd_reloc_status_type _bfd_final_link_relocate
PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *,
bfd_vma, bfd_vma, bfd_vma));
(reloc_howto_type *, bfd *, asection *, bfd_byte *,
bfd_vma, bfd_vma, bfd_vma);
/* Relocate a particular location by a howto and a value. */
extern bfd_reloc_status_type _bfd_relocate_contents
PARAMS ((reloc_howto_type *, bfd *, bfd_vma, bfd_byte *));
(reloc_howto_type *, bfd *, bfd_vma, bfd_byte *);
/* Link stabs in sections in the first pass. */
extern bfd_boolean _bfd_link_section_stabs
PARAMS ((bfd *, PTR *, asection *, asection *, PTR *));
(bfd *, void **, asection *, asection *, void **);
/* Eliminate stabs for discarded functions and symbols. */
extern bfd_boolean _bfd_discard_section_stabs
PARAMS ((bfd *, asection *, PTR,
bfd_boolean (*) (bfd_vma, PTR), PTR));
(bfd *, asection *, void *, bfd_boolean (*) (bfd_vma, void *), void *);
/* Write out the .stab section when linking stabs in sections. */
extern bfd_boolean _bfd_write_section_stabs
PARAMS ((bfd *, PTR *, asection *, PTR *, bfd_byte *));
(bfd *, void **, asection *, void **, bfd_byte *);
/* Write out the .stabstr string table when linking stabs in sections. */
extern bfd_boolean _bfd_write_stab_strings
PARAMS ((bfd *, PTR *));
(bfd *, void **);
/* Find an offset within a .stab section when linking stabs in
sections. */
extern bfd_vma _bfd_stab_section_offset
PARAMS ((bfd *, PTR *, asection *, PTR *, bfd_vma));
(bfd *, void **, asection *, void **, bfd_vma);
/* Attempt to merge a SEC_MERGE section. */
extern bfd_boolean _bfd_merge_section
PARAMS ((bfd *, PTR *, asection *, PTR *));
(bfd *, void **, asection *, void **);
/* Attempt to merge SEC_MERGE sections. */
extern bfd_boolean _bfd_merge_sections
PARAMS ((bfd *, PTR, void (*)(bfd *, asection *)));
(bfd *, void *, void (*) (bfd *, asection *));
/* Write out a merged section. */
extern bfd_boolean _bfd_write_merged_section
PARAMS ((bfd *, asection *, PTR));
(bfd *, asection *, void *);
/* Find an offset within a modified SEC_MERGE section. */
extern bfd_vma _bfd_merged_section_offset
PARAMS ((bfd *, asection **, PTR, bfd_vma, bfd_vma));
(bfd *, asection **, void *, bfd_vma, bfd_vma);
/* Create a string table. */
extern struct bfd_strtab_hash *_bfd_stringtab_init
PARAMS ((void));
(void);
/* Create an XCOFF .debug section style string table. */
extern struct bfd_strtab_hash *_bfd_xcoff_stringtab_init
PARAMS ((void));
(void);
/* Free a string table. */
extern void _bfd_stringtab_free
PARAMS ((struct bfd_strtab_hash *));
(struct bfd_strtab_hash *);
/* Get the size of a string table. */
extern bfd_size_type _bfd_stringtab_size
PARAMS ((struct bfd_strtab_hash *));
(struct bfd_strtab_hash *);
/* Add a string to a string table. */
extern bfd_size_type _bfd_stringtab_add
PARAMS ((struct bfd_strtab_hash *, const char *, bfd_boolean hash,
bfd_boolean copy));
(struct bfd_strtab_hash *, const char *, bfd_boolean hash, bfd_boolean copy);
/* Write out a string table. */
extern bfd_boolean _bfd_stringtab_emit
PARAMS ((bfd *, struct bfd_strtab_hash *));
(bfd *, struct bfd_strtab_hash *);
/* Check that endianness of input and output file match. */
extern bfd_boolean _bfd_generic_verify_endian_match
PARAMS ((bfd *, bfd *));
(bfd *, bfd *);
/* Macros to tell if bfds are read or write enabled.
@ -584,20 +569,22 @@ extern bfd_boolean _bfd_generic_verify_endian_match
!bfd_read_p, and only sometimes bfd_write_p.
*/
#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_read_p(abfd) \
((abfd)->direction == read_direction || (abfd)->direction == both_direction)
#define bfd_write_p(abfd) \
((abfd)->direction == write_direction || (abfd)->direction == both_direction)
void bfd_assert
PARAMS ((const char*,int));
(const char*,int);
#define BFD_ASSERT(x) \
{ if (!(x)) bfd_assert(__FILE__,__LINE__); }
{ if (!(x)) bfd_assert(__FILE__,__LINE__); }
#define BFD_FAIL() \
{ bfd_assert(__FILE__,__LINE__); }
{ bfd_assert(__FILE__,__LINE__); }
extern void _bfd_abort
PARAMS ((const char *, int, const char *)) ATTRIBUTE_NORETURN;
(const char *, int, const char *) ATTRIBUTE_NORETURN;
/* if gcc >= 2.6, we can give a function name, too */
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)
@ -608,7 +595,7 @@ extern void _bfd_abort
#define abort() _bfd_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__)
FILE * bfd_cache_lookup_worker
PARAMS ((bfd *));
(bfd *);
extern bfd *bfd_last_cache;
@ -628,26 +615,27 @@ struct ecoff_find_line;
#endif
extern bfd_boolean _bfd_ecoff_locate_line
PARAMS ((bfd *, asection *, bfd_vma, struct ecoff_debug_info * const,
const struct ecoff_debug_swap * const, struct ecoff_find_line *,
const char **, const char **, unsigned int *));
(bfd *, asection *, bfd_vma, struct ecoff_debug_info * const,
const struct ecoff_debug_swap * const, struct ecoff_find_line *,
const char **, const char **, unsigned int *);
extern bfd_boolean _bfd_ecoff_get_accumulated_pdr
PARAMS ((PTR, bfd_byte *));
(void *, bfd_byte *);
extern bfd_boolean _bfd_ecoff_get_accumulated_sym
PARAMS ((PTR, bfd_byte *));
(void *, bfd_byte *);
extern bfd_boolean _bfd_ecoff_get_accumulated_ss
PARAMS ((PTR, bfd_byte *));
(void *, bfd_byte *);
extern bfd_vma _bfd_get_gp_value
PARAMS ((bfd *));
(bfd *);
extern void _bfd_set_gp_value
PARAMS ((bfd *, bfd_vma));
(bfd *, bfd_vma);
/* Function shared by the COFF and ELF SH backends, which have no
other common header files. */
#ifndef _bfd_sh_align_load_span
extern bfd_boolean _bfd_sh_align_load_span
PARAMS ((bfd *, asection *, bfd_byte *,
bfd_boolean (*) (bfd *, asection *, PTR, bfd_byte *, bfd_vma),
PTR, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, bfd_boolean *));
(bfd *, asection *, bfd_byte *,
bfd_boolean (*) (bfd *, asection *, void *, bfd_byte *, bfd_vma),
void *, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, bfd_boolean *);
#endif

View File

@ -1,6 +1,6 @@
/* Assorted BFD support routines, only used internally.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002
2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -42,8 +42,7 @@ DESCRIPTION
operations. */
bfd_boolean
bfd_false (ignore)
bfd *ignore ATTRIBUTE_UNUSED;
bfd_false (bfd *ignore ATTRIBUTE_UNUSED)
{
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
@ -53,8 +52,7 @@ bfd_false (ignore)
which do not actually do anything. */
bfd_boolean
bfd_true (ignore)
bfd *ignore ATTRIBUTE_UNUSED;
bfd_true (bfd *ignore ATTRIBUTE_UNUSED)
{
return TRUE;
}
@ -62,31 +60,27 @@ bfd_true (ignore)
/* A routine which is used in target vectors for unsupported
operations which return a pointer value. */
PTR
bfd_nullvoidptr (ignore)
bfd *ignore ATTRIBUTE_UNUSED;
void *
bfd_nullvoidptr (bfd *ignore ATTRIBUTE_UNUSED)
{
bfd_set_error (bfd_error_invalid_operation);
return NULL;
}
int
bfd_0 (ignore)
bfd *ignore ATTRIBUTE_UNUSED;
bfd_0 (bfd *ignore ATTRIBUTE_UNUSED)
{
return 0;
}
unsigned int
bfd_0u (ignore)
bfd *ignore ATTRIBUTE_UNUSED;
bfd_0u (bfd *ignore ATTRIBUTE_UNUSED)
{
return 0;
}
long
bfd_0l (ignore)
bfd *ignore ATTRIBUTE_UNUSED;
bfd_0l (bfd *ignore ATTRIBUTE_UNUSED)
{
return 0;
}
@ -95,23 +89,21 @@ bfd_0l (ignore)
operations which return -1 on error. */
long
_bfd_n1 (ignore_abfd)
bfd *ignore_abfd ATTRIBUTE_UNUSED;
_bfd_n1 (bfd *ignore_abfd ATTRIBUTE_UNUSED)
{
bfd_set_error (bfd_error_invalid_operation);
return -1;
}
void
bfd_void (ignore)
bfd *ignore ATTRIBUTE_UNUSED;
bfd_void (bfd *ignore ATTRIBUTE_UNUSED)
{
}
bfd_boolean
_bfd_nocore_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd)
bfd *ignore_core_bfd ATTRIBUTE_UNUSED;
bfd *ignore_exec_bfd ATTRIBUTE_UNUSED;
_bfd_nocore_core_file_matches_executable_p
(bfd *ignore_core_bfd ATTRIBUTE_UNUSED,
bfd *ignore_exec_bfd ATTRIBUTE_UNUSED)
{
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
@ -121,27 +113,24 @@ _bfd_nocore_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd)
without core file support. */
char *
_bfd_nocore_core_file_failing_command (ignore_abfd)
bfd *ignore_abfd ATTRIBUTE_UNUSED;
_bfd_nocore_core_file_failing_command (bfd *ignore_abfd ATTRIBUTE_UNUSED)
{
bfd_set_error (bfd_error_invalid_operation);
return (char *)NULL;
return NULL;
}
/* Routine to handle core_file_failing_signal entry point for targets
without core file support. */
int
_bfd_nocore_core_file_failing_signal (ignore_abfd)
bfd *ignore_abfd ATTRIBUTE_UNUSED;
_bfd_nocore_core_file_failing_signal (bfd *ignore_abfd ATTRIBUTE_UNUSED)
{
bfd_set_error (bfd_error_invalid_operation);
return 0;
}
const bfd_target *
_bfd_dummy_target (ignore_abfd)
bfd *ignore_abfd ATTRIBUTE_UNUSED;
_bfd_dummy_target (bfd *ignore_abfd ATTRIBUTE_UNUSED)
{
bfd_set_error (bfd_error_wrong_format);
return 0;
@ -149,11 +138,10 @@ _bfd_dummy_target (ignore_abfd)
/* Allocate memory using malloc. */
PTR
bfd_malloc (size)
bfd_size_type size;
void *
bfd_malloc (bfd_size_type size)
{
PTR ptr;
void *ptr;
if (size != (size_t) size)
{
@ -161,7 +149,7 @@ bfd_malloc (size)
return NULL;
}
ptr = (PTR) malloc ((size_t) size);
ptr = malloc ((size_t) size);
if (ptr == NULL && (size_t) size != 0)
bfd_set_error (bfd_error_no_memory);
@ -170,12 +158,10 @@ bfd_malloc (size)
/* Reallocate memory using realloc. */
PTR
bfd_realloc (ptr, size)
PTR ptr;
bfd_size_type size;
void *
bfd_realloc (void *ptr, bfd_size_type size)
{
PTR ret;
void *ret;
if (size != (size_t) size)
{
@ -184,9 +170,9 @@ bfd_realloc (ptr, size)
}
if (ptr == NULL)
ret = (PTR) malloc ((size_t) size);
ret = malloc ((size_t) size);
else
ret = (PTR) realloc (ptr, (size_t) size);
ret = realloc (ptr, (size_t) size);
if (ret == NULL && (size_t) size != 0)
bfd_set_error (bfd_error_no_memory);
@ -196,11 +182,10 @@ bfd_realloc (ptr, size)
/* Allocate memory using malloc and clear it. */
PTR
bfd_zmalloc (size)
bfd_size_type size;
void *
bfd_zmalloc (bfd_size_type size)
{
PTR ptr;
void *ptr;
if (size != (size_t) size)
{
@ -208,7 +193,7 @@ bfd_zmalloc (size)
return NULL;
}
ptr = (PTR) malloc ((size_t) size);
ptr = malloc ((size_t) size);
if ((size_t) size != 0)
{
@ -234,13 +219,11 @@ DESCRIPTION
*/
bfd_boolean
bfd_write_bigendian_4byte_int (abfd, i)
bfd *abfd;
unsigned int i;
bfd_write_bigendian_4byte_int (bfd *abfd, unsigned int i)
{
bfd_byte buffer[4];
bfd_putb32 ((bfd_vma) i, buffer);
return bfd_bwrite ((PTR) buffer, (bfd_size_type) 4, abfd) == 4;
return bfd_bwrite (buffer, (bfd_size_type) 4, abfd) == 4;
}
@ -283,54 +266,54 @@ DESCRIPTION
.{* Byte swapping macros for user section data. *}
.
.#define bfd_put_8(abfd, val, ptr) \
. ((void) (*((unsigned char *) (ptr)) = (unsigned char) (val)))
. ((void) (*((unsigned char *) (ptr)) = (unsigned char) (val)))
.#define bfd_put_signed_8 \
. bfd_put_8
. bfd_put_8
.#define bfd_get_8(abfd, ptr) \
. (*(unsigned char *) (ptr) & 0xff)
. (*(unsigned char *) (ptr) & 0xff)
.#define bfd_get_signed_8(abfd, ptr) \
. (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
. (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
.
.#define bfd_put_16(abfd, val, ptr) \
. BFD_SEND(abfd, bfd_putx16, ((val),(ptr)))
. BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
.#define bfd_put_signed_16 \
. bfd_put_16
. bfd_put_16
.#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))
. BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
.
.#define bfd_put_32(abfd, val, ptr) \
. BFD_SEND(abfd, bfd_putx32, ((val),(ptr)))
. BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
.#define bfd_put_signed_32 \
. bfd_put_32
. bfd_put_32
.#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))
. BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
.
.#define bfd_put_64(abfd, val, ptr) \
. BFD_SEND(abfd, bfd_putx64, ((val), (ptr)))
. BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
.#define bfd_put_signed_64 \
. bfd_put_64
. bfd_put_64
.#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))
. BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
.
.#define bfd_get(bits, abfd, ptr) \
. ( (bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
. : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
. : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
. : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
. : (abort (), (bfd_vma) - 1))
.#define bfd_get(bits, abfd, ptr) \
. ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \
. : (bits) == 16 ? bfd_get_16 (abfd, ptr) \
. : (bits) == 32 ? bfd_get_32 (abfd, ptr) \
. : (bits) == 64 ? bfd_get_64 (abfd, ptr) \
. : (abort (), (bfd_vma) - 1))
.
.#define bfd_put(bits, abfd, val, ptr) \
. ( (bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
. : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
. : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
. : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
. : (abort (), (void) 0))
.#define bfd_put(bits, abfd, val, ptr) \
. ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
. : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
. : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
. : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
. : (abort (), (void) 0))
.
*/
@ -435,61 +418,51 @@ DESCRIPTION
/* Sign extension to bfd_signed_vma. */
#define COERCE16(x) (((bfd_signed_vma) (x) ^ 0x8000) - 0x8000)
#define COERCE32(x) \
((bfd_signed_vma) (long) (((unsigned long) (x) ^ 0x80000000) - 0x80000000))
#define EIGHT_GAZILLION (((BFD_HOST_64_BIT)0x80000000) << 32)
#define COERCE32(x) (((bfd_signed_vma) (x) ^ 0x80000000) - 0x80000000)
#define EIGHT_GAZILLION ((BFD_HOST_64_BIT) 1 << 63)
#define COERCE64(x) \
(((bfd_signed_vma) (x) ^ EIGHT_GAZILLION) - EIGHT_GAZILLION)
bfd_vma
bfd_getb16 (addr)
register const bfd_byte *addr;
bfd_getb16 (const bfd_byte *addr)
{
return (addr[0] << 8) | addr[1];
}
bfd_vma
bfd_getl16 (addr)
register const bfd_byte *addr;
bfd_getl16 (const bfd_byte *addr)
{
return (addr[1] << 8) | addr[0];
}
bfd_signed_vma
bfd_getb_signed_16 (addr)
register const bfd_byte *addr;
bfd_getb_signed_16 (const bfd_byte *addr)
{
return COERCE16((addr[0] << 8) | addr[1]);
return COERCE16 ((addr[0] << 8) | addr[1]);
}
bfd_signed_vma
bfd_getl_signed_16 (addr)
register const bfd_byte *addr;
bfd_getl_signed_16 (const bfd_byte *addr)
{
return COERCE16((addr[1] << 8) | addr[0]);
return COERCE16 ((addr[1] << 8) | addr[0]);
}
void
bfd_putb16 (data, addr)
bfd_vma data;
register bfd_byte *addr;
bfd_putb16 (bfd_vma data, bfd_byte *addr)
{
addr[0] = (bfd_byte) (data >> 8);
addr[1] = (bfd_byte) data;
}
void
bfd_putl16 (data, addr)
bfd_vma data;
register bfd_byte *addr;
bfd_putl16 (bfd_vma data, bfd_byte *addr)
{
addr[0] = (bfd_byte) data;
addr[1] = (bfd_byte) (data >> 8);
}
bfd_vma
bfd_getb32 (addr)
register const bfd_byte *addr;
bfd_getb32 (const bfd_byte *addr)
{
unsigned long v;
@ -497,12 +470,11 @@ bfd_getb32 (addr)
v |= (unsigned long) addr[1] << 16;
v |= (unsigned long) addr[2] << 8;
v |= (unsigned long) addr[3];
return (bfd_vma) v;
return v;
}
bfd_vma
bfd_getl32 (addr)
register const bfd_byte *addr;
bfd_getl32 (const bfd_byte *addr)
{
unsigned long v;
@ -510,12 +482,11 @@ bfd_getl32 (addr)
v |= (unsigned long) addr[1] << 8;
v |= (unsigned long) addr[2] << 16;
v |= (unsigned long) addr[3] << 24;
return (bfd_vma) v;
return v;
}
bfd_signed_vma
bfd_getb_signed_32 (addr)
register const bfd_byte *addr;
bfd_getb_signed_32 (const bfd_byte *addr)
{
unsigned long v;
@ -527,8 +498,7 @@ bfd_getb_signed_32 (addr)
}
bfd_signed_vma
bfd_getl_signed_32 (addr)
register const bfd_byte *addr;
bfd_getl_signed_32 (const bfd_byte *addr)
{
unsigned long v;
@ -540,23 +510,21 @@ bfd_getl_signed_32 (addr)
}
bfd_vma
bfd_getb64 (addr)
register const bfd_byte *addr ATTRIBUTE_UNUSED;
bfd_getb64 (const bfd_byte *addr ATTRIBUTE_UNUSED)
{
#ifdef BFD64
bfd_vma low, high;
bfd_vma v;
high= ((((((((addr[0]) << 8) |
addr[1]) << 8) |
addr[2]) << 8) |
addr[3]) );
v = addr[0]; v <<= 8;
v |= addr[1]; v <<= 8;
v |= addr[2]; v <<= 8;
v |= addr[3]; v <<= 8;
v |= addr[4]; v <<= 8;
v |= addr[5]; v <<= 8;
v |= addr[6]; v <<= 8;
v |= addr[7];
low = (((((((((bfd_vma)addr[4]) << 8) |
addr[5]) << 8) |
addr[6]) << 8) |
addr[7]));
return high << 32 | low;
return v;
#else
BFD_FAIL();
return 0;
@ -564,22 +532,21 @@ bfd_getb64 (addr)
}
bfd_vma
bfd_getl64 (addr)
register const bfd_byte *addr ATTRIBUTE_UNUSED;
bfd_getl64 (const bfd_byte *addr ATTRIBUTE_UNUSED)
{
#ifdef BFD64
bfd_vma low, high;
high= (((((((addr[7] << 8) |
addr[6]) << 8) |
addr[5]) << 8) |
addr[4]));
bfd_vma v;
low = ((((((((bfd_vma)addr[3] << 8) |
addr[2]) << 8) |
addr[1]) << 8) |
addr[0]) );
v = addr[7]; v <<= 8;
v |= addr[6]; v <<= 8;
v |= addr[5]; v <<= 8;
v |= addr[4]; v <<= 8;
v |= addr[3]; v <<= 8;
v |= addr[2]; v <<= 8;
v |= addr[1]; v <<= 8;
v |= addr[0];
return high << 32 | low;
return v;
#else
BFD_FAIL();
return 0;
@ -592,19 +559,18 @@ bfd_getb_signed_64 (addr)
register const bfd_byte *addr ATTRIBUTE_UNUSED;
{
#ifdef BFD64
bfd_vma low, high;
bfd_vma v;
high= ((((((((addr[0]) << 8) |
addr[1]) << 8) |
addr[2]) << 8) |
addr[3]) );
v = addr[0]; v <<= 8;
v |= addr[1]; v <<= 8;
v |= addr[2]; v <<= 8;
v |= addr[3]; v <<= 8;
v |= addr[4]; v <<= 8;
v |= addr[5]; v <<= 8;
v |= addr[6]; v <<= 8;
v |= addr[7];
low = (((((((((bfd_vma)addr[4]) << 8) |
addr[5]) << 8) |
addr[6]) << 8) |
addr[7]));
return COERCE64(high << 32 | low);
return COERCE64 (v);
#else
BFD_FAIL();
return 0;
@ -616,18 +582,18 @@ bfd_getl_signed_64 (addr)
register const bfd_byte *addr ATTRIBUTE_UNUSED;
{
#ifdef BFD64
bfd_vma low, high;
high= (((((((addr[7] << 8) |
addr[6]) << 8) |
addr[5]) << 8) |
addr[4]));
bfd_vma v;
low = ((((((((bfd_vma)addr[3] << 8) |
addr[2]) << 8) |
addr[1]) << 8) |
addr[0]) );
v = addr[7]; v <<= 8;
v |= addr[6]; v <<= 8;
v |= addr[5]; v <<= 8;
v |= addr[4]; v <<= 8;
v |= addr[3]; v <<= 8;
v |= addr[2]; v <<= 8;
v |= addr[1]; v <<= 8;
v |= addr[0];
return COERCE64(high << 32 | low);
return COERCE64 (v);
#else
BFD_FAIL();
return 0;
@ -635,31 +601,25 @@ bfd_getl_signed_64 (addr)
}
void
bfd_putb32 (data, addr)
bfd_vma data;
register bfd_byte *addr;
bfd_putb32 (bfd_vma data, bfd_byte *addr)
{
addr[0] = (bfd_byte) (data >> 24);
addr[1] = (bfd_byte) (data >> 16);
addr[2] = (bfd_byte) (data >> 8);
addr[3] = (bfd_byte) data;
addr[0] = (bfd_byte) (data >> 24);
addr[1] = (bfd_byte) (data >> 16);
addr[2] = (bfd_byte) (data >> 8);
addr[3] = (bfd_byte) data;
}
void
bfd_putl32 (data, addr)
bfd_vma data;
register bfd_byte *addr;
bfd_putl32 (bfd_vma data, bfd_byte *addr)
{
addr[0] = (bfd_byte) data;
addr[1] = (bfd_byte) (data >> 8);
addr[2] = (bfd_byte) (data >> 16);
addr[3] = (bfd_byte) (data >> 24);
addr[0] = (bfd_byte) data;
addr[1] = (bfd_byte) (data >> 8);
addr[2] = (bfd_byte) (data >> 16);
addr[3] = (bfd_byte) (data >> 24);
}
void
bfd_putb64 (data, addr)
bfd_vma data ATTRIBUTE_UNUSED;
register bfd_byte *addr ATTRIBUTE_UNUSED;
bfd_putb64 (bfd_vma data ATTRIBUTE_UNUSED, bfd_byte *addr ATTRIBUTE_UNUSED)
{
#ifdef BFD64
addr[0] = (bfd_byte) (data >> (7*8));
@ -676,9 +636,7 @@ bfd_putb64 (data, addr)
}
void
bfd_putl64 (data, addr)
bfd_vma data ATTRIBUTE_UNUSED;
register bfd_byte *addr ATTRIBUTE_UNUSED;
bfd_putl64 (bfd_vma data ATTRIBUTE_UNUSED, bfd_byte *addr ATTRIBUTE_UNUSED)
{
#ifdef BFD64
addr[7] = (bfd_byte) (data >> (7*8));
@ -695,11 +653,7 @@ bfd_putl64 (data, addr)
}
void
bfd_put_bits (data, addr, bits, big_p)
bfd_vma data;
bfd_byte *addr;
int bits;
bfd_boolean big_p;
bfd_put_bits (bfd_vma data, bfd_byte *addr, int bits, bfd_boolean big_p)
{
int i;
int bytes;
@ -718,10 +672,7 @@ bfd_put_bits (data, addr, bits, big_p)
}
bfd_vma
bfd_get_bits (addr, bits, big_p)
bfd_byte *addr;
int bits;
bfd_boolean big_p;
bfd_get_bits (bfd_byte *addr, int bits, bfd_boolean big_p)
{
bfd_vma data;
int i;
@ -745,12 +696,11 @@ bfd_get_bits (addr, bits, big_p)
/* Default implementation */
bfd_boolean
_bfd_generic_get_section_contents (abfd, section, location, offset, count)
bfd *abfd;
sec_ptr section;
PTR location;
file_ptr offset;
bfd_size_type count;
_bfd_generic_get_section_contents (bfd *abfd,
sec_ptr section,
void *location,
file_ptr offset,
bfd_size_type count)
{
if (count == 0)
return TRUE;
@ -769,17 +719,18 @@ _bfd_generic_get_section_contents (abfd, section, location, offset, count)
}
bfd_boolean
_bfd_generic_get_section_contents_in_window (abfd, section, w, offset, count)
bfd *abfd ATTRIBUTE_UNUSED;
sec_ptr section ATTRIBUTE_UNUSED;
bfd_window *w ATTRIBUTE_UNUSED;
file_ptr offset ATTRIBUTE_UNUSED;
bfd_size_type count ATTRIBUTE_UNUSED;
_bfd_generic_get_section_contents_in_window
(bfd *abfd ATTRIBUTE_UNUSED,
sec_ptr section ATTRIBUTE_UNUSED,
bfd_window *w ATTRIBUTE_UNUSED,
file_ptr offset ATTRIBUTE_UNUSED,
bfd_size_type count ATTRIBUTE_UNUSED)
{
#ifdef USE_MMAP
if (count == 0)
return TRUE;
if (abfd->xvec->_bfd_get_section_contents != _bfd_generic_get_section_contents)
if (abfd->xvec->_bfd_get_section_contents
!= _bfd_generic_get_section_contents)
{
/* We don't know what changes the bfd's get_section_contents
method may have to make. So punt trying to map the file
@ -787,11 +738,10 @@ _bfd_generic_get_section_contents_in_window (abfd, section, w, offset, count)
/* @@ FIXME : If the internal window has a refcount of 1 and was
allocated with malloc instead of mmap, just reuse it. */
bfd_free_window (w);
w->i = ((bfd_window_internal *)
bfd_zmalloc ((bfd_size_type) sizeof (bfd_window_internal)));
w->i = bfd_zmalloc (sizeof (bfd_window_internal));
if (w->i == NULL)
return FALSE;
w->i->data = (PTR) bfd_malloc (count);
w->i->data = bfd_malloc (count);
if (w->i->data == NULL)
{
free (w->i);
@ -819,12 +769,11 @@ _bfd_generic_get_section_contents_in_window (abfd, section, w, offset, count)
in read-write files, though. See other set_section_contents functions
to see why it doesn't work for new sections. */
bfd_boolean
_bfd_generic_set_section_contents (abfd, section, location, offset, count)
bfd *abfd;
sec_ptr section;
PTR location;
file_ptr offset;
bfd_size_type count;
_bfd_generic_set_section_contents (bfd *abfd,
sec_ptr section,
void *location,
file_ptr offset,
bfd_size_type count)
{
if (count == 0)
return TRUE;
@ -849,8 +798,7 @@ DESCRIPTION
*/
unsigned int
bfd_log2 (x)
bfd_vma x;
bfd_log2 (bfd_vma x)
{
unsigned int result = 0;
@ -860,9 +808,7 @@ bfd_log2 (x)
}
bfd_boolean
bfd_generic_is_local_label_name (abfd, name)
bfd *abfd;
const char *name;
bfd_generic_is_local_label_name (bfd *abfd, const char *name)
{
char locals_prefix = (bfd_get_symbol_leading_char (abfd) == '_') ? 'L' : '.';
@ -873,9 +819,7 @@ bfd_generic_is_local_label_name (abfd, name)
endianness matches between input and output file. Returns
TRUE for a match, otherwise returns FALSE and emits an error. */
bfd_boolean
_bfd_generic_verify_endian_match (ibfd, obfd)
bfd *ibfd;
bfd *obfd;
_bfd_generic_verify_endian_match (bfd *ibfd, bfd *obfd)
{
if (ibfd->xvec->byteorder != obfd->xvec->byteorder
&& ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN
@ -901,11 +845,10 @@ _bfd_generic_verify_endian_match (ibfd, obfd)
old routines. */
void
warn_deprecated (what, file, line, func)
const char *what;
const char *file;
int line;
const char *func;
warn_deprecated (const char *what,
const char *file,
int line,
const char *func)
{
/* Poor man's tracking of functions we've already warned about. */
static size_t mask = 0;

View File

@ -6,7 +6,7 @@
/* libbfd.h -- Declarations used by bfd library *implementation*.
(This include file is not for users of the library.)
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002
2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Cygnus Support.
@ -41,7 +41,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* 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. */
#define set_tdata(bfd, v) ((bfd)->tdata.any = (PTR) (v))
#define set_tdata(bfd, v) ((bfd)->tdata.any = (v))
/* If BFD_IN_MEMORY is set for a BFD, then the iostream fields points
to an instance of this structure. */
@ -74,7 +74,7 @@ struct artdata {
archive. */
file_ptr armap_datepos; /* Position within archive to seek to
rewrite the date field. */
PTR tdata; /* Backend specific information. */
void *tdata; /* Backend specific information. */
};
#define bfd_ardata(bfd) ((bfd)->tdata.aout_ar_data)
@ -88,105 +88,105 @@ struct areltdata {
#define arelt_size(bfd) (((struct areltdata *)((bfd)->arelt_data))->parsed_size)
extern PTR bfd_malloc
PARAMS ((bfd_size_type));
extern PTR bfd_realloc
PARAMS ((PTR, bfd_size_type));
extern PTR bfd_zmalloc
PARAMS ((bfd_size_type));
extern void *bfd_malloc
(bfd_size_type);
extern void *bfd_realloc
(void *, bfd_size_type);
extern void *bfd_zmalloc
(bfd_size_type);
extern bfd_error_handler_type _bfd_error_handler;
/* These routines allocate and free things on the BFD's objalloc. */
extern PTR bfd_alloc
PARAMS ((bfd *, bfd_size_type));
extern PTR bfd_zalloc
PARAMS ((bfd *, bfd_size_type));
extern void *bfd_alloc
(bfd *, bfd_size_type);
extern void *bfd_zalloc
(bfd *, bfd_size_type);
extern void bfd_release
PARAMS ((bfd *, PTR));
(bfd *, void *);
bfd * _bfd_create_empty_archive_element_shell
PARAMS ((bfd *obfd));
(bfd *obfd);
bfd * _bfd_look_for_bfd_in_cache
PARAMS ((bfd *, file_ptr));
(bfd *, file_ptr);
bfd_boolean _bfd_add_bfd_to_archive_cache
PARAMS ((bfd *, file_ptr, bfd *));
(bfd *, file_ptr, bfd *);
bfd_boolean _bfd_generic_mkarchive
PARAMS ((bfd *abfd));
(bfd *abfd);
const bfd_target *bfd_generic_archive_p
PARAMS ((bfd *abfd));
(bfd *abfd);
bfd_boolean bfd_slurp_armap
PARAMS ((bfd *abfd));
(bfd *abfd);
bfd_boolean bfd_slurp_bsd_armap_f2
PARAMS ((bfd *abfd));
(bfd *abfd);
#define bfd_slurp_bsd_armap bfd_slurp_armap
#define bfd_slurp_coff_armap bfd_slurp_armap
bfd_boolean _bfd_slurp_extended_name_table
PARAMS ((bfd *abfd));
(bfd *abfd);
extern bfd_boolean _bfd_construct_extended_name_table
PARAMS ((bfd *, bfd_boolean, char **, bfd_size_type *));
(bfd *, bfd_boolean, char **, bfd_size_type *);
bfd_boolean _bfd_write_archive_contents
PARAMS ((bfd *abfd));
(bfd *abfd);
bfd_boolean _bfd_compute_and_write_armap
PARAMS ((bfd *, unsigned int elength));
(bfd *, unsigned int elength);
bfd *_bfd_get_elt_at_filepos
PARAMS ((bfd *archive, file_ptr filepos));
(bfd *archive, file_ptr filepos);
extern bfd *_bfd_generic_get_elt_at_index
PARAMS ((bfd *, symindex));
(bfd *, symindex);
bfd * _bfd_new_bfd
PARAMS ((void));
(void);
void _bfd_delete_bfd
PARAMS ((bfd *));
(bfd *);
bfd_boolean bfd_false
PARAMS ((bfd *ignore));
(bfd *ignore);
bfd_boolean bfd_true
PARAMS ((bfd *ignore));
PTR bfd_nullvoidptr
PARAMS ((bfd *ignore));
(bfd *ignore);
void *bfd_nullvoidptr
(bfd *ignore);
int bfd_0
PARAMS ((bfd *ignore));
(bfd *ignore);
unsigned int bfd_0u
PARAMS ((bfd *ignore));
(bfd *ignore);
long bfd_0l
PARAMS ((bfd *ignore));
(bfd *ignore);
long _bfd_n1
PARAMS ((bfd *ignore));
(bfd *ignore);
void bfd_void
PARAMS ((bfd *ignore));
(bfd *ignore);
bfd *_bfd_new_bfd_contained_in
PARAMS ((bfd *));
(bfd *);
const bfd_target *_bfd_dummy_target
PARAMS ((bfd *abfd));
(bfd *abfd);
void bfd_dont_truncate_arname
PARAMS ((bfd *abfd, const char *filename, char *hdr));
(bfd *abfd, const char *filename, char *hdr);
void bfd_bsd_truncate_arname
PARAMS ((bfd *abfd, const char *filename, char *hdr));
(bfd *abfd, const char *filename, char *hdr);
void bfd_gnu_truncate_arname
PARAMS ((bfd *abfd, const char *filename, char *hdr));
(bfd *abfd, const char *filename, char *hdr);
bfd_boolean bsd_write_armap
PARAMS ((bfd *arch, unsigned int elength, struct orl *map,
unsigned int orl_count, int stridx));
(bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count,
int stridx);
bfd_boolean coff_write_armap
PARAMS ((bfd *arch, unsigned int elength, struct orl *map,
unsigned int orl_count, int stridx));
(bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count,
int stridx);
extern PTR _bfd_generic_read_ar_hdr
PARAMS ((bfd *));
extern void *_bfd_generic_read_ar_hdr
(bfd *);
extern PTR _bfd_generic_read_ar_hdr_mag
PARAMS ((bfd *, const char *));
extern void *_bfd_generic_read_ar_hdr_mag
(bfd *, const char *);
bfd * bfd_generic_openr_next_archived_file
PARAMS ((bfd *archive, bfd *last_file));
(bfd *archive, bfd *last_file);
int bfd_generic_stat_arch_elt
PARAMS ((bfd *, struct stat *));
(bfd *, struct stat *);
#define _bfd_read_ar_hdr(abfd) \
BFD_SEND (abfd, _bfd_read_ar_hdr_fn, (abfd))
@ -197,37 +197,37 @@ int bfd_generic_stat_arch_elt
#define _bfd_generic_close_and_cleanup bfd_true
#define _bfd_generic_bfd_free_cached_info bfd_true
#define _bfd_generic_new_section_hook \
((bfd_boolean (*) PARAMS ((bfd *, asection *))) bfd_true)
((bfd_boolean (*) (bfd *, asection *)) bfd_true)
extern bfd_boolean _bfd_generic_get_section_contents
PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
(bfd *, asection *, void *, file_ptr, bfd_size_type);
extern bfd_boolean _bfd_generic_get_section_contents_in_window
PARAMS ((bfd *, asection *, bfd_window *, file_ptr, bfd_size_type));
(bfd *, asection *, bfd_window *, file_ptr, bfd_size_type);
/* Generic routines to use for BFD_JUMP_TABLE_COPY. Use
BFD_JUMP_TABLE_COPY (_bfd_generic). */
#define _bfd_generic_bfd_copy_private_bfd_data \
((bfd_boolean (*) PARAMS ((bfd *, bfd *))) bfd_true)
((bfd_boolean (*) (bfd *, bfd *)) bfd_true)
#define _bfd_generic_bfd_merge_private_bfd_data \
((bfd_boolean (*) PARAMS ((bfd *, bfd *))) bfd_true)
((bfd_boolean (*) (bfd *, bfd *)) bfd_true)
#define _bfd_generic_bfd_set_private_flags \
((bfd_boolean (*) PARAMS ((bfd *, flagword))) bfd_true)
((bfd_boolean (*) (bfd *, flagword)) bfd_true)
#define _bfd_generic_bfd_copy_private_section_data \
((bfd_boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_true)
((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true)
#define _bfd_generic_bfd_copy_private_symbol_data \
((bfd_boolean (*) PARAMS ((bfd *, asymbol *, bfd *, asymbol *))) bfd_true)
((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true)
#define _bfd_generic_bfd_print_private_bfd_data \
((bfd_boolean (*) PARAMS ((bfd *, PTR))) bfd_true)
((bfd_boolean (*) (bfd *, void *)) bfd_true)
/* Routines to use for BFD_JUMP_TABLE_CORE when there is no core file
support. Use BFD_JUMP_TABLE_CORE (_bfd_nocore). */
extern char *_bfd_nocore_core_file_failing_command
PARAMS ((bfd *));
(bfd *);
extern int _bfd_nocore_core_file_failing_signal
PARAMS ((bfd *));
(bfd *);
extern bfd_boolean _bfd_nocore_core_file_matches_executable_p
PARAMS ((bfd *, bfd *));
(bfd *, bfd *);
/* Routines to use for BFD_JUMP_TABLE_ARCHIVE when there is no archive
file support. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive). */
@ -235,20 +235,18 @@ extern bfd_boolean _bfd_nocore_core_file_matches_executable_p
#define _bfd_noarchive_slurp_armap bfd_false
#define _bfd_noarchive_slurp_extended_name_table bfd_false
#define _bfd_noarchive_construct_extended_name_table \
((bfd_boolean (*) \
PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \
((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) \
bfd_false)
#define _bfd_noarchive_truncate_arname \
((void (*) PARAMS ((bfd *, const char *, char *))) bfd_void)
((void (*) (bfd *, const char *, char *)) bfd_void)
#define _bfd_noarchive_write_armap \
((bfd_boolean (*) \
PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int))) \
((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) \
bfd_false)
#define _bfd_noarchive_read_ar_hdr bfd_nullvoidptr
#define _bfd_noarchive_openr_next_archived_file \
((bfd *(*) PARAMS ((bfd *, bfd *))) bfd_nullvoidptr)
((bfd *(*) (bfd *, bfd *)) bfd_nullvoidptr)
#define _bfd_noarchive_get_elt_at_index \
((bfd *(*) PARAMS ((bfd *, symindex))) bfd_nullvoidptr)
((bfd *(*) (bfd *, symindex)) bfd_nullvoidptr)
#define _bfd_noarchive_generic_stat_arch_elt bfd_generic_stat_arch_elt
#define _bfd_noarchive_update_armap_timestamp bfd_false
@ -259,7 +257,7 @@ extern bfd_boolean _bfd_nocore_core_file_matches_executable_p
#define _bfd_archive_bsd_slurp_extended_name_table \
_bfd_slurp_extended_name_table
extern bfd_boolean _bfd_archive_bsd_construct_extended_name_table
PARAMS ((bfd *, char **, bfd_size_type *, const char **));
(bfd *, char **, bfd_size_type *, const char **);
#define _bfd_archive_bsd_truncate_arname bfd_bsd_truncate_arname
#define _bfd_archive_bsd_write_armap bsd_write_armap
#define _bfd_archive_bsd_read_ar_hdr _bfd_generic_read_ar_hdr
@ -269,7 +267,7 @@ extern bfd_boolean _bfd_archive_bsd_construct_extended_name_table
#define _bfd_archive_bsd_generic_stat_arch_elt \
bfd_generic_stat_arch_elt
extern bfd_boolean _bfd_archive_bsd_update_armap_timestamp
PARAMS ((bfd *));
(bfd *);
/* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get COFF style
archives. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff). */
@ -278,7 +276,7 @@ extern bfd_boolean _bfd_archive_bsd_update_armap_timestamp
#define _bfd_archive_coff_slurp_extended_name_table \
_bfd_slurp_extended_name_table
extern bfd_boolean _bfd_archive_coff_construct_extended_name_table
PARAMS ((bfd *, char **, bfd_size_type *, const char **));
(bfd *, char **, bfd_size_type *, const char **);
#define _bfd_archive_coff_truncate_arname bfd_dont_truncate_arname
#define _bfd_archive_coff_write_armap coff_write_armap
#define _bfd_archive_coff_read_ar_hdr _bfd_generic_read_ar_hdr
@ -294,49 +292,46 @@ extern bfd_boolean _bfd_archive_coff_construct_extended_name_table
#define _bfd_nosymbols_get_symtab_upper_bound _bfd_n1
#define _bfd_nosymbols_get_symtab \
((long (*) PARAMS ((bfd *, asymbol **))) _bfd_n1)
((long (*) (bfd *, asymbol **)) _bfd_n1)
#define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol
#define _bfd_nosymbols_print_symbol \
((void (*) PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type))) bfd_void)
((void (*) (bfd *, void *, asymbol *, bfd_print_symbol_type)) bfd_void)
#define _bfd_nosymbols_get_symbol_info \
((void (*) PARAMS ((bfd *, asymbol *, symbol_info *))) bfd_void)
((void (*) (bfd *, asymbol *, symbol_info *)) bfd_void)
#define _bfd_nosymbols_bfd_is_local_label_name \
((bfd_boolean (*) PARAMS ((bfd *, const char *))) bfd_false)
((bfd_boolean (*) (bfd *, const char *)) bfd_false)
#define _bfd_nosymbols_get_lineno \
((alent *(*) PARAMS ((bfd *, asymbol *))) bfd_nullvoidptr)
((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr)
#define _bfd_nosymbols_find_nearest_line \
((bfd_boolean (*) \
PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, \
const char **, unsigned int *))) \
((bfd_boolean (*) (bfd *, asection *, asymbol **, bfd_vma, const char **, \
const char **, unsigned int *)) \
bfd_false)
#define _bfd_nosymbols_bfd_make_debug_symbol \
((asymbol *(*) PARAMS ((bfd *, PTR, unsigned long))) bfd_nullvoidptr)
((asymbol *(*) (bfd *, void *, unsigned long)) bfd_nullvoidptr)
#define _bfd_nosymbols_read_minisymbols \
((long (*) PARAMS ((bfd *, bfd_boolean, PTR *, unsigned int *))) _bfd_n1)
((long (*) (bfd *, bfd_boolean, void **, unsigned int *)) _bfd_n1)
#define _bfd_nosymbols_minisymbol_to_symbol \
((asymbol *(*) PARAMS ((bfd *, bfd_boolean, const PTR, asymbol *))) \
((asymbol *(*) (bfd *, bfd_boolean, const void *, asymbol *)) \
bfd_nullvoidptr)
/* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc
support. Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs). */
#define _bfd_norelocs_get_reloc_upper_bound \
((long (*) PARAMS ((bfd *, asection *))) _bfd_n1)
((long (*) (bfd *, asection *)) _bfd_n1)
#define _bfd_norelocs_canonicalize_reloc \
((long (*) PARAMS ((bfd *, asection *, arelent **, asymbol **))) _bfd_n1)
((long (*) (bfd *, asection *, arelent **, asymbol **)) _bfd_n1)
#define _bfd_norelocs_bfd_reloc_type_lookup \
((reloc_howto_type *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) \
bfd_nullvoidptr)
((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr)
/* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not
be written. Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite). */
#define _bfd_nowrite_set_arch_mach \
((bfd_boolean (*) PARAMS ((bfd *, enum bfd_architecture, unsigned long))) \
((bfd_boolean (*) (bfd *, enum bfd_architecture, unsigned long)) \
bfd_false)
#define _bfd_nowrite_set_section_contents \
((bfd_boolean (*) \
PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type))) \
((bfd_boolean (*) (bfd *, asection *, void *, file_ptr, bfd_size_type)) \
bfd_false)
/* Generic routines to use for BFD_JUMP_TABLE_WRITE. Use
@ -344,45 +339,41 @@ extern bfd_boolean _bfd_archive_coff_construct_extended_name_table
#define _bfd_generic_set_arch_mach bfd_default_set_arch_mach
extern bfd_boolean _bfd_generic_set_section_contents
PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
(bfd *, asection *, void *, file_ptr, bfd_size_type);
/* Routines to use for BFD_JUMP_TABLE_LINK for targets which do not
support linking. Use BFD_JUMP_TABLE_LINK (_bfd_nolink). */
#define _bfd_nolink_sizeof_headers ((int (*) PARAMS ((bfd *, bfd_boolean))) bfd_0)
#define _bfd_nolink_sizeof_headers ((int (*) (bfd *, bfd_boolean)) bfd_0)
#define _bfd_nolink_bfd_get_relocated_section_contents \
((bfd_byte *(*) \
PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, \
bfd_byte *, bfd_boolean, asymbol **))) \
((bfd_byte *(*) (bfd *, struct bfd_link_info *, struct bfd_link_order *, \
bfd_byte *, bfd_boolean, asymbol **)) \
bfd_nullvoidptr)
#define _bfd_nolink_bfd_relax_section \
((bfd_boolean (*) \
PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *))) \
(bfd *, asection *, struct bfd_link_info *, bfd_boolean *)) \
bfd_false)
#define _bfd_nolink_bfd_gc_sections \
((bfd_boolean (*) \
PARAMS ((bfd *, struct bfd_link_info *))) \
((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \
bfd_false)
#define _bfd_nolink_bfd_merge_sections \
((bfd_boolean (*) \
PARAMS ((bfd *, struct bfd_link_info *))) \
((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \
bfd_false)
#define _bfd_nolink_bfd_discard_group \
((bfd_boolean (*) \
PARAMS ((bfd *, struct sec *))) \
((bfd_boolean (*) (bfd *, struct sec *)) \
bfd_false)
#define _bfd_nolink_bfd_link_hash_table_create \
((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr)
((struct bfd_link_hash_table *(*) (bfd *)) bfd_nullvoidptr)
#define _bfd_nolink_bfd_link_hash_table_free \
((void (*) PARAMS ((struct bfd_link_hash_table *))) bfd_void)
((void (*) (struct bfd_link_hash_table *)) bfd_void)
#define _bfd_nolink_bfd_link_add_symbols \
((bfd_boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false)
((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
#define _bfd_nolink_bfd_link_just_syms \
((void (*) PARAMS ((asection *, struct bfd_link_info *))) bfd_void)
((void (*) (asection *, struct bfd_link_info *)) bfd_void)
#define _bfd_nolink_bfd_final_link \
((bfd_boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false)
((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
#define _bfd_nolink_bfd_link_split_section \
((bfd_boolean (*) PARAMS ((bfd *, struct sec *))) bfd_false)
((bfd_boolean (*) (bfd *, struct sec *)) bfd_false)
/* Routines to use for BFD_JUMP_TABLE_DYNAMIC for targets which do not
have dynamic symbols or relocs. Use BFD_JUMP_TABLE_DYNAMIC
@ -390,195 +381,189 @@ extern bfd_boolean _bfd_generic_set_section_contents
#define _bfd_nodynamic_get_dynamic_symtab_upper_bound _bfd_n1
#define _bfd_nodynamic_canonicalize_dynamic_symtab \
((long (*) PARAMS ((bfd *, asymbol **))) _bfd_n1)
((long (*) (bfd *, asymbol **)) _bfd_n1)
#define _bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_n1
#define _bfd_nodynamic_canonicalize_dynamic_reloc \
((long (*) PARAMS ((bfd *, arelent **, asymbol **))) _bfd_n1)
((long (*) (bfd *, arelent **, asymbol **)) _bfd_n1)
/* Generic routine to determine of the given symbol is a local
label. */
extern bfd_boolean bfd_generic_is_local_label_name
PARAMS ((bfd *, const char *));
(bfd *, const char *);
/* Generic minisymbol routines. */
extern long _bfd_generic_read_minisymbols
PARAMS ((bfd *, bfd_boolean, PTR *, unsigned int *));
(bfd *, bfd_boolean, void **, unsigned int *);
extern asymbol *_bfd_generic_minisymbol_to_symbol
PARAMS ((bfd *, bfd_boolean, const PTR, asymbol *));
(bfd *, bfd_boolean, const void *, asymbol *);
/* Find the nearest line using .stab/.stabstr sections. */
extern bfd_boolean _bfd_stab_section_find_nearest_line
PARAMS ((bfd *, asymbol **, asection *, bfd_vma, bfd_boolean *,
const char **, const char **, unsigned int *, PTR *));
(bfd *, asymbol **, asection *, bfd_vma, bfd_boolean *,
const char **, const char **, unsigned int *, void **);
/* Find the neaderst line using DWARF 1 debugging information. */
extern bfd_boolean _bfd_dwarf1_find_nearest_line
PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
const char **, unsigned int *));
(bfd *, asection *, asymbol **, bfd_vma, const char **,
const char **, unsigned int *);
/* Find the nearest line using DWARF 2 debugging information. */
extern bfd_boolean _bfd_dwarf2_find_nearest_line
PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **,
const char **, unsigned int *, unsigned int,
PTR *));
(bfd *, asection *, asymbol **, bfd_vma, const char **, const char **,
unsigned int *, unsigned int, void **);
/* Create a new section entry. */
extern struct bfd_hash_entry *bfd_section_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
/* A routine to create entries for a bfd_link_hash_table. */
extern struct bfd_hash_entry *_bfd_link_hash_newfunc
PARAMS ((struct bfd_hash_entry *entry,
struct bfd_hash_table *table,
const char *string));
(struct bfd_hash_entry *entry, struct bfd_hash_table *table,
const char *string);
/* Initialize a bfd_link_hash_table. */
extern bfd_boolean _bfd_link_hash_table_init
PARAMS ((struct bfd_link_hash_table *, bfd *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *)));
(struct bfd_link_hash_table *, bfd *,
struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *));
/* Generic link hash table creation routine. */
extern struct bfd_link_hash_table *_bfd_generic_link_hash_table_create
PARAMS ((bfd *));
(bfd *);
/* Generic link hash table destruction routine. */
extern void _bfd_generic_link_hash_table_free
PARAMS ((struct bfd_link_hash_table *));
(struct bfd_link_hash_table *);
/* Generic add symbol routine. */
extern bfd_boolean _bfd_generic_link_add_symbols
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
/* Generic add symbol routine. This version is used by targets for
which the linker must collect constructors and destructors by name,
as the collect2 program does. */
extern bfd_boolean _bfd_generic_link_add_symbols_collect
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
/* Generic archive add symbol routine. */
extern bfd_boolean _bfd_generic_link_add_archive_symbols
PARAMS ((bfd *, struct bfd_link_info *,
bfd_boolean (*) (bfd *, struct bfd_link_info *, bfd_boolean *)));
(bfd *, struct bfd_link_info *,
bfd_boolean (*) (bfd *, struct bfd_link_info *, bfd_boolean *));
/* Forward declaration to avoid prototype errors. */
typedef struct bfd_link_hash_entry _bfd_link_hash_entry;
/* Generic routine to add a single symbol. */
extern bfd_boolean _bfd_generic_link_add_one_symbol
PARAMS ((struct bfd_link_info *, bfd *, const char *name, flagword,
asection *, bfd_vma, const char *, bfd_boolean copy,
bfd_boolean constructor, struct bfd_link_hash_entry **));
(struct bfd_link_info *, bfd *, const char *name, flagword,
asection *, bfd_vma, const char *, bfd_boolean copy,
bfd_boolean constructor, struct bfd_link_hash_entry **);
/* Generic routine to mark section as supplying symbols only. */
extern void _bfd_generic_link_just_syms
PARAMS ((asection *, struct bfd_link_info *));
(asection *, struct bfd_link_info *);
/* Generic link routine. */
extern bfd_boolean _bfd_generic_final_link
PARAMS ((bfd *, struct bfd_link_info *));
(bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_generic_link_split_section
PARAMS ((bfd *, struct sec *));
(bfd *, struct sec *);
/* Generic reloc_link_order processing routine. */
extern bfd_boolean _bfd_generic_reloc_link_order
PARAMS ((bfd *, struct bfd_link_info *, asection *,
struct bfd_link_order *));
(bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *);
/* Default link order processing routine. */
extern bfd_boolean _bfd_default_link_order
PARAMS ((bfd *, struct bfd_link_info *, asection *,
struct bfd_link_order *));
(bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *);
/* Count the number of reloc entries in a link order list. */
extern unsigned int _bfd_count_link_order_relocs
PARAMS ((struct bfd_link_order *));
(struct bfd_link_order *);
/* Final link relocation routine. */
extern bfd_reloc_status_type _bfd_final_link_relocate
PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *,
bfd_vma, bfd_vma, bfd_vma));
(reloc_howto_type *, bfd *, asection *, bfd_byte *,
bfd_vma, bfd_vma, bfd_vma);
/* Relocate a particular location by a howto and a value. */
extern bfd_reloc_status_type _bfd_relocate_contents
PARAMS ((reloc_howto_type *, bfd *, bfd_vma, bfd_byte *));
(reloc_howto_type *, bfd *, bfd_vma, bfd_byte *);
/* Link stabs in sections in the first pass. */
extern bfd_boolean _bfd_link_section_stabs
PARAMS ((bfd *, PTR *, asection *, asection *, PTR *));
(bfd *, void **, asection *, asection *, void **);
/* Eliminate stabs for discarded functions and symbols. */
extern bfd_boolean _bfd_discard_section_stabs
PARAMS ((bfd *, asection *, PTR,
bfd_boolean (*) (bfd_vma, PTR), PTR));
(bfd *, asection *, void *, bfd_boolean (*) (bfd_vma, void *), void *);
/* Write out the .stab section when linking stabs in sections. */
extern bfd_boolean _bfd_write_section_stabs
PARAMS ((bfd *, PTR *, asection *, PTR *, bfd_byte *));
(bfd *, void **, asection *, void **, bfd_byte *);
/* Write out the .stabstr string table when linking stabs in sections. */
extern bfd_boolean _bfd_write_stab_strings
PARAMS ((bfd *, PTR *));
(bfd *, void **);
/* Find an offset within a .stab section when linking stabs in
sections. */
extern bfd_vma _bfd_stab_section_offset
PARAMS ((bfd *, PTR *, asection *, PTR *, bfd_vma));
(bfd *, void **, asection *, void **, bfd_vma);
/* Attempt to merge a SEC_MERGE section. */
extern bfd_boolean _bfd_merge_section
PARAMS ((bfd *, PTR *, asection *, PTR *));
(bfd *, void **, asection *, void **);
/* Attempt to merge SEC_MERGE sections. */
extern bfd_boolean _bfd_merge_sections
PARAMS ((bfd *, PTR, void (*)(bfd *, asection *)));
(bfd *, void *, void (*) (bfd *, asection *));
/* Write out a merged section. */
extern bfd_boolean _bfd_write_merged_section
PARAMS ((bfd *, asection *, PTR));
(bfd *, asection *, void *);
/* Find an offset within a modified SEC_MERGE section. */
extern bfd_vma _bfd_merged_section_offset
PARAMS ((bfd *, asection **, PTR, bfd_vma, bfd_vma));
(bfd *, asection **, void *, bfd_vma, bfd_vma);
/* Create a string table. */
extern struct bfd_strtab_hash *_bfd_stringtab_init
PARAMS ((void));
(void);
/* Create an XCOFF .debug section style string table. */
extern struct bfd_strtab_hash *_bfd_xcoff_stringtab_init
PARAMS ((void));
(void);
/* Free a string table. */
extern void _bfd_stringtab_free
PARAMS ((struct bfd_strtab_hash *));
(struct bfd_strtab_hash *);
/* Get the size of a string table. */
extern bfd_size_type _bfd_stringtab_size
PARAMS ((struct bfd_strtab_hash *));
(struct bfd_strtab_hash *);
/* Add a string to a string table. */
extern bfd_size_type _bfd_stringtab_add
PARAMS ((struct bfd_strtab_hash *, const char *, bfd_boolean hash,
bfd_boolean copy));
(struct bfd_strtab_hash *, const char *, bfd_boolean hash, bfd_boolean copy);
/* Write out a string table. */
extern bfd_boolean _bfd_stringtab_emit
PARAMS ((bfd *, struct bfd_strtab_hash *));
(bfd *, struct bfd_strtab_hash *);
/* Check that endianness of input and output file match. */
extern bfd_boolean _bfd_generic_verify_endian_match
PARAMS ((bfd *, bfd *));
(bfd *, bfd *);
/* Macros to tell if bfds are read or write enabled.
@ -589,20 +574,22 @@ extern bfd_boolean _bfd_generic_verify_endian_match
!bfd_read_p, and only sometimes bfd_write_p.
*/
#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_read_p(abfd) \
((abfd)->direction == read_direction || (abfd)->direction == both_direction)
#define bfd_write_p(abfd) \
((abfd)->direction == write_direction || (abfd)->direction == both_direction)
void bfd_assert
PARAMS ((const char*,int));
(const char*,int);
#define BFD_ASSERT(x) \
{ if (!(x)) bfd_assert(__FILE__,__LINE__); }
{ if (!(x)) bfd_assert(__FILE__,__LINE__); }
#define BFD_FAIL() \
{ bfd_assert(__FILE__,__LINE__); }
{ bfd_assert(__FILE__,__LINE__); }
extern void _bfd_abort
PARAMS ((const char *, int, const char *)) ATTRIBUTE_NORETURN;
(const char *, int, const char *) ATTRIBUTE_NORETURN;
/* if gcc >= 2.6, we can give a function name, too */
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)
@ -613,7 +600,7 @@ extern void _bfd_abort
#define abort() _bfd_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__)
FILE * bfd_cache_lookup_worker
PARAMS ((bfd *));
(bfd *);
extern bfd *bfd_last_cache;
@ -633,42 +620,41 @@ struct ecoff_find_line;
#endif
extern bfd_boolean _bfd_ecoff_locate_line
PARAMS ((bfd *, asection *, bfd_vma, struct ecoff_debug_info * const,
const struct ecoff_debug_swap * const, struct ecoff_find_line *,
const char **, const char **, unsigned int *));
(bfd *, asection *, bfd_vma, struct ecoff_debug_info * const,
const struct ecoff_debug_swap * const, struct ecoff_find_line *,
const char **, const char **, unsigned int *);
extern bfd_boolean _bfd_ecoff_get_accumulated_pdr
PARAMS ((PTR, bfd_byte *));
(void *, bfd_byte *);
extern bfd_boolean _bfd_ecoff_get_accumulated_sym
PARAMS ((PTR, bfd_byte *));
(void *, bfd_byte *);
extern bfd_boolean _bfd_ecoff_get_accumulated_ss
PARAMS ((PTR, bfd_byte *));
(void *, bfd_byte *);
extern bfd_vma _bfd_get_gp_value
PARAMS ((bfd *));
(bfd *);
extern void _bfd_set_gp_value
PARAMS ((bfd *, bfd_vma));
(bfd *, bfd_vma);
/* Function shared by the COFF and ELF SH backends, which have no
other common header files. */
#ifndef _bfd_sh_align_load_span
extern bfd_boolean _bfd_sh_align_load_span
PARAMS ((bfd *, asection *, bfd_byte *,
bfd_boolean (*) (bfd *, asection *, PTR, bfd_byte *, bfd_vma),
PTR, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, bfd_boolean *));
(bfd *, asection *, bfd_byte *,
bfd_boolean (*) (bfd *, asection *, void *, bfd_byte *, bfd_vma),
void *, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, bfd_boolean *);
#endif
/* Extracted from init.c. */
/* Extracted from libbfd.c. */
bfd_boolean
bfd_write_bigendian_4byte_int PARAMS ((bfd *, unsigned int));
bfd_boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int);
unsigned int
bfd_log2 PARAMS ((bfd_vma x));
unsigned int bfd_log2 (bfd_vma x);
/* Extracted from bfdio.c. */
/* Extracted from bfdwin.c. */
struct _bfd_window_internal {
struct _bfd_window_internal *next;
PTR data;
void *data;
bfd_size_type size;
int refcount : 31; /* should be enough... */
unsigned mapped : 1; /* 1 = mmap, 0 = malloc */
@ -681,17 +667,13 @@ extern bfd *bfd_last_cache;
((x)==bfd_last_cache? \
(FILE*) (bfd_last_cache->iostream): \
bfd_cache_lookup_worker(x))
bfd_boolean
bfd_cache_init PARAMS ((bfd *abfd));
bfd_boolean bfd_cache_init (bfd *abfd);
bfd_boolean
bfd_cache_close PARAMS ((bfd *abfd));
bfd_boolean bfd_cache_close (bfd *abfd);
FILE*
bfd_open_file PARAMS ((bfd *abfd));
FILE* bfd_open_file (bfd *abfd);
FILE *
bfd_cache_lookup_worker PARAMS ((bfd *abfd));
FILE *bfd_cache_lookup_worker (bfd *abfd);
/* Extracted from reloc.c. */
#ifdef _BFD_MAKE_TABLE_bfd_reloc_code_real
@ -1489,44 +1471,40 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
};
#endif
reloc_howto_type *
bfd_default_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
reloc_howto_type *bfd_default_reloc_type_lookup
(bfd *abfd, bfd_reloc_code_real_type code);
bfd_boolean
bfd_generic_relax_section PARAMS ((bfd *abfd,
bfd_boolean bfd_generic_relax_section
(bfd *abfd,
asection *section,
struct bfd_link_info *,
bfd_boolean *));
bfd_boolean *);
bfd_boolean
bfd_generic_gc_sections PARAMS ((bfd *, struct bfd_link_info *));
bfd_boolean bfd_generic_gc_sections
(bfd *, struct bfd_link_info *);
bfd_boolean
bfd_generic_merge_sections PARAMS ((bfd *, struct bfd_link_info *));
bfd_boolean bfd_generic_merge_sections
(bfd *, struct bfd_link_info *);
bfd_byte *
bfd_generic_get_relocated_section_contents PARAMS ((bfd *abfd,
bfd_byte *bfd_generic_get_relocated_section_contents
(bfd *abfd,
struct bfd_link_info *link_info,
struct bfd_link_order *link_order,
bfd_byte *data,
bfd_boolean relocatable,
asymbol **symbols));
asymbol **symbols);
/* Extracted from archures.c. */
extern const bfd_arch_info_type bfd_default_arch_struct;
bfd_boolean
bfd_default_set_arch_mach PARAMS ((bfd *abfd,
enum bfd_architecture arch,
unsigned long mach));
bfd_boolean bfd_default_set_arch_mach
(bfd *abfd, enum bfd_architecture arch, unsigned long mach);
const bfd_arch_info_type *
bfd_default_compatible PARAMS ((const bfd_arch_info_type *a,
const bfd_arch_info_type *b));
const bfd_arch_info_type *bfd_default_compatible
(const bfd_arch_info_type *a, const bfd_arch_info_type *b);
bfd_boolean
bfd_default_scan PARAMS ((const struct bfd_arch_info *info, const char *string));
bfd_boolean bfd_default_scan
(const struct bfd_arch_info *info, const char *string);
/* Extracted from elf.c. */
struct elf_internal_shdr *
bfd_elf_find_section PARAMS ((bfd *abfd, char *name));
struct elf_internal_shdr *bfd_elf_find_section (bfd *abfd, char *name);

File diff suppressed because it is too large Load Diff

View File

@ -47,17 +47,17 @@ static unsigned int _bfd_id_counter = 0;
/* Return a new BFD. All BFD's are allocated through this routine. */
bfd *
_bfd_new_bfd ()
_bfd_new_bfd (void)
{
bfd *nbfd;
nbfd = (bfd *) bfd_zmalloc ((bfd_size_type) sizeof (bfd));
nbfd = bfd_zmalloc (sizeof (bfd));
if (nbfd == NULL)
return NULL;
nbfd->id = _bfd_id_counter++;
nbfd->memory = (PTR) objalloc_create ();
nbfd->memory = objalloc_create ();
if (nbfd->memory == NULL)
{
bfd_set_error (bfd_error_no_memory);
@ -77,15 +77,15 @@ _bfd_new_bfd ()
free (nbfd);
return NULL;
}
nbfd->sections = (asection *) NULL;
nbfd->sections = NULL;
nbfd->section_tail = &nbfd->sections;
nbfd->format = bfd_unknown;
nbfd->my_archive = (bfd *) NULL;
nbfd->my_archive = NULL;
nbfd->origin = 0;
nbfd->opened_once = FALSE;
nbfd->output_has_begun = FALSE;
nbfd->section_count = 0;
nbfd->usrdata = (PTR) NULL;
nbfd->usrdata = NULL;
nbfd->cacheable = FALSE;
nbfd->flags = BFD_NO_FLAGS;
nbfd->mtime_set = FALSE;
@ -96,8 +96,7 @@ _bfd_new_bfd ()
/* Allocate a new BFD as a member of archive OBFD. */
bfd *
_bfd_new_bfd_contained_in (obfd)
bfd *obfd;
_bfd_new_bfd_contained_in (bfd *obfd)
{
bfd *nbfd;
@ -114,8 +113,7 @@ _bfd_new_bfd_contained_in (obfd)
/* Delete a BFD. */
void
_bfd_delete_bfd (abfd)
bfd *abfd;
_bfd_delete_bfd (bfd *abfd)
{
bfd_hash_table_free (&abfd->section_htab);
objalloc_free ((struct objalloc *) abfd->memory);
@ -133,7 +131,7 @@ FUNCTION
bfd_openr
SYNOPSIS
bfd *bfd_openr(const char *filename, const char *target);
bfd *bfd_openr (const char *filename, const char *target);
DESCRIPTION
Open the file @var{filename} (using <<fopen>>) with the target
@ -148,9 +146,7 @@ DESCRIPTION
*/
bfd *
bfd_openr (filename, target)
const char *filename;
const char *target;
bfd_openr (const char *filename, const char *target)
{
bfd *nbfd;
const bfd_target *target_vec;
@ -192,7 +188,7 @@ FUNCTION
bfd_fdopenr
SYNOPSIS
bfd *bfd_fdopenr(const char *filename, const char *target, int fd);
bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
DESCRIPTION
<<bfd_fdopenr>> is to <<bfd_fopenr>> much like <<fdopen>> is to
@ -214,10 +210,7 @@ DESCRIPTION
*/
bfd *
bfd_fdopenr (filename, target, fd)
const char *filename;
const char *target;
int fd;
bfd_fdopenr (const char *filename, const char *target, int fd)
{
bfd *nbfd;
const bfd_target *target_vec;
@ -244,14 +237,14 @@ bfd_fdopenr (filename, target, fd)
}
#ifndef HAVE_FDOPEN
nbfd->iostream = (PTR) fopen (filename, FOPEN_RB);
nbfd->iostream = fopen (filename, FOPEN_RB);
#else
/* (O_ACCMODE) parens are to avoid Ultrix header file bug. */
switch (fdflags & (O_ACCMODE))
{
case O_RDONLY: nbfd->iostream = (PTR) fdopen (fd, FOPEN_RB); break;
case O_WRONLY: nbfd->iostream = (PTR) fdopen (fd, FOPEN_RUB); break;
case O_RDWR: nbfd->iostream = (PTR) fdopen (fd, FOPEN_RUB); break;
case O_RDONLY: nbfd->iostream = fdopen (fd, FOPEN_RB); break;
case O_WRONLY: nbfd->iostream = fdopen (fd, FOPEN_RUB); break;
case O_RDWR: nbfd->iostream = fdopen (fd, FOPEN_RUB); break;
default: abort ();
}
#endif
@ -292,7 +285,7 @@ FUNCTION
bfd_openstreamr
SYNOPSIS
bfd *bfd_openstreamr(const char *, const char *, PTR);
bfd *bfd_openstreamr (const char *, const char *, void *);
DESCRIPTION
@ -301,12 +294,9 @@ DESCRIPTION
*/
bfd *
bfd_openstreamr (filename, target, streamarg)
const char *filename;
const char *target;
PTR streamarg;
bfd_openstreamr (const char *filename, const char *target, void *streamarg)
{
FILE *stream = (FILE *) streamarg;
FILE *stream = streamarg;
bfd *nbfd;
const bfd_target *target_vec;
@ -321,7 +311,7 @@ bfd_openstreamr (filename, target, streamarg)
return NULL;
}
nbfd->iostream = (PTR) stream;
nbfd->iostream = stream;
nbfd->filename = filename;
nbfd->direction = read_direction;
@ -344,7 +334,7 @@ FUNCTION
bfd_openw
SYNOPSIS
bfd *bfd_openw(const char *filename, const char *target);
bfd *bfd_openw (const char *filename, const char *target);
DESCRIPTION
Create a BFD, associated with file @var{filename}, using the
@ -355,9 +345,7 @@ DESCRIPTION
*/
bfd *
bfd_openw (filename, target)
const char *filename;
const char *target;
bfd_openw (const char *filename, const char *target)
{
bfd *nbfd;
const bfd_target *target_vec;
@ -415,8 +403,7 @@ RETURNS
bfd_boolean
bfd_close (abfd)
bfd *abfd;
bfd_close (bfd *abfd)
{
bfd_boolean ret;
@ -478,8 +465,7 @@ RETURNS
*/
bfd_boolean
bfd_close_all_done (abfd)
bfd *abfd;
bfd_close_all_done (bfd *abfd)
{
bfd_boolean ret;
@ -514,7 +500,7 @@ FUNCTION
bfd_create
SYNOPSIS
bfd *bfd_create(const char *filename, bfd *templ);
bfd *bfd_create (const char *filename, bfd *templ);
DESCRIPTION
Create a new BFD in the manner of <<bfd_openw>>, but without
@ -523,9 +509,7 @@ DESCRIPTION
*/
bfd *
bfd_create (filename, templ)
const char *filename;
bfd *templ;
bfd_create (const char *filename, bfd *templ)
{
bfd *nbfd;
@ -559,8 +543,7 @@ RETURNS
*/
bfd_boolean
bfd_make_writable(abfd)
bfd *abfd;
bfd_make_writable (bfd *abfd)
{
struct bfd_in_memory *bim;
@ -570,9 +553,8 @@ bfd_make_writable(abfd)
return FALSE;
}
bim = ((struct bfd_in_memory *)
bfd_malloc ((bfd_size_type) sizeof (struct bfd_in_memory)));
abfd->iostream = (PTR) bim;
bim = bfd_malloc (sizeof (struct bfd_in_memory));
abfd->iostream = bim;
/* bfd_bwrite will grow these as needed. */
bim->size = 0;
bim->buffer = 0;
@ -602,8 +584,7 @@ RETURNS
<<TRUE>> is returned if all is ok, otherwise <<FALSE>>. */
bfd_boolean
bfd_make_readable(abfd)
bfd *abfd;
bfd_make_readable (bfd *abfd)
{
if (abfd->direction != write_direction || !(abfd->flags & BFD_IN_MEMORY))
{
@ -622,12 +603,12 @@ bfd_make_readable(abfd)
abfd->where = 0;
abfd->format = bfd_unknown;
abfd->my_archive = (bfd *) NULL;
abfd->my_archive = NULL;
abfd->origin = 0;
abfd->opened_once = FALSE;
abfd->output_has_begun = FALSE;
abfd->section_count = 0;
abfd->usrdata = (PTR) NULL;
abfd->usrdata = NULL;
abfd->cacheable = FALSE;
abfd->flags = BFD_IN_MEMORY;
abfd->mtime_set = FALSE;
@ -650,7 +631,7 @@ INTERNAL_FUNCTION
bfd_alloc
SYNOPSIS
PTR bfd_alloc (bfd *abfd, size_t wanted);
void *bfd_alloc (bfd *abfd, size_t wanted);
DESCRIPTION
Allocate a block of @var{wanted} bytes of memory attached to
@ -658,12 +639,10 @@ DESCRIPTION
*/
PTR
bfd_alloc (abfd, size)
bfd *abfd;
bfd_size_type size;
void *
bfd_alloc (bfd *abfd, bfd_size_type size)
{
PTR ret;
void *ret;
if (size != (unsigned long) size)
{
@ -677,12 +656,10 @@ bfd_alloc (abfd, size)
return ret;
}
PTR
bfd_zalloc (abfd, size)
bfd *abfd;
bfd_size_type size;
void *
bfd_zalloc (bfd *abfd, bfd_size_type size)
{
PTR res;
void *res;
res = bfd_alloc (abfd, size);
if (res)
@ -694,9 +671,7 @@ bfd_zalloc (abfd, size)
Note: Also frees all more recently allocated blocks! */
void
bfd_release (abfd, block)
bfd *abfd;
PTR block;
bfd_release (bfd *abfd, void *block)
{
objalloc_free_block ((struct objalloc *) abfd->memory, block);
}
@ -716,17 +691,14 @@ bfd_release (abfd, block)
without debug symbols).
*/
static char * get_debug_link_info PARAMS ((bfd *, unsigned long *));
static bfd_boolean separate_debug_file_exists PARAMS ((const char *, const unsigned long));
static char * find_separate_debug_file PARAMS ((bfd *, const char *));
#define GNU_DEBUGLINK ".gnu_debuglink"
/*
FUNCTION
bfd_calc_gnu_debuglink_crc32
SYNOPSIS
unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len);
unsigned long bfd_calc_gnu_debuglink_crc32
(unsigned long crc, const unsigned char *buf, bfd_size_type len);
DESCRIPTION
Computes a CRC value as used in the .gnu_debuglink section.
@ -738,10 +710,9 @@ RETURNS
*/
unsigned long
bfd_calc_gnu_debuglink_crc32 (crc, buf, len)
unsigned long crc;
const unsigned char *buf;
bfd_size_type len;
bfd_calc_gnu_debuglink_crc32 (unsigned long crc,
const unsigned char *buf,
bfd_size_type len)
{
static const unsigned long crc32_table[256] =
{
@ -812,7 +783,7 @@ INTERNAL_FUNCTION
get_debug_link_info
SYNOPSIS
char * get_debug_link_info (bfd * abfd, unsigned long * crc32_out)
char *get_debug_link_info (bfd *abfd, unsigned long *crc32_out);
DESCRIPTION
fetch the filename and CRC32 value for any separate debuginfo
@ -821,9 +792,7 @@ DESCRIPTION
*/
static char *
get_debug_link_info (abfd, crc32_out)
bfd * abfd;
unsigned long * crc32_out;
get_debug_link_info (bfd *abfd, unsigned long *crc32_out)
{
asection * sect;
bfd_size_type debuglink_size;
@ -846,8 +815,7 @@ get_debug_link_info (abfd, crc32_out)
if (contents == NULL)
return NULL;
ret = bfd_get_section_contents (abfd, sect, contents,
(file_ptr)0, debuglink_size);
ret = bfd_get_section_contents (abfd, sect, contents, 0, debuglink_size);
if (! ret)
{
free (contents);
@ -858,7 +826,7 @@ get_debug_link_info (abfd, crc32_out)
crc_offset = strlen (contents) + 1;
crc_offset = (crc_offset + 3) & ~3;
crc32 = bfd_get_32 (abfd, (bfd_byte *) (contents + crc_offset));
crc32 = bfd_get_32 (abfd, contents + crc_offset);
*crc32_out = crc32;
return contents;
@ -869,7 +837,8 @@ INTERNAL_FUNCTION
separate_debug_file_exists
SYNOPSIS
bfd_boolean separate_debug_file_exists (char * name, unsigned long crc32)
bfd_boolean separate_debug_file_exists
(char *name, unsigned long crc32);
DESCRIPTION
Checks to see if @var{name} is a file and if its contents
@ -877,9 +846,7 @@ DESCRIPTION
*/
static bfd_boolean
separate_debug_file_exists (name, crc)
const char *name;
const unsigned long crc;
separate_debug_file_exists (const char *name, const unsigned long crc)
{
static char buffer [8 * 1024];
unsigned long file_crc = 0;
@ -906,7 +873,7 @@ INTERNAL_FUNCTION
find_separate_debug_file
SYNOPSIS
char * find_separate_debug_file (bfd *abfd)
char *find_separate_debug_file (bfd *abfd);
DESCRIPTION
Searches @var{abfd} for a reference to separate debugging
@ -918,9 +885,7 @@ DESCRIPTION
*/
static char *
find_separate_debug_file (abfd, debug_file_directory)
bfd *abfd;
const char *debug_file_directory;
find_separate_debug_file (bfd *abfd, const char *debug_file_directory)
{
char *basename;
char *dir;
@ -1026,7 +991,7 @@ FUNCTION
bfd_follow_gnu_debuglink
SYNOPSIS
char * bfd_follow_gnu_debuglink(bfd *abfd, const char *dir);
char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
DESCRIPTION
@ -1045,9 +1010,7 @@ RETURNS
*/
char *
bfd_follow_gnu_debuglink (abfd, dir)
bfd *abfd;
const char * dir;
bfd_follow_gnu_debuglink (bfd *abfd, const char *dir)
{
#if 0 /* Disabled until DEBUGDIR can be defined by configure.in */
if (dir == NULL)
@ -1061,7 +1024,8 @@ FUNCTION
bfd_create_gnu_debuglink_section
SYNOPSIS
struct sec * bfd_create_gnu_debuglink_section (bfd * abfd, const char * filename);
struct sec *bfd_create_gnu_debuglink_section
(bfd *abfd, const char *filename);
DESCRIPTION
@ -1074,12 +1038,10 @@ RETURNS
*/
asection *
bfd_create_gnu_debuglink_section
(bfd * abfd,
const char * filename)
bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename)
{
asection * sect;
bfd_size_type debuglink_size;
asection *sect;
bfd_size_type debuglink_size;
if (abfd == NULL || filename == NULL)
{
@ -1126,7 +1088,8 @@ FUNCTION
bfd_fill_in_gnu_debuglink_section
SYNOPSIS
bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd * abfd, struct sec * sect, const char * filename);
bfd_boolean bfd_fill_in_gnu_debuglink_section
(bfd *abfd, struct sec *sect, const char *filename);
DESCRIPTION
@ -1141,10 +1104,9 @@ RETURNS
*/
bfd_boolean
bfd_fill_in_gnu_debuglink_section
(bfd * abfd,
struct sec * sect,
const char * filename)
bfd_fill_in_gnu_debuglink_section (bfd *abfd,
struct sec *sect,
const char *filename)
{
bfd_size_type debuglink_size;
unsigned long crc32;
@ -1198,10 +1160,9 @@ bfd_fill_in_gnu_debuglink_section
strcpy (contents, filename);
crc_offset = debuglink_size - 4;
bfd_put_32 (abfd, crc32, (bfd_byte *) (contents + crc_offset));
bfd_put_32 (abfd, crc32, contents + crc_offset);
if (! bfd_set_section_contents (abfd, sect, contents,
(file_ptr)0, debuglink_size))
if (! bfd_set_section_contents (abfd, sect, contents, 0, debuglink_size))
{
/* XXX Should we delete the section from the bfd ? */
free (contents);

View File

@ -321,8 +321,8 @@ CODE_FRAGMENT
. strange relocation methods to be accomodated (e.g., i960 callj
. instructions). *}
. bfd_reloc_status_type (*special_function)
. PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *,
. bfd *, char **));
. (bfd *, arelent *, struct symbol_cache_entry *, void *, asection *,
. bfd *, char **);
.
. {* The textual name of the relocation type. *}
. char *name;
@ -401,7 +401,7 @@ DESCRIPTION
.#define HOWTO_PREPARE(relocation, symbol) \
. { \
. if (symbol != (asymbol *) NULL) \
. if (symbol != NULL) \
. { \
. if (bfd_is_com_section (symbol->section)) \
. { \
@ -429,8 +429,7 @@ DESCRIPTION
*/
unsigned int
bfd_get_reloc_size (howto)
reloc_howto_type *howto;
bfd_get_reloc_size (reloc_howto_type *howto)
{
switch (howto->size)
{
@ -470,13 +469,12 @@ FUNCTION
bfd_check_overflow
SYNOPSIS
bfd_reloc_status_type
bfd_check_overflow
(enum complain_overflow how,
unsigned int bitsize,
unsigned int rightshift,
unsigned int addrsize,
bfd_vma relocation);
bfd_reloc_status_type bfd_check_overflow
(enum complain_overflow how,
unsigned int bitsize,
unsigned int rightshift,
unsigned int addrsize,
bfd_vma relocation);
DESCRIPTION
Perform overflow checking on @var{relocation} which has
@ -488,12 +486,11 @@ DESCRIPTION
*/
bfd_reloc_status_type
bfd_check_overflow (how, bitsize, rightshift, addrsize, relocation)
enum complain_overflow how;
unsigned int bitsize;
unsigned int rightshift;
unsigned int addrsize;
bfd_vma relocation;
bfd_check_overflow (enum complain_overflow how,
unsigned int bitsize,
unsigned int rightshift,
unsigned int addrsize,
bfd_vma relocation)
{
bfd_vma fieldmask, addrmask, signmask, ss, a;
bfd_reloc_status_type flag = bfd_reloc_ok;
@ -553,14 +550,13 @@ FUNCTION
bfd_perform_relocation
SYNOPSIS
bfd_reloc_status_type
bfd_perform_relocation
(bfd *abfd,
arelent *reloc_entry,
PTR data,
asection *input_section,
bfd *output_bfd,
char **error_message);
bfd_reloc_status_type bfd_perform_relocation
(bfd *abfd,
arelent *reloc_entry,
void *data,
asection *input_section,
bfd *output_bfd,
char **error_message);
DESCRIPTION
If @var{output_bfd} is supplied to this function, the
@ -581,14 +577,12 @@ DESCRIPTION
*/
bfd_reloc_status_type
bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd,
error_message)
bfd *abfd;
arelent *reloc_entry;
PTR data;
asection *input_section;
bfd *output_bfd;
char **error_message;
bfd_perform_relocation (bfd *abfd,
arelent *reloc_entry,
void *data,
asection *input_section,
bfd *output_bfd,
char **error_message)
{
bfd_vma relocation;
bfd_reloc_status_type flag = bfd_reloc_ok;
@ -600,7 +594,7 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd,
symbol = *(reloc_entry->sym_ptr_ptr);
if (bfd_is_abs_section (symbol->section)
&& output_bfd != (bfd *) NULL)
&& output_bfd != NULL)
{
reloc_entry->address += input_section->output_offset;
return bfd_reloc_ok;
@ -611,7 +605,7 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd,
considered to have a value of zero (SVR4 ABI, p. 4-27). */
if (bfd_is_und_section (symbol->section)
&& (symbol->flags & BSF_WEAK) == 0
&& output_bfd == (bfd *) NULL)
&& output_bfd == NULL)
flag = bfd_reloc_undefined;
/* If there is a function supplied to handle this relocation type,
@ -695,7 +689,7 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd,
relocation -= reloc_entry->address;
}
if (output_bfd != (bfd *) NULL)
if (output_bfd != NULL)
{
if (! howto->partial_inplace)
{
@ -958,13 +952,12 @@ FUNCTION
bfd_install_relocation
SYNOPSIS
bfd_reloc_status_type
bfd_install_relocation
(bfd *abfd,
arelent *reloc_entry,
PTR data, bfd_vma data_start,
asection *input_section,
char **error_message);
bfd_reloc_status_type bfd_install_relocation
(bfd *abfd,
arelent *reloc_entry,
void *data, bfd_vma data_start,
asection *input_section,
char **error_message);
DESCRIPTION
This looks remarkably like <<bfd_perform_relocation>>, except it
@ -977,14 +970,12 @@ DESCRIPTION
*/
bfd_reloc_status_type
bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset,
input_section, error_message)
bfd *abfd;
arelent *reloc_entry;
PTR data_start;
bfd_vma data_start_offset;
asection *input_section;
char **error_message;
bfd_install_relocation (bfd *abfd,
arelent *reloc_entry,
void *data_start,
bfd_vma data_start_offset,
asection *input_section,
char **error_message)
{
bfd_vma relocation;
bfd_reloc_status_type flag = bfd_reloc_ok;
@ -1277,32 +1268,32 @@ space consuming. For each target:
{
case 0:
{
char x = bfd_get_8 (abfd, (char *) data);
char x = bfd_get_8 (abfd, data);
DOIT (x);
bfd_put_8 (abfd, x, (unsigned char *) data);
bfd_put_8 (abfd, x, data);
}
break;
case 1:
{
short x = bfd_get_16 (abfd, (bfd_byte *) data);
short x = bfd_get_16 (abfd, data);
DOIT (x);
bfd_put_16 (abfd, (bfd_vma) x, (unsigned char *) data);
bfd_put_16 (abfd, (bfd_vma) x, data);
}
break;
case 2:
{
long x = bfd_get_32 (abfd, (bfd_byte *) data);
long x = bfd_get_32 (abfd, data);
DOIT (x);
bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data);
bfd_put_32 (abfd, (bfd_vma) x, data);
}
break;
case -2:
{
long x = bfd_get_32 (abfd, (bfd_byte *) data);
long x = bfd_get_32 (abfd, data);
relocation = -relocation;
DOIT (x);
bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data);
bfd_put_32 (abfd, (bfd_vma) x, data);
}
break;
@ -1312,9 +1303,9 @@ space consuming. For each target:
case 4:
{
bfd_vma x = bfd_get_64 (abfd, (bfd_byte *) data);
bfd_vma x = bfd_get_64 (abfd, data);
DOIT (x);
bfd_put_64 (abfd, x, (bfd_byte *) data);
bfd_put_64 (abfd, x, data);
}
break;
default:
@ -1347,15 +1338,13 @@ space consuming. For each target:
ADDEND is the addend of the reloc. */
bfd_reloc_status_type
_bfd_final_link_relocate (howto, input_bfd, input_section, contents, address,
value, addend)
reloc_howto_type *howto;
bfd *input_bfd;
asection *input_section;
bfd_byte *contents;
bfd_vma address;
bfd_vma value;
bfd_vma addend;
_bfd_final_link_relocate (reloc_howto_type *howto,
bfd *input_bfd,
asection *input_section,
bfd_byte *contents,
bfd_vma address,
bfd_vma value,
bfd_vma addend)
{
bfd_vma relocation;
@ -1394,11 +1383,10 @@ _bfd_final_link_relocate (howto, input_bfd, input_section, contents, address,
/* Relocate a given location using a given value and howto. */
bfd_reloc_status_type
_bfd_relocate_contents (howto, input_bfd, relocation, location)
reloc_howto_type *howto;
bfd *input_bfd;
bfd_vma relocation;
bfd_byte *location;
_bfd_relocate_contents (reloc_howto_type *howto,
bfd *input_bfd,
bfd_vma relocation,
bfd_byte *location)
{
int size;
bfd_vma x = 0;
@ -3905,8 +3893,8 @@ FUNCTION
bfd_reloc_type_lookup
SYNOPSIS
reloc_howto_type *
bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code);
reloc_howto_type *bfd_reloc_type_lookup
(bfd *abfd, bfd_reloc_code_real_type code);
DESCRIPTION
Return a pointer to a howto structure which, when
@ -3916,9 +3904,7 @@ DESCRIPTION
*/
reloc_howto_type *
bfd_reloc_type_lookup (abfd, code)
bfd *abfd;
bfd_reloc_code_real_type code;
bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code)
{
return BFD_SEND (abfd, reloc_type_lookup, (abfd, code));
}
@ -3932,7 +3918,7 @@ INTERNAL_FUNCTION
SYNOPSIS
reloc_howto_type *bfd_default_reloc_type_lookup
(bfd *abfd, bfd_reloc_code_real_type code);
(bfd *abfd, bfd_reloc_code_real_type code);
DESCRIPTION
Provides a default relocation lookup routine for any architecture.
@ -3940,9 +3926,7 @@ DESCRIPTION
*/
reloc_howto_type *
bfd_default_reloc_type_lookup (abfd, code)
bfd *abfd;
bfd_reloc_code_real_type code;
bfd_default_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code)
{
switch (code)
{
@ -3963,7 +3947,7 @@ bfd_default_reloc_type_lookup (abfd, code)
default:
BFD_FAIL ();
}
return (reloc_howto_type *) NULL;
return NULL;
}
/*
@ -3979,12 +3963,11 @@ DESCRIPTION
*/
const char *
bfd_get_reloc_code_name (code)
bfd_reloc_code_real_type code;
bfd_get_reloc_code_name (bfd_reloc_code_real_type code)
{
if ((int) code > (int) BFD_RELOC_UNUSED)
if (code > BFD_RELOC_UNUSED)
return 0;
return bfd_reloc_code_real_names[(int)code];
return bfd_reloc_code_real_names[code];
}
/*
@ -3993,10 +3976,10 @@ INTERNAL_FUNCTION
SYNOPSIS
bfd_boolean bfd_generic_relax_section
(bfd *abfd,
asection *section,
struct bfd_link_info *,
bfd_boolean *);
(bfd *abfd,
asection *section,
struct bfd_link_info *,
bfd_boolean *);
DESCRIPTION
Provides default handling for relaxing for back ends which
@ -4004,11 +3987,10 @@ DESCRIPTION
*/
bfd_boolean
bfd_generic_relax_section (abfd, section, link_info, again)
bfd *abfd ATTRIBUTE_UNUSED;
asection *section ATTRIBUTE_UNUSED;
struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
bfd_boolean *again;
bfd_generic_relax_section (bfd *abfd ATTRIBUTE_UNUSED,
asection *section ATTRIBUTE_UNUSED,
struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
bfd_boolean *again)
{
*again = FALSE;
return TRUE;
@ -4020,7 +4002,7 @@ INTERNAL_FUNCTION
SYNOPSIS
bfd_boolean bfd_generic_gc_sections
(bfd *, struct bfd_link_info *);
(bfd *, struct bfd_link_info *);
DESCRIPTION
Provides default handling for relaxing for back ends which
@ -4028,9 +4010,8 @@ DESCRIPTION
*/
bfd_boolean
bfd_generic_gc_sections (abfd, link_info)
bfd *abfd ATTRIBUTE_UNUSED;
struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
bfd_generic_gc_sections (bfd *abfd ATTRIBUTE_UNUSED,
struct bfd_link_info *link_info ATTRIBUTE_UNUSED)
{
return TRUE;
}
@ -4041,7 +4022,7 @@ INTERNAL_FUNCTION
SYNOPSIS
bfd_boolean bfd_generic_merge_sections
(bfd *, struct bfd_link_info *);
(bfd *, struct bfd_link_info *);
DESCRIPTION
Provides default handling for SEC_MERGE section merging for back ends
@ -4049,9 +4030,8 @@ DESCRIPTION
*/
bfd_boolean
bfd_generic_merge_sections (abfd, link_info)
bfd *abfd ATTRIBUTE_UNUSED;
struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
bfd_generic_merge_sections (bfd *abfd ATTRIBUTE_UNUSED,
struct bfd_link_info *link_info ATTRIBUTE_UNUSED)
{
return TRUE;
}
@ -4061,13 +4041,13 @@ INTERNAL_FUNCTION
bfd_generic_get_relocated_section_contents
SYNOPSIS
bfd_byte *
bfd_generic_get_relocated_section_contents (bfd *abfd,
struct bfd_link_info *link_info,
struct bfd_link_order *link_order,
bfd_byte *data,
bfd_boolean relocatable,
asymbol **symbols);
bfd_byte *bfd_generic_get_relocated_section_contents
(bfd *abfd,
struct bfd_link_info *link_info,
struct bfd_link_order *link_order,
bfd_byte *data,
bfd_boolean relocatable,
asymbol **symbols);
DESCRIPTION
Provides default handling of relocation effort for back ends
@ -4076,14 +4056,12 @@ DESCRIPTION
*/
bfd_byte *
bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data,
relocatable, symbols)
bfd *abfd;
struct bfd_link_info *link_info;
struct bfd_link_order *link_order;
bfd_byte *data;
bfd_boolean relocatable;
asymbol **symbols;
bfd_generic_get_relocated_section_contents (bfd *abfd,
struct bfd_link_info *link_info,
struct bfd_link_order *link_order,
bfd_byte *data,
bfd_boolean relocatable,
asymbol **symbols)
{
/* Get enough memory to hold the stuff. */
bfd *input_bfd = link_order->u.indirect.section->owner;
@ -4096,15 +4074,15 @@ bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data,
if (reloc_size < 0)
goto error_return;
reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size);
reloc_vector = bfd_malloc (reloc_size);
if (reloc_vector == NULL && reloc_size != 0)
goto error_return;
/* Read in the section. */
if (!bfd_get_section_contents (input_bfd,
input_section,
(PTR) data,
(bfd_vma) 0,
data,
0,
input_section->_raw_size))
goto error_return;
@ -4122,16 +4100,15 @@ bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data,
if (reloc_count > 0)
{
arelent **parent;
for (parent = reloc_vector; *parent != (arelent *) NULL;
parent++)
for (parent = reloc_vector; *parent != NULL; parent++)
{
char *error_message = (char *) NULL;
char *error_message = NULL;
bfd_reloc_status_type r =
bfd_perform_relocation (input_bfd,
*parent,
(PTR) data,
data,
input_section,
relocatable ? abfd : (bfd *) NULL,
relocatable ? abfd : NULL,
&error_message);
if (relocatable)
@ -4155,7 +4132,7 @@ bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data,
goto error_return;
break;
case bfd_reloc_dangerous:
BFD_ASSERT (error_message != (char *) NULL);
BFD_ASSERT (error_message != NULL);
if (!((*link_info->callbacks->reloc_dangerous)
(link_info, error_message, input_bfd, input_section,
(*parent)->address)))

View File

@ -475,7 +475,7 @@ CODE_FRAGMENT
. file_ptr line_filepos;
.
. {* Pointer to data for applications. *}
. PTR userdata;
. void *userdata;
.
. {* If the SEC_IN_MEMORY flag is set, this points to the actual
. contents. *}
@ -504,7 +504,7 @@ CODE_FRAGMENT
. {* What the section number is in the target world. *}
. int target_index;
.
. PTR used_by_bfd;
. void *used_by_bfd;
.
. {* If this is a constructor section then here is a list of the
. relocations created to relocate items within it. *}
@ -676,10 +676,9 @@ struct section_hash_entry
/* Initialize an entry in the section hash table. */
struct bfd_hash_entry *
bfd_section_hash_newfunc (entry, table, string)
struct bfd_hash_entry *entry;
struct bfd_hash_table *table;
const char *string;
bfd_section_hash_newfunc (struct bfd_hash_entry *entry,
struct bfd_hash_table *table,
const char *string)
{
/* Allocate the structure if it has not already been allocated by a
subclass. */
@ -694,10 +693,8 @@ bfd_section_hash_newfunc (entry, table, string)
/* Call the allocation method of the superclass. */
entry = bfd_hash_newfunc (entry, table, string);
if (entry != NULL)
{
memset ((PTR) &((struct section_hash_entry *) entry)->section,
0, sizeof (asection));
}
memset (&((struct section_hash_entry *) entry)->section, 0,
sizeof (asection));
return entry;
}
@ -711,9 +708,7 @@ bfd_section_hash_newfunc (entry, table, string)
static asection *bfd_section_init PARAMS ((bfd *, asection *));
static asection *
bfd_section_init (abfd, newsect)
bfd *abfd;
asection *newsect;
bfd_section_init (bfd *abfd, asection *newsect)
{
static int section_id = 0x10; /* id 0 to 3 used by STD_SECTION. */
@ -768,13 +763,12 @@ DESCRIPTION
*/
void
bfd_section_list_clear (abfd)
bfd *abfd;
bfd_section_list_clear (bfd *abfd)
{
abfd->sections = NULL;
abfd->section_tail = &abfd->sections;
abfd->section_count = 0;
memset ((PTR) abfd->section_htab.table, 0,
memset (abfd->section_htab.table, 0,
abfd->section_htab.size * sizeof (struct bfd_hash_entry *));
}
@ -783,7 +777,7 @@ FUNCTION
bfd_get_section_by_name
SYNOPSIS
asection *bfd_get_section_by_name(bfd *abfd, const char *name);
asection *bfd_get_section_by_name (bfd *abfd, const char *name);
DESCRIPTION
Run through @var{abfd} and return the one of the
@ -797,9 +791,7 @@ DESCRIPTION
*/
asection *
bfd_get_section_by_name (abfd, name)
bfd *abfd;
const char *name;
bfd_get_section_by_name (bfd *abfd, const char *name)
{
struct section_hash_entry *sh;
@ -815,9 +807,8 @@ FUNCTION
bfd_get_unique_section_name
SYNOPSIS
char *bfd_get_unique_section_name(bfd *abfd,
const char *templat,
int *count);
char *bfd_get_unique_section_name
(bfd *abfd, const char *templat, int *count);
DESCRIPTION
Invent a section name that is unique in @var{abfd} by tacking
@ -828,17 +819,14 @@ DESCRIPTION
*/
char *
bfd_get_unique_section_name (abfd, templat, count)
bfd *abfd;
const char *templat;
int *count;
bfd_get_unique_section_name (bfd *abfd, const char *templat, int *count)
{
int num;
unsigned int len;
char *sname;
len = strlen (templat);
sname = bfd_malloc ((bfd_size_type) len + 8);
sname = bfd_malloc (len + 8);
if (sname == NULL)
return NULL;
memcpy (sname, templat, len);
@ -865,7 +853,7 @@ FUNCTION
bfd_make_section_old_way
SYNOPSIS
asection *bfd_make_section_old_way(bfd *abfd, const char *name);
asection *bfd_make_section_old_way (bfd *abfd, const char *name);
DESCRIPTION
Create a new empty section called @var{name}
@ -886,9 +874,7 @@ DESCRIPTION
*/
asection *
bfd_make_section_old_way (abfd, name)
bfd *abfd;
const char *name;
bfd_make_section_old_way (bfd *abfd, const char *name)
{
struct section_hash_entry *sh;
asection *newsect;
@ -931,7 +917,7 @@ FUNCTION
bfd_make_section_anyway
SYNOPSIS
asection *bfd_make_section_anyway(bfd *abfd, const char *name);
asection *bfd_make_section_anyway (bfd *abfd, const char *name);
DESCRIPTION
Create a new empty section called @var{name} and attach it to the end of
@ -944,9 +930,7 @@ DESCRIPTION
*/
sec_ptr
bfd_make_section_anyway (abfd, name)
bfd *abfd;
const char *name;
bfd_make_section_anyway (bfd *abfd, const char *name)
{
struct section_hash_entry *sh;
asection *newsect;
@ -968,7 +952,7 @@ bfd_make_section_anyway (abfd, name)
section_htab without generating a unique section name and
that would be pointless; We don't need to traverse the
hash table. */
newsect = (asection *) bfd_zalloc (abfd, sizeof (asection));
newsect = bfd_zalloc (abfd, sizeof (asection));
if (newsect == NULL)
return NULL;
}
@ -982,7 +966,7 @@ FUNCTION
bfd_make_section
SYNOPSIS
asection *bfd_make_section(bfd *, const char *name);
asection *bfd_make_section (bfd *, const char *name);
DESCRIPTION
Like <<bfd_make_section_anyway>>, but return <<NULL>> (without calling
@ -992,9 +976,7 @@ DESCRIPTION
*/
asection *
bfd_make_section (abfd, name)
bfd *abfd;
const char *name;
bfd_make_section (bfd *abfd, const char *name)
{
struct section_hash_entry *sh;
asection *newsect;
@ -1031,7 +1013,8 @@ FUNCTION
bfd_set_section_flags
SYNOPSIS
bfd_boolean bfd_set_section_flags (bfd *abfd, asection *sec, flagword flags);
bfd_boolean bfd_set_section_flags
(bfd *abfd, asection *sec, flagword flags);
DESCRIPTION
Set the attributes of the section @var{sec} in the BFD
@ -1047,10 +1030,9 @@ DESCRIPTION
/*ARGSUSED*/
bfd_boolean
bfd_set_section_flags (abfd, section, flags)
bfd *abfd ATTRIBUTE_UNUSED;
sec_ptr section;
flagword flags;
bfd_set_section_flags (bfd *abfd ATTRIBUTE_UNUSED,
sec_ptr section,
flagword flags)
{
#if 0
/* If you try to copy a text section from an input file (where it
@ -1074,34 +1056,32 @@ FUNCTION
bfd_map_over_sections
SYNOPSIS
void bfd_map_over_sections(bfd *abfd,
void (*func) (bfd *abfd,
asection *sect,
PTR obj),
PTR obj);
void bfd_map_over_sections
(bfd *abfd,
void (*func) (bfd *abfd, asection *sect, void *obj),
void *obj);
DESCRIPTION
Call the provided function @var{func} for each section
attached to the BFD @var{abfd}, passing @var{obj} as an
argument. The function will be called as if by
| func(abfd, the_section, obj);
| func (abfd, the_section, obj);
This is the prefered method for iterating over sections; an
alternative would be to use a loop:
| section *p;
| for (p = abfd->sections; p != NULL; p = p->next)
| func(abfd, p, ...)
| func (abfd, p, ...)
*/
/*VARARGS2*/
void
bfd_map_over_sections (abfd, operation, user_storage)
bfd *abfd;
void (*operation) PARAMS ((bfd * abfd, asection * sect, PTR obj));
PTR user_storage;
bfd_map_over_sections (bfd *abfd,
void (*operation) (bfd *, asection *, void *),
void *user_storage)
{
asection *sect;
unsigned int i = 0;
@ -1118,7 +1098,8 @@ FUNCTION
bfd_set_section_size
SYNOPSIS
bfd_boolean bfd_set_section_size (bfd *abfd, asection *sec, bfd_size_type val);
bfd_boolean bfd_set_section_size
(bfd *abfd, asection *sec, bfd_size_type val);
DESCRIPTION
Set @var{sec} to the size @var{val}. If the operation is
@ -1131,10 +1112,7 @@ DESCRIPTION
*/
bfd_boolean
bfd_set_section_size (abfd, ptr, val)
bfd *abfd;
sec_ptr ptr;
bfd_size_type val;
bfd_set_section_size (bfd *abfd, sec_ptr ptr, bfd_size_type val)
{
/* Once you've started writing to any section you cannot create or change
the size of any others. */
@ -1156,9 +1134,9 @@ FUNCTION
bfd_set_section_contents
SYNOPSIS
bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section,
PTR data, file_ptr offset,
bfd_size_type count);
bfd_boolean bfd_set_section_contents
(bfd *abfd, asection *section, void *data, file_ptr offset,
bfd_size_type count);
DESCRIPTION
Sets the contents of the section @var{section} in BFD
@ -1178,18 +1156,17 @@ DESCRIPTION
*/
#define bfd_get_section_size_now(abfd,sec) \
(sec->reloc_done \
? bfd_get_section_size_after_reloc (sec) \
: bfd_get_section_size_before_reloc (sec))
#define bfd_get_section_size_now(abfd, sec) \
(sec->reloc_done \
? bfd_get_section_size_after_reloc (sec) \
: bfd_get_section_size_before_reloc (sec))
bfd_boolean
bfd_set_section_contents (abfd, section, location, offset, count)
bfd *abfd;
sec_ptr section;
PTR location;
file_ptr offset;
bfd_size_type count;
bfd_set_section_contents (bfd *abfd,
sec_ptr section,
void *location,
file_ptr offset,
bfd_size_type count)
{
bfd_size_type sz;
@ -1229,7 +1206,7 @@ bfd_set_section_contents (abfd, section, location, offset, count)
/* Record a copy of the data in memory if desired. */
if (section->contents
&& location != (PTR) (section->contents + offset))
&& location != section->contents + offset)
memcpy (section->contents + offset, location, (size_t) count);
if (BFD_SEND (abfd, _bfd_set_section_contents,
@ -1247,9 +1224,9 @@ FUNCTION
bfd_get_section_contents
SYNOPSIS
bfd_boolean bfd_get_section_contents (bfd *abfd, asection *section,
PTR location, file_ptr offset,
bfd_size_type count);
bfd_boolean bfd_get_section_contents
(bfd *abfd, asection *section, void *location, file_ptr offset,
bfd_size_type count);
DESCRIPTION
Read data from @var{section} in BFD @var{abfd}
@ -1265,12 +1242,11 @@ DESCRIPTION
*/
bfd_boolean
bfd_get_section_contents (abfd, section, location, offset, count)
bfd *abfd;
sec_ptr section;
PTR location;
file_ptr offset;
bfd_size_type count;
bfd_get_section_contents (bfd *abfd,
sec_ptr section,
void *location,
file_ptr offset,
bfd_size_type count)
{
bfd_size_type sz;
@ -1317,8 +1293,8 @@ FUNCTION
bfd_copy_private_section_data
SYNOPSIS
bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec,
bfd *obfd, asection *osec);
bfd_boolean bfd_copy_private_section_data
(bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
DESCRIPTION
Copy private section information from @var{isec} in the BFD
@ -1340,7 +1316,7 @@ FUNCTION
SYNOPSIS
void _bfd_strip_section_from_output
(struct bfd_link_info *info, asection *section);
(struct bfd_link_info *info, asection *section);
DESCRIPTION
Remove @var{section} from the output. If the output section
@ -1351,9 +1327,7 @@ DESCRIPTION
to remove sections.
*/
void
_bfd_strip_section_from_output (info, s)
struct bfd_link_info *info;
asection *s;
_bfd_strip_section_from_output (struct bfd_link_info *info, asection *s)
{
asection *os;
asection *is;
@ -1392,9 +1366,8 @@ DESCRIPTION
*/
bfd_boolean
bfd_generic_discard_group (abfd, group)
bfd *abfd ATTRIBUTE_UNUSED;
asection *group ATTRIBUTE_UNUSED;
bfd_generic_discard_group (bfd *abfd ATTRIBUTE_UNUSED,
asection *group ATTRIBUTE_UNUSED)
{
return TRUE;
}

View File

@ -24,89 +24,56 @@
#include "libbfd.h"
#include "bfdlink.h"
static bfd_boolean simple_dummy_warning
PARAMS ((struct bfd_link_info *, const char *, const char *, bfd *,
asection *, bfd_vma));
static bfd_boolean simple_dummy_undefined_symbol
PARAMS ((struct bfd_link_info *, const char *, bfd *, asection *,
bfd_vma, bfd_boolean));
static bfd_boolean simple_dummy_reloc_overflow
PARAMS ((struct bfd_link_info *, const char *, const char *, bfd_vma,
bfd *, asection *, bfd_vma));
static bfd_boolean simple_dummy_reloc_dangerous
PARAMS ((struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma));
static bfd_boolean simple_dummy_unattached_reloc
PARAMS ((struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma));
static void simple_save_output_info
PARAMS ((bfd *, asection *, PTR));
static void simple_restore_output_info
PARAMS ((bfd *, asection *, PTR));
bfd_byte * bfd_simple_get_relocated_section_contents
PARAMS ((bfd *, asection *, bfd_byte *, asymbol **));
static bfd_boolean
simple_dummy_warning (link_info, warning, symbol, abfd, section, address)
struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
const char *warning ATTRIBUTE_UNUSED;
const char *symbol ATTRIBUTE_UNUSED;
bfd *abfd ATTRIBUTE_UNUSED;
asection *section ATTRIBUTE_UNUSED;
bfd_vma address ATTRIBUTE_UNUSED;
simple_dummy_warning (struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
const char *warning ATTRIBUTE_UNUSED,
const char *symbol ATTRIBUTE_UNUSED,
bfd *abfd ATTRIBUTE_UNUSED,
asection *section ATTRIBUTE_UNUSED,
bfd_vma address ATTRIBUTE_UNUSED)
{
return TRUE;
}
static bfd_boolean
simple_dummy_undefined_symbol (link_info, name, abfd, section, address, fatal)
struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
const char *name ATTRIBUTE_UNUSED;
bfd *abfd ATTRIBUTE_UNUSED;
asection *section ATTRIBUTE_UNUSED;
bfd_vma address ATTRIBUTE_UNUSED;
bfd_boolean fatal ATTRIBUTE_UNUSED;
simple_dummy_undefined_symbol (struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED,
bfd *abfd ATTRIBUTE_UNUSED,
asection *section ATTRIBUTE_UNUSED,
bfd_vma address ATTRIBUTE_UNUSED,
bfd_boolean fatal ATTRIBUTE_UNUSED)
{
return TRUE;
}
static bfd_boolean
simple_dummy_reloc_overflow (link_info, name, reloc_name, addend, abfd,
section, address)
struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
const char *name ATTRIBUTE_UNUSED;
const char *reloc_name ATTRIBUTE_UNUSED;
bfd_vma addend ATTRIBUTE_UNUSED;
bfd *abfd ATTRIBUTE_UNUSED;
asection *section ATTRIBUTE_UNUSED;
bfd_vma address ATTRIBUTE_UNUSED;
simple_dummy_reloc_overflow (struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED,
const char *reloc_name ATTRIBUTE_UNUSED,
bfd_vma addend ATTRIBUTE_UNUSED,
bfd *abfd ATTRIBUTE_UNUSED,
asection *section ATTRIBUTE_UNUSED,
bfd_vma address ATTRIBUTE_UNUSED)
{
return TRUE;
}
static bfd_boolean
simple_dummy_reloc_dangerous (link_info, message, abfd, section, address)
struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
const char *message ATTRIBUTE_UNUSED;
bfd *abfd ATTRIBUTE_UNUSED;
asection *section ATTRIBUTE_UNUSED;
bfd_vma address ATTRIBUTE_UNUSED;
simple_dummy_reloc_dangerous (struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
const char *message ATTRIBUTE_UNUSED,
bfd *abfd ATTRIBUTE_UNUSED,
asection *section ATTRIBUTE_UNUSED,
bfd_vma address ATTRIBUTE_UNUSED)
{
return TRUE;
}
static bfd_boolean
simple_dummy_unattached_reloc (link_info, name, abfd, section, address)
struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
const char *name ATTRIBUTE_UNUSED;
bfd *abfd ATTRIBUTE_UNUSED;
asection *section ATTRIBUTE_UNUSED;
bfd_vma address ATTRIBUTE_UNUSED;
simple_dummy_unattached_reloc (struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED,
bfd *abfd ATTRIBUTE_UNUSED,
asection *section ATTRIBUTE_UNUSED,
bfd_vma address ATTRIBUTE_UNUSED)
{
return TRUE;
}
@ -118,12 +85,11 @@ struct saved_output_info
};
static void
simple_save_output_info (abfd, section, ptr)
bfd *abfd ATTRIBUTE_UNUSED;
asection *section;
PTR ptr;
simple_save_output_info (bfd *abfd ATTRIBUTE_UNUSED,
asection *section,
void *ptr)
{
struct saved_output_info *output_info = (struct saved_output_info *) ptr;
struct saved_output_info *output_info = ptr;
output_info[section->index].offset = section->output_offset;
output_info[section->index].section = section->output_section;
section->output_offset = 0;
@ -131,12 +97,11 @@ simple_save_output_info (abfd, section, ptr)
}
static void
simple_restore_output_info (abfd, section, ptr)
bfd *abfd ATTRIBUTE_UNUSED;
asection *section;
PTR ptr;
simple_restore_output_info (bfd *abfd ATTRIBUTE_UNUSED,
asection *section,
void *ptr)
{
struct saved_output_info *output_info = (struct saved_output_info *) ptr;
struct saved_output_info *output_info = ptr;
section->output_offset = output_info[section->index].offset;
section->output_section = output_info[section->index].section;
}
@ -146,7 +111,8 @@ FUNCTION
bfd_simple_relocate_secton
SYNOPSIS
bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
bfd_byte *bfd_simple_get_relocated_section_contents
(bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
DESCRIPTION
Returns the relocated contents of section @var{sec}. The symbols in
@ -163,18 +129,17 @@ DESCRIPTION
*/
bfd_byte *
bfd_simple_get_relocated_section_contents (abfd, sec, outbuf, symbol_table)
bfd *abfd;
asection *sec;
bfd_byte *outbuf;
asymbol **symbol_table;
bfd_simple_get_relocated_section_contents (bfd *abfd,
asection *sec,
bfd_byte *outbuf,
asymbol **symbol_table)
{
struct bfd_link_info link_info;
struct bfd_link_order link_order;
struct bfd_link_callbacks callbacks;
bfd_byte *contents, *data;
int storage_needed;
PTR saved_offsets;
void *saved_offsets;
if (! (sec->flags & SEC_RELOC))
{
@ -246,7 +211,7 @@ bfd_simple_get_relocated_section_contents (abfd, sec, outbuf, symbol_table)
_bfd_generic_link_add_symbols (abfd, &link_info);
storage_needed = bfd_get_symtab_upper_bound (abfd);
symbol_table = (asymbol **) bfd_malloc (storage_needed);
symbol_table = bfd_malloc (storage_needed);
bfd_canonicalize_symtab (abfd, symbol_table);
}
else

View File

@ -77,7 +77,7 @@ SUBSECTION
| if (storage_needed == 0)
| return;
|
| symbol_table = (asymbol **) xmalloc (storage_needed);
| symbol_table = xmalloc (storage_needed);
| ...
| number_of_symbols =
| bfd_canonicalize_symtab (abfd, symbol_table);
@ -122,7 +122,7 @@ SUBSECTION
| new->value = 0x12345;
|
| ptrs[0] = new;
| ptrs[1] = (asymbol *)0;
| ptrs[1] = 0;
|
| bfd_set_symtab (abfd, ptrs, 1);
| bfd_close (abfd);
@ -298,7 +298,7 @@ CODE_FRAGMENT
. {* Back end special data. *}
. union
. {
. PTR p;
. void *p;
. bfd_vma i;
. }
. udata;
@ -314,10 +314,6 @@ CODE_FRAGMENT
#include "bfdlink.h"
#include "aout/stab_gnu.h"
static char coff_section_type PARAMS ((const char *));
static char decode_section_type PARAMS ((const struct sec *));
static int cmpindexentry PARAMS ((const PTR, const PTR));
/*
DOCDD
INODE
@ -354,9 +350,7 @@ DESCRIPTION
*/
bfd_boolean
bfd_is_local_label (abfd, sym)
bfd *abfd;
asymbol *sym;
bfd_is_local_label (bfd *abfd, asymbol *sym)
{
/* The BSF_SECTION_SYM check is needed for IA-64, where every label that
starts with '.' is local. This would accidentally catch section names
@ -382,7 +376,7 @@ DESCRIPTION
local label.
.#define bfd_is_local_label_name(abfd, name) \
. BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
. BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
.
*/
@ -398,8 +392,7 @@ DESCRIPTION
including the NULL.
.#define bfd_canonicalize_symtab(abfd, location) \
. BFD_SEND (abfd, _bfd_canonicalize_symtab,\
. (abfd, location))
. BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
.
*/
@ -408,7 +401,8 @@ FUNCTION
bfd_set_symtab
SYNOPSIS
bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count);
bfd_boolean bfd_set_symtab
(bfd *abfd, asymbol **location, unsigned int count);
DESCRIPTION
Arrange that when the output BFD @var{abfd} is closed,
@ -417,12 +411,9 @@ DESCRIPTION
*/
bfd_boolean
bfd_set_symtab (abfd, location, symcount)
bfd *abfd;
asymbol **location;
unsigned int symcount;
bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int symcount)
{
if ((abfd->format != bfd_object) || (bfd_read_p (abfd)))
if (abfd->format != bfd_object || bfd_read_p (abfd))
{
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
@ -438,25 +429,21 @@ FUNCTION
bfd_print_symbol_vandf
SYNOPSIS
void bfd_print_symbol_vandf (bfd *abfd, PTR file, asymbol *symbol);
void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
DESCRIPTION
Print the value and flags of the @var{symbol} supplied to the
stream @var{file}.
*/
void
bfd_print_symbol_vandf (abfd, arg, symbol)
bfd *abfd;
PTR arg;
asymbol *symbol;
bfd_print_symbol_vandf (bfd *abfd, void *arg, asymbol *symbol)
{
FILE *file = (FILE *) arg;
FILE *file = arg;
flagword type = symbol->flags;
if (symbol->section != (asection *) NULL)
bfd_fprintf_vma (abfd, file,
symbol->value + symbol->section->vma);
if (symbol->section != NULL)
bfd_fprintf_vma (abfd, file, symbol->value + symbol->section->vma);
else
bfd_fprintf_vma (abfd, file, symbol->value);
@ -493,7 +480,7 @@ DESCRIPTION
information, and will cause problems later on.
.#define bfd_make_empty_symbol(abfd) \
. BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
. BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
.
*/
@ -502,7 +489,7 @@ FUNCTION
_bfd_generic_make_empty_symbol
SYNOPSIS
asymbol * _bfd_generic_make_empty_symbol (bfd *);
asymbol *_bfd_generic_make_empty_symbol (bfd *);
DESCRIPTION
Create a new <<asymbol>> structure for the BFD @var{abfd}
@ -512,11 +499,10 @@ DESCRIPTION
*/
asymbol *
_bfd_generic_make_empty_symbol (abfd)
bfd *abfd;
_bfd_generic_make_empty_symbol (bfd *abfd)
{
bfd_size_type amt = sizeof (asymbol);
asymbol *new = (asymbol *) bfd_zalloc (abfd, amt);
asymbol *new = bfd_zalloc (abfd, amt);
if (new)
new->the_bfd = abfd;
return new;
@ -532,7 +518,7 @@ DESCRIPTION
yet to be worked out.
.#define bfd_make_debug_symbol(abfd,ptr,size) \
. BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
. BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
.
*/
@ -576,8 +562,7 @@ static const struct section_to_type stt[] =
't' as well as .text */
static char
coff_section_type (s)
const char *s;
coff_section_type (const char *s)
{
const struct section_to_type *t;
@ -596,8 +581,7 @@ coff_section_type (s)
we could perhaps obsolete coff_section_type. */
static char
decode_section_type (section)
const struct sec *section;
decode_section_type (const struct sec *section)
{
if (section->flags & SEC_CODE)
return 't';
@ -619,8 +603,7 @@ decode_section_type (section)
}
if (section->flags & SEC_DEBUGGING)
return 'N';
if ((section->flags & SEC_HAS_CONTENTS) &&
(section->flags & SEC_READONLY))
if ((section->flags & SEC_HAS_CONTENTS) && (section->flags & SEC_READONLY))
return 'n';
return '?';
@ -638,8 +621,7 @@ SYNOPSIS
int bfd_decode_symclass (asymbol *symbol);
*/
int
bfd_decode_symclass (symbol)
asymbol *symbol;
bfd_decode_symclass (asymbol *symbol)
{
char c;
@ -711,8 +693,7 @@ SYNOPSIS
*/
bfd_boolean
bfd_is_undefined_symclass (symclass)
int symclass;
bfd_is_undefined_symclass (int symclass)
{
return symclass == 'U' || symclass == 'w' || symclass == 'v';
}
@ -731,9 +712,7 @@ SYNOPSIS
*/
void
bfd_symbol_info (symbol, ret)
asymbol *symbol;
symbol_info *ret;
bfd_symbol_info (asymbol *symbol, symbol_info *ret)
{
ret->type = bfd_decode_symclass (symbol);
@ -750,7 +729,8 @@ FUNCTION
bfd_copy_private_symbol_data
SYNOPSIS
bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
bfd_boolean bfd_copy_private_symbol_data
(bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
DESCRIPTION
Copy private symbol information from @var{isym} in the BFD
@ -762,8 +742,8 @@ DESCRIPTION
Not enough memory exists to create private data for @var{osec}.
.#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
. BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
. (ibfd, isymbol, obfd, osymbol))
. BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
. (ibfd, isymbol, obfd, osymbol))
.
*/
@ -772,11 +752,10 @@ DESCRIPTION
version. It just uses BFD asymbol structures as mini symbols. */
long
_bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep)
bfd *abfd;
bfd_boolean dynamic;
PTR *minisymsp;
unsigned int *sizep;
_bfd_generic_read_minisymbols (bfd *abfd,
bfd_boolean dynamic,
void **minisymsp,
unsigned int *sizep)
{
long storage;
asymbol **syms = NULL;
@ -791,7 +770,7 @@ _bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep)
if (storage == 0)
return 0;
syms = (asymbol **) bfd_malloc ((bfd_size_type) storage);
syms = bfd_malloc (storage);
if (syms == NULL)
goto error_return;
@ -802,7 +781,7 @@ _bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep)
if (symcount < 0)
goto error_return;
*minisymsp = (PTR) syms;
*minisymsp = syms;
*sizep = sizeof (asymbol *);
return symcount;
@ -818,11 +797,10 @@ _bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep)
we just return the asymbol the minisymbol points to. */
asymbol *
_bfd_generic_minisymbol_to_symbol (abfd, dynamic, minisym, sym)
bfd *abfd ATTRIBUTE_UNUSED;
bfd_boolean dynamic ATTRIBUTE_UNUSED;
const PTR minisym;
asymbol *sym ATTRIBUTE_UNUSED;
_bfd_generic_minisymbol_to_symbol (bfd *abfd ATTRIBUTE_UNUSED,
bfd_boolean dynamic ATTRIBUTE_UNUSED,
const void *minisym,
asymbol *sym ATTRIBUTE_UNUSED)
{
return *(asymbol **) minisym;
}
@ -857,12 +835,10 @@ struct indexentry
/* Compare two indexentry structures. This is called via qsort. */
static int
cmpindexentry (a, b)
const PTR a;
const PTR b;
cmpindexentry (const void *a, const void *b)
{
const struct indexentry *contestantA = (const struct indexentry *) a;
const struct indexentry *contestantB = (const struct indexentry *) b;
const struct indexentry *contestantA = a;
const struct indexentry *contestantB = b;
if (contestantA->val < contestantB->val)
return -1;
@ -903,17 +879,15 @@ struct stab_find_info
};
bfd_boolean
_bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
pfilename, pfnname, pline, pinfo)
bfd *abfd;
asymbol **symbols;
asection *section;
bfd_vma offset;
bfd_boolean *pfound;
const char **pfilename;
const char **pfnname;
unsigned int *pline;
PTR *pinfo;
_bfd_stab_section_find_nearest_line (bfd *abfd,
asymbol **symbols,
asection *section,
bfd_vma offset,
bfd_boolean *pfound,
const char **pfilename,
const char **pfnname,
unsigned int *pline,
void **pinfo)
{
struct stab_find_info *info;
bfd_size_type stabsize, strsize;
@ -951,7 +925,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
#define VALOFF (8)
#define STABSIZE (12)
info = (struct stab_find_info *) *pinfo;
info = *pinfo;
if (info != NULL)
{
if (info->stabsec == NULL || info->strsec == NULL)
@ -972,7 +946,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
char *function_name;
bfd_size_type amt = sizeof *info;
info = (struct stab_find_info *) bfd_zalloc (abfd, amt);
info = bfd_zalloc (abfd, amt);
if (info == NULL)
return FALSE;
@ -987,15 +961,15 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
{
/* No stabs debugging information. Set *pinfo so that we
can return quickly in the info != NULL case above. */
*pinfo = (PTR) info;
*pinfo = info;
return TRUE;
}
stabsize = info->stabsec->_raw_size;
strsize = info->strsec->_raw_size;
info->stabs = (bfd_byte *) bfd_alloc (abfd, stabsize);
info->strs = (bfd_byte *) bfd_alloc (abfd, strsize);
info->stabs = bfd_alloc (abfd, stabsize);
info->strs = bfd_alloc (abfd, strsize);
if (info->stabs == NULL || info->strs == NULL)
return FALSE;
@ -1012,7 +986,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
reloc_size = bfd_get_reloc_upper_bound (abfd, info->stabsec);
if (reloc_size < 0)
return FALSE;
reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size);
reloc_vector = bfd_malloc (reloc_size);
if (reloc_vector == NULL && reloc_size != 0)
return FALSE;
reloc_count = bfd_canonicalize_reloc (abfd, info->stabsec, reloc_vector,
@ -1105,7 +1079,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
amt = info->indextablesize;
amt *= sizeof (struct indexentry);
info->indextable = (struct indexentry *) bfd_alloc (abfd, amt);
info->indextable = bfd_alloc (abfd, amt);
if (info->indextable == NULL)
return FALSE;
@ -1226,7 +1200,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
qsort (info->indextable, (size_t) i, sizeof (struct indexentry),
cmpindexentry);
*pinfo = (PTR) info;
*pinfo = info;
}
/* We are passed a section relative offset. The offsets in the
@ -1360,7 +1334,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound,
if (info->filename != NULL)
free (info->filename);
len = strlen (file_name) + 1;
info->filename = (char *) bfd_malloc ((bfd_size_type) dirlen + len);
info->filename = bfd_malloc (dirlen + len);
if (info->filename == NULL)
return FALSE;
memcpy (info->filename, directory_name, dirlen);

View File

@ -103,7 +103,7 @@ DESCRIPTION
someone wants to fix this and not break the above, please do.
.#define BFD_SEND(bfd, message, arglist) \
. ((*((bfd)->xvec->message)) arglist)
. ((*((bfd)->xvec->message)) arglist)
.
.#ifdef DEBUG_BFD_SEND
.#undef BFD_SEND
@ -116,7 +116,7 @@ DESCRIPTION
For operations which index on the BFD format:
.#define BFD_SEND_FMT(bfd, message, arglist) \
. (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
. (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
.
.#ifdef DEBUG_BFD_SEND
.#undef BFD_SEND_FMT
@ -203,264 +203,266 @@ DESCRIPTION
. {* Entries for byte swapping for data. These are different from the
. other entry points, since they don't take a BFD asthe first argument.
. Certain other handlers could do the same. *}
. bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *));
. bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *));
. void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *));
. bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *));
. bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *));
. void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *));
. bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *));
. bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *));
. void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *));
. bfd_vma (*bfd_getx64) (const bfd_byte *);
. bfd_signed_vma (*bfd_getx_signed_64) (const bfd_byte *);
. void (*bfd_putx64) (bfd_vma, bfd_byte *);
. bfd_vma (*bfd_getx32) (const bfd_byte *);
. bfd_signed_vma (*bfd_getx_signed_32) (const bfd_byte *);
. void (*bfd_putx32) (bfd_vma, bfd_byte *);
. bfd_vma (*bfd_getx16) (const bfd_byte *);
. bfd_signed_vma (*bfd_getx_signed_16) (const bfd_byte *);
. void (*bfd_putx16) (bfd_vma, bfd_byte *);
.
. {* Byte swapping for the headers. *}
. bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *));
. bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *));
. void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *));
. bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *));
. bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *));
. void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *));
. bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *));
. bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *));
. void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *));
. bfd_vma (*bfd_h_getx64) (const bfd_byte *);
. bfd_signed_vma (*bfd_h_getx_signed_64) (const bfd_byte *);
. void (*bfd_h_putx64) (bfd_vma, bfd_byte *);
. bfd_vma (*bfd_h_getx32) (const bfd_byte *);
. bfd_signed_vma (*bfd_h_getx_signed_32) (const bfd_byte *);
. void (*bfd_h_putx32) (bfd_vma, bfd_byte *);
. bfd_vma (*bfd_h_getx16) (const bfd_byte *);
. bfd_signed_vma (*bfd_h_getx_signed_16) (const bfd_byte *);
. void (*bfd_h_putx16) (bfd_vma, bfd_byte *);
.
. {* Format dependent routines: these are vectors of entry points
. within the target vector structure, one for each format to check. *}
.
. {* Check the format of a file being read. Return a <<bfd_target *>> or zero. *}
. const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *));
. const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *);
.
. {* Set the format of a file being written. *}
. bfd_boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *));
. bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
.
. {* Write cached information into a file being written, at <<bfd_close>>. *}
. bfd_boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *));
. bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
.
The general target vector. These vectors are initialized using the
BFD_JUMP_TABLE macros.
.
. {* Generic entry points. *}
Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens.
.#define BFD_JUMP_TABLE_GENERIC(NAME) \
.CONCAT2 (NAME,_close_and_cleanup), \
.CONCAT2 (NAME,_bfd_free_cached_info), \
.CONCAT2 (NAME,_new_section_hook), \
.CONCAT2 (NAME,_get_section_contents), \
.CONCAT2 (NAME,_get_section_contents_in_window)
. NAME##_close_and_cleanup, \
. NAME##_bfd_free_cached_info, \
. NAME##_new_section_hook, \
. NAME##_get_section_contents, \
. NAME##_get_section_contents_in_window
.
. {* Called when the BFD is being closed to do any necessary cleanup. *}
. bfd_boolean (*_close_and_cleanup) PARAMS ((bfd *));
. bfd_boolean (*_close_and_cleanup) (bfd *);
. {* Ask the BFD to free all cached information. *}
. bfd_boolean (*_bfd_free_cached_info) PARAMS ((bfd *));
. bfd_boolean (*_bfd_free_cached_info) (bfd *);
. {* Called when a new section is created. *}
. bfd_boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr));
. bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
. {* Read the contents of a section. *}
. bfd_boolean (*_bfd_get_section_contents)
. PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
. (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
. bfd_boolean (*_bfd_get_section_contents_in_window)
. PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type));
. (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type);
.
. {* Entry points to copy private data. *}
.#define BFD_JUMP_TABLE_COPY(NAME) \
.CONCAT2 (NAME,_bfd_copy_private_bfd_data), \
.CONCAT2 (NAME,_bfd_merge_private_bfd_data), \
.CONCAT2 (NAME,_bfd_copy_private_section_data), \
.CONCAT2 (NAME,_bfd_copy_private_symbol_data), \
.CONCAT2 (NAME,_bfd_set_private_flags), \
.CONCAT2 (NAME,_bfd_print_private_bfd_data) \
. NAME##_bfd_copy_private_bfd_data, \
. NAME##_bfd_merge_private_bfd_data, \
. NAME##_bfd_copy_private_section_data, \
. NAME##_bfd_copy_private_symbol_data, \
. NAME##_bfd_set_private_flags, \
. NAME##_bfd_print_private_bfd_data
.
. {* Called to copy BFD general private data from one object file
. to another. *}
. bfd_boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *));
. bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
. {* Called to merge BFD general private data from one object file
. to a common output file when linking. *}
. bfd_boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *));
. bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *);
. {* Called to copy BFD private section data from one object file
. to another. *}
. bfd_boolean (*_bfd_copy_private_section_data)
. PARAMS ((bfd *, sec_ptr, bfd *, sec_ptr));
. (bfd *, sec_ptr, bfd *, sec_ptr);
. {* Called to copy BFD private symbol data from one symbol
. to another. *}
. bfd_boolean (*_bfd_copy_private_symbol_data)
. PARAMS ((bfd *, asymbol *, bfd *, asymbol *));
. (bfd *, asymbol *, bfd *, asymbol *);
. {* Called to set private backend flags. *}
. bfd_boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword));
. bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
.
. {* Called to print private BFD data. *}
. bfd_boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR));
. bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
.
. {* Core file entry points. *}
.#define BFD_JUMP_TABLE_CORE(NAME) \
.CONCAT2 (NAME,_core_file_failing_command), \
.CONCAT2 (NAME,_core_file_failing_signal), \
.CONCAT2 (NAME,_core_file_matches_executable_p)
. char * (*_core_file_failing_command) PARAMS ((bfd *));
. int (*_core_file_failing_signal) PARAMS ((bfd *));
. bfd_boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *));
. NAME##_core_file_failing_command, \
. NAME##_core_file_failing_signal, \
. NAME##_core_file_matches_executable_p
.
. char * (*_core_file_failing_command) (bfd *);
. int (*_core_file_failing_signal) (bfd *);
. bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
.
. {* Archive entry points. *}
.#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
.CONCAT2 (NAME,_slurp_armap), \
.CONCAT2 (NAME,_slurp_extended_name_table), \
.CONCAT2 (NAME,_construct_extended_name_table), \
.CONCAT2 (NAME,_truncate_arname), \
.CONCAT2 (NAME,_write_armap), \
.CONCAT2 (NAME,_read_ar_hdr), \
.CONCAT2 (NAME,_openr_next_archived_file), \
.CONCAT2 (NAME,_get_elt_at_index), \
.CONCAT2 (NAME,_generic_stat_arch_elt), \
.CONCAT2 (NAME,_update_armap_timestamp)
. bfd_boolean (*_bfd_slurp_armap) PARAMS ((bfd *));
. bfd_boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *));
. NAME##_slurp_armap, \
. NAME##_slurp_extended_name_table, \
. NAME##_construct_extended_name_table, \
. NAME##_truncate_arname, \
. NAME##_write_armap, \
. NAME##_read_ar_hdr, \
. NAME##_openr_next_archived_file, \
. NAME##_get_elt_at_index, \
. NAME##_generic_stat_arch_elt, \
. NAME##_update_armap_timestamp
.
. bfd_boolean (*_bfd_slurp_armap) (bfd *);
. bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
. bfd_boolean (*_bfd_construct_extended_name_table)
. PARAMS ((bfd *, char **, bfd_size_type *, const char **));
. void (*_bfd_truncate_arname) PARAMS ((bfd *, const char *, char *));
. (bfd *, char **, bfd_size_type *, const char **);
. void (*_bfd_truncate_arname) (bfd *, const char *, char *);
. bfd_boolean (*write_armap)
. PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int));
. PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *));
. bfd * (*openr_next_archived_file) PARAMS ((bfd *, bfd *));
.#define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i))
. bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex));
. int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *));
. bfd_boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *));
. (bfd *, unsigned int, struct orl *, unsigned int, int);
. void * (*_bfd_read_ar_hdr_fn) (bfd *);
. bfd * (*openr_next_archived_file) (bfd *, bfd *);
.#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
. bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
. int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
. bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
.
. {* Entry points used for symbols. *}
.#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
.CONCAT2 (NAME,_get_symtab_upper_bound), \
.CONCAT2 (NAME,_get_symtab), \
.CONCAT2 (NAME,_make_empty_symbol), \
.CONCAT2 (NAME,_print_symbol), \
.CONCAT2 (NAME,_get_symbol_info), \
.CONCAT2 (NAME,_bfd_is_local_label_name), \
.CONCAT2 (NAME,_get_lineno), \
.CONCAT2 (NAME,_find_nearest_line), \
.CONCAT2 (NAME,_bfd_make_debug_symbol), \
.CONCAT2 (NAME,_read_minisymbols), \
.CONCAT2 (NAME,_minisymbol_to_symbol)
. long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *));
. long (*_bfd_canonicalize_symtab) PARAMS ((bfd *,
. struct symbol_cache_entry **));
. struct symbol_cache_entry *
. (*_bfd_make_empty_symbol) PARAMS ((bfd *));
. void (*_bfd_print_symbol)
. PARAMS ((bfd *, PTR, struct symbol_cache_entry *, bfd_print_symbol_type));
.#define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e))
. void (*_bfd_get_symbol_info)
. PARAMS ((bfd *, struct symbol_cache_entry *, symbol_info *));
.#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e))
. bfd_boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *));
. NAME##_get_symtab_upper_bound, \
. NAME##_get_symtab, \
. NAME##_make_empty_symbol, \
. NAME##_print_symbol, \
. NAME##_get_symbol_info, \
. NAME##_bfd_is_local_label_name, \
. NAME##_get_lineno, \
. NAME##_find_nearest_line, \
. NAME##_bfd_make_debug_symbol, \
. NAME##_read_minisymbols, \
. NAME##_minisymbol_to_symbol
.
. alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *));
. long (*_bfd_get_symtab_upper_bound) (bfd *);
. long (*_bfd_canonicalize_symtab)
. (bfd *, struct symbol_cache_entry **);
. struct symbol_cache_entry *
. (*_bfd_make_empty_symbol) (bfd *);
. void (*_bfd_print_symbol)
. (bfd *, void *, struct symbol_cache_entry *, bfd_print_symbol_type);
.#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
. void (*_bfd_get_symbol_info)
. (bfd *, struct symbol_cache_entry *, symbol_info *);
.#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
. bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
.
. alent * (*_get_lineno) (bfd *, struct symbol_cache_entry *);
. bfd_boolean (*_bfd_find_nearest_line)
. PARAMS ((bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma,
. const char **, const char **, unsigned int *));
. (bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma,
. const char **, const char **, unsigned int *);
. {* Back-door to allow format-aware applications to create debug symbols
. while using BFD for everything else. Currently used by the assembler
. when creating COFF files. *}
. asymbol * (*_bfd_make_debug_symbol)
. PARAMS ((bfd *, void *, unsigned long size));
. (bfd *, void *, unsigned long size);
.#define bfd_read_minisymbols(b, d, m, s) \
. BFD_SEND (b, _read_minisymbols, (b, d, m, s))
. long (*_read_minisymbols)
. PARAMS ((bfd *, bfd_boolean, PTR *, unsigned int *));
. (bfd *, bfd_boolean, void **, unsigned int *);
.#define bfd_minisymbol_to_symbol(b, d, m, f) \
. BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
. asymbol * (*_minisymbol_to_symbol)
. PARAMS ((bfd *, bfd_boolean, const PTR, asymbol *));
. (bfd *, bfd_boolean, const void *, asymbol *);
.
. {* Routines for relocs. *}
.#define BFD_JUMP_TABLE_RELOCS(NAME) \
.CONCAT2 (NAME,_get_reloc_upper_bound), \
.CONCAT2 (NAME,_canonicalize_reloc), \
.CONCAT2 (NAME,_bfd_reloc_type_lookup)
. long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr));
. NAME##_get_reloc_upper_bound, \
. NAME##_canonicalize_reloc, \
. NAME##_bfd_reloc_type_lookup
.
. long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
. long (*_bfd_canonicalize_reloc)
. PARAMS ((bfd *, sec_ptr, arelent **, struct symbol_cache_entry **));
. (bfd *, sec_ptr, arelent **, struct symbol_cache_entry **);
. {* See documentation on reloc types. *}
. reloc_howto_type *
. (*reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type));
. (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
.
. {* Routines used when writing an object file. *}
.#define BFD_JUMP_TABLE_WRITE(NAME) \
.CONCAT2 (NAME,_set_arch_mach), \
.CONCAT2 (NAME,_set_section_contents)
. NAME##_set_arch_mach, \
. NAME##_set_section_contents
.
. bfd_boolean (*_bfd_set_arch_mach)
. PARAMS ((bfd *, enum bfd_architecture, unsigned long));
. (bfd *, enum bfd_architecture, unsigned long);
. bfd_boolean (*_bfd_set_section_contents)
. PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
. (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
.
. {* Routines used by the linker. *}
.#define BFD_JUMP_TABLE_LINK(NAME) \
.CONCAT2 (NAME,_sizeof_headers), \
.CONCAT2 (NAME,_bfd_get_relocated_section_contents), \
.CONCAT2 (NAME,_bfd_relax_section), \
.CONCAT2 (NAME,_bfd_link_hash_table_create), \
.CONCAT2 (NAME,_bfd_link_hash_table_free), \
.CONCAT2 (NAME,_bfd_link_add_symbols), \
.CONCAT2 (NAME,_bfd_link_just_syms), \
.CONCAT2 (NAME,_bfd_final_link), \
.CONCAT2 (NAME,_bfd_link_split_section), \
.CONCAT2 (NAME,_bfd_gc_sections), \
.CONCAT2 (NAME,_bfd_merge_sections), \
.CONCAT2 (NAME,_bfd_discard_group)
. int (*_bfd_sizeof_headers) PARAMS ((bfd *, bfd_boolean));
. NAME##_sizeof_headers, \
. NAME##_bfd_get_relocated_section_contents, \
. NAME##_bfd_relax_section, \
. NAME##_bfd_link_hash_table_create, \
. NAME##_bfd_link_hash_table_free, \
. NAME##_bfd_link_add_symbols, \
. NAME##_bfd_link_just_syms, \
. NAME##_bfd_final_link, \
. NAME##_bfd_link_split_section, \
. NAME##_bfd_gc_sections, \
. NAME##_bfd_merge_sections, \
. NAME##_bfd_discard_group
.
. int (*_bfd_sizeof_headers) (bfd *, bfd_boolean);
. bfd_byte * (*_bfd_get_relocated_section_contents)
. PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
. bfd_byte *, bfd_boolean, struct symbol_cache_entry **));
. (bfd *, struct bfd_link_info *, struct bfd_link_order *,
. bfd_byte *, bfd_boolean, struct symbol_cache_entry **);
.
. bfd_boolean (*_bfd_relax_section)
. PARAMS ((bfd *, struct sec *, struct bfd_link_info *, bfd_boolean *));
. (bfd *, struct sec *, struct bfd_link_info *, bfd_boolean *);
.
. {* Create a hash table for the linker. Different backends store
. different information in this table. *}
. struct bfd_link_hash_table *
. (*_bfd_link_hash_table_create) PARAMS ((bfd *));
. (*_bfd_link_hash_table_create) (bfd *);
.
. {* Release the memory associated with the linker hash table. *}
. void (*_bfd_link_hash_table_free)
. PARAMS ((struct bfd_link_hash_table *));
. void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);
.
. {* Add symbols from this object file into the hash table. *}
. bfd_boolean (*_bfd_link_add_symbols)
. PARAMS ((bfd *, struct bfd_link_info *));
. bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
.
. {* Indicate that we are only retrieving symbol values from this section. *}
. void (*_bfd_link_just_syms)
. PARAMS ((asection *, struct bfd_link_info *));
. void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
.
. {* Do a link based on the link_order structures attached to each
. section of the BFD. *}
. bfd_boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *));
. bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
.
. {* Should this section be split up into smaller pieces during linking. *}
. bfd_boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *));
. bfd_boolean (*_bfd_link_split_section) (bfd *, struct sec *);
.
. {* Remove sections that are not referenced from the output. *}
. bfd_boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *));
. bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
.
. {* Attempt to merge SEC_MERGE sections. *}
. bfd_boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *));
. bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
.
. {* Discard members of a group. *}
. bfd_boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *));
. bfd_boolean (*_bfd_discard_group) (bfd *, struct sec *);
.
. {* Routines to handle dynamic symbols and relocs. *}
.#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
.CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \
.CONCAT2 (NAME,_canonicalize_dynamic_symtab), \
.CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \
.CONCAT2 (NAME,_canonicalize_dynamic_reloc)
. NAME##_get_dynamic_symtab_upper_bound, \
. NAME##_canonicalize_dynamic_symtab, \
. NAME##_get_dynamic_reloc_upper_bound, \
. NAME##_canonicalize_dynamic_reloc
.
. {* Get the amount of memory required to hold the dynamic symbols. *}
. long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *));
. long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
. {* Read in the dynamic symbols. *}
. long (*_bfd_canonicalize_dynamic_symtab)
. PARAMS ((bfd *, struct symbol_cache_entry **));
. (bfd *, struct symbol_cache_entry **);
. {* Get the amount of memory required to hold the dynamic relocs. *}
. long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *));
. long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
. {* Read in the dynamic relocs. *}
. long (*_bfd_canonicalize_dynamic_reloc)
. PARAMS ((bfd *, arelent **, struct symbol_cache_entry **));
. (bfd *, arelent **, struct symbol_cache_entry **);
.
A pointer to an alternative bfd_target in case the current one is not
@ -475,7 +477,7 @@ to find an alternative output format that is suitable.
. {* Data for use by back-end routines, which isn't
. generic enough to belong in this structure. *}
. PTR backend_data;
. void *backend_data;
.
.} bfd_target;
.
@ -1156,13 +1158,10 @@ static const struct targmatch bfd_target_match[] = {
{ NULL, NULL }
};
static const bfd_target *find_target PARAMS ((const char *));
/* Find a target vector, given a name or configuration triplet. */
static const bfd_target *
find_target (name)
const char *name;
find_target (const char *name)
{
const bfd_target * const *target;
const struct targmatch *match;
@ -1203,8 +1202,7 @@ DESCRIPTION
*/
bfd_boolean
bfd_set_default_target (name)
const char *name;
bfd_set_default_target (const char *name)
{
const bfd_target *target;
@ -1240,9 +1238,7 @@ DESCRIPTION
*/
const bfd_target *
bfd_find_target (target_name, abfd)
const char *target_name;
bfd *abfd;
bfd_find_target (const char *target_name, bfd *abfd)
{
const char *targname;
const bfd_target *target;
@ -1288,9 +1284,9 @@ DESCRIPTION
*/
const char **
bfd_target_list ()
bfd_target_list (void)
{
int vec_length= 0;
int vec_length = 0;
bfd_size_type amt;
#if defined (HOST_HPPAHPUX) && ! defined (__STDC__)
/* The native compiler on the HP9000/700 has a bug which causes it
@ -1304,7 +1300,7 @@ bfd_target_list ()
vec_length++;
amt = (vec_length + 1) * sizeof (char **);
name_ptr = name_list = (const char **) bfd_malloc (amt);
name_ptr = name_list = bfd_malloc (amt);
if (name_list == NULL)
return NULL;
@ -1323,9 +1319,9 @@ FUNCTION
bfd_seach_for_target
SYNOPSIS
const bfd_target * bfd_search_for_target (int (* search_func)
(const bfd_target *, void *),
void *);
const bfd_target *bfd_search_for_target
(int (*search_func) (const bfd_target *, void *),
void *);
DESCRIPTION
Return a pointer to the first transfer vector in the list of
@ -1336,15 +1332,14 @@ DESCRIPTION
*/
const bfd_target *
bfd_search_for_target (search_func, data)
int (* search_func) PARAMS ((const bfd_target * target, void * data));
void * data;
bfd_search_for_target (int (*search_func) (const bfd_target *, void *),
void *data)
{
const bfd_target * const * target;
const bfd_target * const *target;
for (target = bfd_target_vector; * target != NULL; target ++)
if (search_func (* target, data))
return * target;
for (target = bfd_target_vector; *target != NULL; target ++)
if (search_func (*target, data))
return *target;
return NULL;
}