* Most files:

Replace DEFUN and DEFUN_VOID with K&R-style function definition.
	Indent some of them to GNU standards.

	* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
	cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
	elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
	libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
	Update copyright years.
This commit is contained in:
David MacKenzie 1994-03-15 15:13:13 +00:00
parent baef2065d0
commit 57a1867e6c
18 changed files with 1840 additions and 1699 deletions

View File

@ -1,3 +1,15 @@
Tue Mar 15 04:41:13 1994 David J. Mackenzie (djm@rtl.cygnus.com)
* Most files:
Replace DEFUN and DEFUN_VOID with K&R-style function definition.
Indent some of them to GNU standards.
* aout32.c, archures.c, core.c, cpu-h8300.c, cpu-i960.c,
cpu-m68k.c, cpu-m88k.c, cpu-mips.c, cpu-vax.c, ctor.c, demo64.c,
elf32-hppa.h, gen-aout.c, host-aout.c, init.c, libhppa.h,
libieee.h, liboasys.h, newsos3.c, som.h, stab-syms.c, sunos.c:
Update copyright years.
Mon Mar 14 11:41:23 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
* som.c (som_prep_for_fixups): A relocation involving the section

View File

@ -76,8 +76,8 @@ struct trad_core_struct {
};
static bfd_target *
DEFUN(aix386_core_file_p,(abfd),
bfd *abfd)
aix386_core_file_p (abfd)
bfd *abfd;
{
int i,n;
unsigned char longbuf[4]; /* Raw bytes of various header fields */
@ -88,7 +88,7 @@ DEFUN(aix386_core_file_p,(abfd),
struct corehdr internal_core;
} *mergem;
bfd_error = system_call_error;
bfd_set_error (bfd_error_system_call);
if (bfd_read ((PTR)longbuf, 1, sizeof (longbuf), abfd) != sizeof (longbuf))
return 0;
@ -100,7 +100,7 @@ DEFUN(aix386_core_file_p,(abfd),
mergem = (struct mergem *)bfd_zalloc (abfd, sizeof (struct mergem));
if (mergem == NULL)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return 0;
}
@ -108,7 +108,7 @@ DEFUN(aix386_core_file_p,(abfd),
if ((bfd_read ((PTR) core, 1, core_size, abfd)) != core_size)
{
bfd_error = system_call_error;
bfd_set_error (bfd_error_system_call);
bfd_release (abfd, (char *)mergem);
return 0;
}
@ -122,7 +122,7 @@ DEFUN(aix386_core_file_p,(abfd),
if (core_regsec (abfd) == NULL)
{
loser:
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
bfd_release (abfd, (char *)mergem);
return 0;
}
@ -219,23 +219,23 @@ DEFUN(aix386_core_file_p,(abfd),
}
static char *
DEFUN(aix386_core_file_failing_command,(abfd),
bfd *abfd)
aix386_core_file_failing_command (abfd)
bfd *abfd;
{
return core_hdr (abfd)->cd_comm;
}
static int
DEFUN(aix386_core_file_failing_signal,(abfd),
bfd *abfd)
aix386_core_file_failing_signal (abfd)
bfd *abfd;
{
return core_hdr (abfd)->cd_cursig;
}
static boolean
DEFUN(aix386_core_file_matches_executable_p, (core_bfd, exec_bfd),
bfd *core_bfd AND
bfd *exec_bfd)
aix386_core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd;
bfd *exec_bfd;
{
return true; /* FIXME, We have no way of telling at this
point */
@ -254,7 +254,7 @@ DEFUN(aix386_core_file_matches_executable_p, (core_bfd, exec_bfd),
#define aix386_close_and_cleanup bfd_generic_close_and_cleanup
#define aix386_set_section_contents (PROTO(boolean, (*), \
(bfd *abfd, asection *section, PTR data, file_ptr offset, \
bfd_size_type count))) bfd_false
bfd_size_type count))) bfd_generic_set_section_contents
#define aix386_get_section_contents bfd_generic_get_section_contents
#define aix386_new_section_hook (PROTO (boolean, (*), \
(bfd *, sec_ptr))) bfd_true
@ -307,9 +307,9 @@ swap_abort()
{
abort(); /* This way doesn't require any declaration for ANSI to fuck up */
}
#define NO_GET ((PROTO(bfd_vma, (*), ( bfd_byte *))) swap_abort )
#define NO_GETS ((PROTO(bfd_signed_vma, (*), ( bfd_byte *))) swap_abort )
#define NO_PUT ((PROTO(void, (*), (bfd_vma, bfd_byte *))) swap_abort )
#define NO_GET ((PROTO(bfd_vma, (*), ( const bfd_byte *))) swap_abort )
#define NO_GETS ((PROTO(bfd_signed_vma, (*), (const bfd_byte *))) swap_abort )
#define NO_PUT ((PROTO(void, (*), (bfd_vma, bfd_byte *))) swap_abort )
bfd_target aix386_core_vec =
{

View File

@ -1,5 +1,5 @@
/* BFD back-end for a.out files encapsulated with COFF headers.
Copyright (C) 1990-1991 Free Software Foundation, Inc.
Copyright (C) 1990, 1991 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@ -38,8 +38,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
bfd_target *encap_real_callback ();
bfd_target *
DEFUN(encap_object_p,(abfd),
bfd *abfd)
encap_object_p (abfd)
bfd *abfd;
{
unsigned char magicbuf[4]; /* Raw bytes of magic number from file */
unsigned long magic; /* Swapped magic number */
@ -77,8 +77,8 @@ DEFUN(encap_object_p,(abfd),
/* Finish up the reading of a encapsulated-coff a.out file header */
bfd_target *
DEFUN(encap_real_callback,(abfd),
bfd *abfd)
encap_real_callback (abfd)
bfd *abfd;
{
struct internal_exec *execp = exec_hdr (abfd);
@ -118,8 +118,8 @@ DEFUN(encap_real_callback,(abfd),
file header, symbols, and relocation. */
boolean
DEFUN(encap_write_object_contents,(abfd),
bfd *abfd)
encap_write_object_contents (abfd)
bfd *abfd;
{
bfd_size_type data_pad = 0;
struct external_exec exec_bytes;

View File

@ -28,8 +28,8 @@ extern CONST struct reloc_howto_struct * NAME(aout,reloc_type_lookup) ();
This routine is called from some_aout_object_p just before it returns. */
#ifndef MY_callback
static bfd_target *
DEFUN(MY(callback),(abfd),
bfd *abfd)
MY(callback) (abfd)
bfd *abfd;
{
struct internal_exec *execp = exec_hdr (abfd);
@ -80,8 +80,8 @@ DEFUN(MY(callback),(abfd),
/* Finish up the reading of an a.out file header */
static bfd_target *
DEFUN(MY(object_p),(abfd),
bfd *abfd)
MY(object_p) (abfd)
bfd *abfd;
{
struct external_exec exec_bytes; /* Raw exec header from file */
struct internal_exec exec; /* Cleaned-up exec header */
@ -89,7 +89,7 @@ DEFUN(MY(object_p),(abfd),
if (bfd_read ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd)
!= EXEC_BYTES_SIZE) {
bfd_error = wrong_format;
bfd_set_error (bfd_error_wrong_format);
return 0;
}
@ -134,8 +134,8 @@ DEFUN(MY(object_p),(abfd),
#ifndef MY_mkobject
static boolean
DEFUN(MY(mkobject),(abfd),
bfd *abfd)
MY(mkobject) (abfd)
bfd *abfd;
{
if (NAME(aout,mkobject)(abfd) == false)
return false;
@ -160,8 +160,8 @@ DEFUN(MY(mkobject),(abfd),
#ifndef MY_write_object_contents
static boolean
DEFUN(MY(write_object_contents),(abfd),
bfd *abfd)
MY(write_object_contents) (abfd)
bfd *abfd;
{
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
@ -181,7 +181,8 @@ DEFUN(MY(write_object_contents),(abfd),
#ifndef MY_set_sizes
static boolean
DEFUN(MY(set_sizes),(abfd), bfd *abfd)
MY(set_sizes) (abfd)
bfd *abfd;
{
adata(abfd).page_size = PAGE_SIZE;
#ifdef SEGMENT_SIZE
@ -196,12 +197,22 @@ DEFUN(MY(set_sizes),(abfd), bfd *abfd)
#endif
#ifndef MY_backend_data
#ifndef MY_read_dynamic_symbols
#define MY_read_dynamic_symbols 0
#endif
#ifndef MY_read_dynamic_relocs
#define MY_read_dynamic_relocs 0
#endif
static CONST struct aout_backend_data MY(backend_data) = {
0, /* zmagic contiguous */
0, /* text incl header */
0, /* text vma? */
MY_set_sizes,
0, /* exec header is counted */
MY_read_dynamic_symbols,
MY_read_dynamic_relocs
};
#define MY_backend_data &MY(backend_data)
#endif
@ -400,7 +411,7 @@ bfd_target MY(vec) =
#endif
(HAS_RELOC | EXEC_P | /* object flags */
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
MY_symbol_leading_char,
AR_PAD_CHAR, /* ar_pad_char */

View File

@ -23,7 +23,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "libbfd.h"
#include "aout/sun4.h"
#include "libaout.h" /* BFD a.out internal data structures */
#include "libaout.h" /* BFD a.out internal data structures */
#include "aout/aout64.h"
#include "aout/stab_gnu.h"
@ -49,7 +49,7 @@ int in the target format. It changes the sizes of the structs which
perform the memory/disk mapping of structures.
The 64 bit backend may only be used if the host compiler supports 64
ints (eg long long with gcc), by defining the name @code{HOST_64_BIT} in @code{bfd.h}.
ints (eg long long with gcc), by defining the name @code{BFD_HOST_64_BIT} in @code{bfd.h}.
With this name defined, @emph{all} bfd operations are performed with 64bit
arithmetic, not just those to a 64bit target.
@ -64,60 +64,62 @@ The name put into the target vector.
/*SUPPRESS529*/
void
DEFUN(NAME(sunos,set_arch_mach), (abfd, machtype),
bfd *abfd AND int machtype)
NAME (sunos, set_arch_mach) (abfd, machtype)
bfd *abfd;
int machtype;
{
/* Determine the architecture and machine type of the object file. */
enum bfd_architecture arch;
long machine;
switch (machtype) {
switch (machtype)
{
case M_UNKNOWN:
case M_UNKNOWN:
/* Some Sun3s make magic numbers without cpu types in them, so
we'll default to the 68000. */
arch = bfd_arch_m68k;
machine = 68000;
break;
arch = bfd_arch_m68k;
machine = 68000;
break;
case M_68010:
case M_HP200:
arch = bfd_arch_m68k;
machine = 68010;
break;
case M_68010:
case M_HP200:
arch = bfd_arch_m68k;
machine = 68010;
break;
case M_68020:
case M_HP300:
arch = bfd_arch_m68k;
machine = 68020;
break;
case M_68020:
case M_HP300:
arch = bfd_arch_m68k;
machine = 68020;
break;
case M_SPARC:
arch = bfd_arch_sparc;
machine = 0;
break;
case M_SPARC:
arch = bfd_arch_sparc;
machine = 0;
break;
case M_386:
case M_386_DYNIX:
arch = bfd_arch_i386;
machine = 0;
break;
case M_386:
case M_386_DYNIX:
arch = bfd_arch_i386;
machine = 0;
break;
case M_29K:
arch = bfd_arch_a29k;
machine = 0;
break;
case M_29K:
arch = bfd_arch_a29k;
machine = 0;
break;
case M_HPUX:
arch = bfd_arch_m68k;
machine = 0;
break;
case M_HPUX:
arch = bfd_arch_m68k;
machine = 0;
break;
default:
arch = bfd_arch_obscure;
machine = 0;
break;
}
bfd_set_arch_mach(abfd, arch, machine);
default:
arch = bfd_arch_obscure;
machine = 0;
break;
}
bfd_set_arch_mach (abfd, arch, machine);
}
#define SET_ARCH_MACH(ABFD, EXEC) \
@ -126,18 +128,19 @@ DEFUN(NAME(sunos,set_arch_mach), (abfd, machtype),
/* Determine the size of a relocation entry, based on the architecture */
static void
DEFUN(choose_reloc_size,(abfd),
bfd *abfd)
choose_reloc_size (abfd)
bfd *abfd;
{
switch (bfd_get_arch(abfd)) {
case bfd_arch_sparc:
case bfd_arch_a29k:
obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;
break;
default:
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
break;
}
switch (bfd_get_arch (abfd))
{
case bfd_arch_sparc:
case bfd_arch_a29k:
obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;
break;
default:
obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
break;
}
}
/* Write an object file in SunOS format.
@ -145,40 +148,41 @@ bfd *abfd)
file header, symbols, and relocation. */
static boolean
DEFUN(NAME(aout,sunos4_write_object_contents),
(abfd),
bfd *abfd)
NAME (aout, sunos4_write_object_contents) (abfd)
bfd *abfd;
{
struct external_exec exec_bytes;
struct internal_exec *execp = exec_hdr (abfd);
/* Magic number, maestro, please! */
switch (bfd_get_arch(abfd)) {
case bfd_arch_m68k:
switch (bfd_get_mach(abfd)) {
case 68010:
N_SET_MACHTYPE(*execp, M_68010);
switch (bfd_get_arch (abfd))
{
case bfd_arch_m68k:
switch (bfd_get_mach (abfd))
{
case 68010:
N_SET_MACHTYPE (*execp, M_68010);
break;
default:
case 68020:
N_SET_MACHTYPE (*execp, M_68020);
break;
}
break;
case bfd_arch_sparc:
N_SET_MACHTYPE (*execp, M_SPARC);
break;
case bfd_arch_i386:
N_SET_MACHTYPE (*execp, M_386);
break;
case bfd_arch_a29k:
N_SET_MACHTYPE (*execp, M_29K);
break;
default:
case 68020:
N_SET_MACHTYPE(*execp, M_68020);
break;
N_SET_MACHTYPE (*execp, M_UNKNOWN);
}
break;
case bfd_arch_sparc:
N_SET_MACHTYPE(*execp, M_SPARC);
break;
case bfd_arch_i386:
N_SET_MACHTYPE(*execp, M_386);
break;
case bfd_arch_a29k:
N_SET_MACHTYPE(*execp, M_29K);
break;
default:
N_SET_MACHTYPE(*execp, M_UNKNOWN);
}
choose_reloc_size(abfd);
choose_reloc_size (abfd);
#if 0
/* Some tools want this to be 0, some tools want this to be one.
@ -196,7 +200,7 @@ DEFUN(NAME(aout,sunos4_write_object_contents),
N_SET_FLAGS (*execp, 1);
#endif
N_SET_DYNAMIC(*execp, bfd_get_file_flags(abfd) & DYNAMIC);
N_SET_DYNAMIC (*execp, bfd_get_file_flags (abfd) & DYNAMIC);
/* At least for SunOS, the dynamic symbols and relocs are embedded
in the .text section, and we do not want to write them out with
@ -259,7 +263,7 @@ DEFUN(NAME(aout,sunos4_write_object_contents),
}
}
WRITE_HEADERS(abfd, execp);
WRITE_HEADERS (abfd, execp);
return true;
}
@ -278,7 +282,8 @@ DEFUN(NAME(aout,sunos4_write_object_contents),
/* But the reg structure can be gotten from the SPARC processor handbook.
This really should be in a GNU include file though so that gdb can use
the same info. */
struct regs {
struct regs
{
int r_psr;
int r_pc;
int r_npc;
@ -306,121 +311,124 @@ struct regs {
neither of whose size we know, WITH STUFF IN BETWEEN THEM! We can't
even portably access the stuff in between! */
struct external_sparc_core {
int c_magic; /* Corefile magic number */
int c_len; /* Sizeof (struct core) */
struct external_sparc_core
{
int c_magic; /* Corefile magic number */
int c_len; /* Sizeof (struct core) */
#define SPARC_CORE_LEN 432
int c_regs[19]; /* General purpose registers -- MACHDEP SIZE */
struct external_exec c_aouthdr; /* A.out header */
int c_signo; /* Killing signal, if any */
int c_tsize; /* Text size (bytes) */
int c_dsize; /* Data size (bytes) */
int c_ssize; /* Stack size (bytes) */
char c_cmdname[CORE_NAMELEN + 1]; /* Command name */
double fp_stuff[1]; /* external FPU state (size unknown by us) */
/* The type "double" is critical here, for alignment.
int c_regs[19]; /* General purpose registers -- MACHDEP SIZE */
struct external_exec c_aouthdr; /* A.out header */
int c_signo; /* Killing signal, if any */
int c_tsize; /* Text size (bytes) */
int c_dsize; /* Data size (bytes) */
int c_ssize; /* Stack size (bytes) */
char c_cmdname[CORE_NAMELEN + 1]; /* Command name */
double fp_stuff[1]; /* external FPU state (size unknown by us) */
/* The type "double" is critical here, for alignment.
SunOS declares a struct here, but the struct's alignment
is double since it contains doubles. */
int c_ucode; /* Exception no. from u_code */
/* (this member is not accessible by name since we don't
int c_ucode; /* Exception no. from u_code */
/* (this member is not accessible by name since we don't
portably know the size of fp_stuff.) */
};
};
struct external_sun3_core {
int c_magic; /* Corefile magic number */
int c_len; /* Sizeof (struct core) */
struct external_sun3_core
{
int c_magic; /* Corefile magic number */
int c_len; /* Sizeof (struct core) */
#define SUN3_CORE_LEN 826 /* As of SunOS 4.1.1 */
int c_regs[18]; /* General purpose registers -- MACHDEP SIZE */
struct external_exec c_aouthdr; /* A.out header */
int c_signo; /* Killing signal, if any */
int c_tsize; /* Text size (bytes) */
int c_dsize; /* Data size (bytes) */
int c_ssize; /* Stack size (bytes) */
char c_cmdname[CORE_NAMELEN + 1]; /* Command name */
double fp_stuff[1]; /* external FPU state (size unknown by us) */
/* The type "double" is critical here, for alignment.
int c_regs[18]; /* General purpose registers -- MACHDEP SIZE */
struct external_exec c_aouthdr; /* A.out header */
int c_signo; /* Killing signal, if any */
int c_tsize; /* Text size (bytes) */
int c_dsize; /* Data size (bytes) */
int c_ssize; /* Stack size (bytes) */
char c_cmdname[CORE_NAMELEN + 1]; /* Command name */
double fp_stuff[1]; /* external FPU state (size unknown by us) */
/* The type "double" is critical here, for alignment.
SunOS declares a struct here, but the struct's alignment
is double since it contains doubles. */
int c_ucode; /* Exception no. from u_code */
/* (this member is not accessible by name since we don't
int c_ucode; /* Exception no. from u_code */
/* (this member is not accessible by name since we don't
portably know the size of fp_stuff.) */
};
};
struct internal_sunos_core {
int c_magic; /* Corefile magic number */
int c_len; /* Sizeof (struct core) */
long c_regs_pos; /* file offset of General purpose registers */
int c_regs_size; /* size of General purpose registers */
struct internal_exec c_aouthdr; /* A.out header */
int c_signo; /* Killing signal, if any */
int c_tsize; /* Text size (bytes) */
int c_dsize; /* Data size (bytes) */
int c_ssize; /* Stack size (bytes) */
bfd_vma c_stacktop; /* Stack top (address) */
char c_cmdname[CORE_NAMELEN + 1]; /* Command name */
long fp_stuff_pos; /* file offset of external FPU state (regs) */
int fp_stuff_size; /* Size of it */
int c_ucode; /* Exception no. from u_code */
};
struct internal_sunos_core
{
int c_magic; /* Corefile magic number */
int c_len; /* Sizeof (struct core) */
long c_regs_pos; /* file offset of General purpose registers */
int c_regs_size; /* size of General purpose registers */
struct internal_exec c_aouthdr; /* A.out header */
int c_signo; /* Killing signal, if any */
int c_tsize; /* Text size (bytes) */
int c_dsize; /* Data size (bytes) */
int c_ssize; /* Stack size (bytes) */
bfd_vma c_stacktop; /* Stack top (address) */
char c_cmdname[CORE_NAMELEN + 1]; /* Command name */
long fp_stuff_pos; /* file offset of external FPU state (regs) */
int fp_stuff_size; /* Size of it */
int c_ucode; /* Exception no. from u_code */
};
/* byte-swap in the Sun-3 core structure */
static void
DEFUN(swapcore_sun3,(abfd, ext, intcore),
bfd *abfd AND
char *ext AND
struct internal_sunos_core *intcore)
swapcore_sun3 (abfd, ext, intcore)
bfd *abfd;
char *ext;
struct internal_sunos_core *intcore;
{
struct external_sun3_core *extcore = (struct external_sun3_core *)ext;
struct external_sun3_core *extcore = (struct external_sun3_core *) ext;
intcore->c_magic = bfd_h_get_32 (abfd, (unsigned char *)&extcore->c_magic);
intcore->c_len = bfd_h_get_32 (abfd, (unsigned char *)&extcore->c_len );
intcore->c_regs_pos = (long) (((struct external_sun3_core *)0)->c_regs);
intcore->c_magic = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_magic);
intcore->c_len = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_len);
intcore->c_regs_pos = (long) (((struct external_sun3_core *) 0)->c_regs);
intcore->c_regs_size = sizeof (extcore->c_regs);
NAME(aout,swap_exec_header_in)(abfd, &extcore->c_aouthdr,&intcore->c_aouthdr);
intcore->c_signo = bfd_h_get_32 (abfd, (unsigned char *)&extcore->c_signo);
intcore->c_tsize = bfd_h_get_32 (abfd, (unsigned char *)&extcore->c_tsize);
intcore->c_dsize = bfd_h_get_32 (abfd, (unsigned char *)&extcore->c_dsize);
intcore->c_ssize = bfd_h_get_32 (abfd, (unsigned char *)&extcore->c_ssize);
NAME (aout, swap_exec_header_in) (abfd, &extcore->c_aouthdr, &intcore->c_aouthdr);
intcore->c_signo = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_signo);
intcore->c_tsize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_tsize);
intcore->c_dsize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_dsize);
intcore->c_ssize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_ssize);
memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname));
intcore->fp_stuff_pos = (long) (((struct external_sun3_core *)0)->fp_stuff);
intcore->fp_stuff_pos = (long) (((struct external_sun3_core *) 0)->fp_stuff);
/* FP stuff takes up whole rest of struct, except c_ucode. */
intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) -
(file_ptr)(((struct external_sun3_core *)0)->fp_stuff);
(file_ptr) (((struct external_sun3_core *) 0)->fp_stuff);
/* Ucode is the last thing in the struct -- just before the end */
intcore->c_ucode =
bfd_h_get_32 (abfd,
intcore->c_len - sizeof (extcore->c_ucode) + (unsigned char *)extcore);
intcore->c_stacktop = 0x0E000000; /* By experimentation */
intcore->c_len - sizeof (extcore->c_ucode) + (unsigned char *) extcore);
intcore->c_stacktop = 0x0E000000; /* By experimentation */
}
/* byte-swap in the Sparc core structure */
static void
DEFUN(swapcore_sparc,(abfd, ext, intcore),
bfd *abfd AND
char *ext AND
struct internal_sunos_core *intcore)
swapcore_sparc (abfd, ext, intcore)
bfd *abfd;
char *ext;
struct internal_sunos_core *intcore;
{
struct external_sparc_core *extcore = (struct external_sparc_core *)ext;
struct external_sparc_core *extcore = (struct external_sparc_core *) ext;
intcore->c_magic = bfd_h_get_32 (abfd, (unsigned char *)&extcore->c_magic);
intcore->c_len = bfd_h_get_32 (abfd, (unsigned char *)&extcore->c_len );
intcore->c_regs_pos = (long) (((struct external_sparc_core *)0)->c_regs);
intcore->c_magic = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_magic);
intcore->c_len = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_len);
intcore->c_regs_pos = (long) (((struct external_sparc_core *) 0)->c_regs);
intcore->c_regs_size = sizeof (extcore->c_regs);
NAME(aout,swap_exec_header_in)(abfd, &extcore->c_aouthdr,&intcore->c_aouthdr);
intcore->c_signo = bfd_h_get_32 (abfd, (unsigned char *)&extcore->c_signo);
intcore->c_tsize = bfd_h_get_32 (abfd, (unsigned char *)&extcore->c_tsize);
intcore->c_dsize = bfd_h_get_32 (abfd, (unsigned char *)&extcore->c_dsize);
intcore->c_ssize = bfd_h_get_32 (abfd, (unsigned char *)&extcore->c_ssize);
NAME (aout, swap_exec_header_in) (abfd, &extcore->c_aouthdr, &intcore->c_aouthdr);
intcore->c_signo = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_signo);
intcore->c_tsize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_tsize);
intcore->c_dsize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_dsize);
intcore->c_ssize = bfd_h_get_32 (abfd, (unsigned char *) &extcore->c_ssize);
memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname));
intcore->fp_stuff_pos = (long) (((struct external_sparc_core *)0)->fp_stuff);
intcore->fp_stuff_pos = (long) (((struct external_sparc_core *) 0)->fp_stuff);
/* FP stuff takes up whole rest of struct, except c_ucode. */
intcore->fp_stuff_size = intcore->c_len - (sizeof extcore->c_ucode) -
(file_ptr)(((struct external_sparc_core *)0)->fp_stuff);
(file_ptr) (((struct external_sparc_core *) 0)->fp_stuff);
/* Ucode is the last thing in the struct -- just before the end */
intcore->c_ucode =
bfd_h_get_32 (abfd,
intcore->c_len - sizeof (extcore->c_ucode) + (unsigned char *)extcore);
intcore->c_len - sizeof (extcore->c_ucode) + (unsigned char *) extcore);
/* Supposedly the user stack grows downward from the bottom of kernel memory.
Presuming that this remains true, this definition will work. */
@ -439,7 +447,7 @@ DEFUN(swapcore_sparc,(abfd, ext, intcore),
#define SPARC_USRSTACK_SPARC10 ((bfd_vma)0xf0000000)
{
bfd_vma sp = bfd_h_get_32
(abfd, (unsigned char *)&((struct regs *)&extcore->c_regs[0])->r_o6);
(abfd, (unsigned char *) &((struct regs *) &extcore->c_regs[0])->r_o6);
if (sp < SPARC_USRSTACK_SPARC10)
intcore->c_stacktop = SPARC_USRSTACK_SPARC10;
else
@ -455,8 +463,9 @@ DEFUN(swapcore_sparc,(abfd, ext, intcore),
#define core_reg2sec(bfd) (core_hdr(bfd)->reg2_section)
/* These are stored in the bfd's tdata */
struct sun_core_struct {
struct internal_sunos_core *hdr; /* core file header */
struct sun_core_struct
{
struct internal_sunos_core *hdr; /* core file header */
asection *data_section;
asection *stack_section;
asection *reg_section;
@ -464,29 +473,32 @@ struct sun_core_struct {
};
static bfd_target *
DEFUN(sunos4_core_file_p,(abfd),
bfd *abfd)
sunos4_core_file_p (abfd)
bfd *abfd;
{
unsigned char longbuf[4]; /* Raw bytes of various header fields */
int core_size;
int core_mag;
struct internal_sunos_core *core;
char *extcore;
struct mergem {
struct sun_core_struct suncoredata;
struct internal_sunos_core internal_sunos_core;
char external_core[1];
} *mergem;
struct mergem
{
struct sun_core_struct suncoredata;
struct internal_sunos_core internal_sunos_core;
char external_core[1];
}
*mergem;
if (bfd_read ((PTR)longbuf, 1, sizeof (longbuf), abfd) !=
if (bfd_read ((PTR) longbuf, 1, sizeof (longbuf), abfd) !=
sizeof (longbuf))
return 0;
core_mag = bfd_h_get_32 (abfd, longbuf);
if (core_mag != CORE_MAGIC) return 0;
if (core_mag != CORE_MAGIC)
return 0;
/* SunOS core headers can vary in length; second word is size; */
if (bfd_read ((PTR)longbuf, 1, sizeof (longbuf), abfd) !=
if (bfd_read ((PTR) longbuf, 1, sizeof (longbuf), abfd) !=
sizeof (longbuf))
return 0;
core_size = bfd_h_get_32 (abfd, longbuf);
@ -494,68 +506,76 @@ DEFUN(sunos4_core_file_p,(abfd),
if (core_size > 20000)
return 0;
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) < 0) return 0;
mergem = (struct mergem *)bfd_zalloc (abfd, core_size + sizeof (struct mergem));
if (mergem == NULL) {
bfd_error = no_memory;
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) < 0)
return 0;
}
mergem = (struct mergem *) bfd_zalloc (abfd, core_size + sizeof (struct mergem));
if (mergem == NULL)
{
bfd_set_error (bfd_error_no_memory);
return 0;
}
extcore = mergem->external_core;
if ((bfd_read ((PTR) extcore, 1, core_size, abfd)) != core_size) {
bfd_error = system_call_error;
bfd_release (abfd, (char *)mergem);
return 0;
}
if ((bfd_read ((PTR) extcore, 1, core_size, abfd)) != core_size)
{
bfd_set_error (bfd_error_system_call);
bfd_release (abfd, (char *) mergem);
return 0;
}
/* Validate that it's a core file we know how to handle, due to sun
botching the positioning of registers and other fields in a machine
dependent way. */
core = &mergem->internal_sunos_core;
switch (core_size) {
case SPARC_CORE_LEN:
swapcore_sparc (abfd, extcore, core);
break;
case SUN3_CORE_LEN:
swapcore_sun3 (abfd, extcore, core);
break;
default:
bfd_error = system_call_error; /* FIXME */
bfd_release (abfd, (char *)mergem);
return 0;
}
switch (core_size)
{
case SPARC_CORE_LEN:
swapcore_sparc (abfd, extcore, core);
break;
case SUN3_CORE_LEN:
swapcore_sun3 (abfd, extcore, core);
break;
default:
bfd_set_error (bfd_error_system_call); /* FIXME */
bfd_release (abfd, (char *) mergem);
return 0;
}
abfd->tdata.sun_core_data = &mergem->suncoredata;
abfd->tdata.sun_core_data->hdr = core;
abfd->tdata.sun_core_data = &mergem->suncoredata;
abfd->tdata.sun_core_data->hdr = core;
/* create the sections. This is raunchy, but bfd_close wants to reclaim
them */
core_stacksec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection));
if (core_stacksec (abfd) == NULL) {
loser:
bfd_error = no_memory;
bfd_release (abfd, (char *)mergem);
return 0;
}
if (core_stacksec (abfd) == NULL)
{
loser:
bfd_set_error (bfd_error_no_memory);
bfd_release (abfd, (char *) mergem);
return 0;
}
core_datasec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection));
if (core_datasec (abfd) == NULL) {
loser1:
bfd_release (abfd, core_stacksec (abfd));
goto loser;
}
if (core_datasec (abfd) == NULL)
{
loser1:
bfd_release (abfd, core_stacksec (abfd));
goto loser;
}
core_regsec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection));
if (core_regsec (abfd) == NULL) {
loser2:
bfd_release (abfd, core_datasec (abfd));
goto loser1;
}
if (core_regsec (abfd) == NULL)
{
loser2:
bfd_release (abfd, core_datasec (abfd));
goto loser1;
}
core_reg2sec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection));
if (core_reg2sec (abfd) == NULL) {
bfd_release (abfd, core_regsec (abfd));
goto loser2;
}
if (core_reg2sec (abfd) == NULL)
{
bfd_release (abfd, core_regsec (abfd));
goto loser2;
}
core_stacksec (abfd)->name = ".stack";
core_datasec (abfd)->name = ".data";
@ -573,15 +593,15 @@ DEFUN(sunos4_core_file_p,(abfd),
core_reg2sec (abfd)->_raw_size = core->fp_stuff_size;
core_stacksec (abfd)->vma = (core->c_stacktop - core->c_ssize);
core_datasec (abfd)->vma = N_DATADDR(core->c_aouthdr);
core_datasec (abfd)->vma = N_DATADDR (core->c_aouthdr);
core_regsec (abfd)->vma = 0;
core_reg2sec (abfd)->vma = 0;
core_stacksec (abfd)->filepos = core->c_len + core->c_dsize;
core_datasec (abfd)->filepos = core->c_len;
/* We'll access the regs afresh in the core file, like any section: */
core_regsec (abfd)->filepos = (file_ptr)core->c_regs_pos;
core_reg2sec (abfd)->filepos = (file_ptr)core->fp_stuff_pos;
core_regsec (abfd)->filepos = (file_ptr) core->c_regs_pos;
core_reg2sec (abfd)->filepos = (file_ptr) core->fp_stuff_pos;
/* Align to word at least */
core_stacksec (abfd)->alignment_power = 2;
@ -599,52 +619,54 @@ DEFUN(sunos4_core_file_p,(abfd),
return abfd->xvec;
}
static char *sunos4_core_file_failing_command (abfd)
bfd *abfd;
{
static char *
sunos4_core_file_failing_command (abfd)
bfd *abfd;
{
return core_hdr (abfd)->hdr->c_cmdname;
}
static int
DEFUN(sunos4_core_file_failing_signal,(abfd),
bfd *abfd)
sunos4_core_file_failing_signal (abfd)
bfd *abfd;
{
return core_hdr (abfd)->hdr->c_signo;
}
static boolean
DEFUN(sunos4_core_file_matches_executable_p, (core_bfd, exec_bfd),
bfd *core_bfd AND
bfd *exec_bfd)
sunos4_core_file_matches_executable_p (core_bfd, exec_bfd)
bfd *core_bfd;
bfd *exec_bfd;
{
if (core_bfd->xvec != exec_bfd->xvec) {
bfd_error = system_call_error;
return false;
}
if (core_bfd->xvec != exec_bfd->xvec)
{
bfd_set_error (bfd_error_system_call);
return false;
}
return (memcmp ((char *)&((core_hdr (core_bfd)->hdr)->c_aouthdr),
return (memcmp ((char *) &((core_hdr (core_bfd)->hdr)->c_aouthdr),
(char *) exec_hdr (exec_bfd),
sizeof (struct internal_exec)) == 0) ? true : false;
}
#define MY_set_sizes sunos4_set_sizes
static boolean
DEFUN (sunos4_set_sizes, (abfd),
bfd *abfd)
sunos4_set_sizes (abfd)
bfd *abfd;
{
switch (bfd_get_arch (abfd))
{
default:
return false;
case bfd_arch_sparc:
adata(abfd).page_size = 0x2000;
adata(abfd).segment_size = 0x2000;
adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
adata (abfd).page_size = 0x2000;
adata (abfd).segment_size = 0x2000;
adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
return true;
case bfd_arch_m68k:
adata(abfd).page_size = 0x2000;
adata(abfd).segment_size = 0x20000;
adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
adata (abfd).page_size = 0x2000;
adata (abfd).segment_size = 0x20000;
adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
return true;
}
}
@ -656,7 +678,8 @@ DEFUN (sunos4_set_sizes, (abfd),
#define MY_read_dynamic_relocs 0
#endif
static CONST struct aout_backend_data sunos4_aout_backend = {
static CONST struct aout_backend_data sunos4_aout_backend =
{
0, /* zmagic files are not contiguous */
1, /* text includes header */
0, /* default text vma */

View File

@ -248,12 +248,13 @@ static reloc_howto_type howto_table[] =
#define RELOC_PROCESSING(relent, reloc, symbols, abfd, section) \
reloc_processing(relent, reloc, symbols, abfd, section)
static void DEFUN(reloc_processing,(relent,reloc, symbols, abfd, section) ,
arelent *relent AND
struct internal_reloc *reloc AND
asymbol **symbols AND
bfd *abfd AND
asection *section)
static void
reloc_processing (relent,reloc, symbols, abfd, section)
arelent *relent;
struct internal_reloc *reloc;
asymbol **symbols;
bfd *abfd;
asection *section;
{
relent->address = reloc->r_vaddr;
relent->howto = howto_table + reloc->r_type;

View File

@ -405,9 +405,9 @@ sec_to_styp_flags (sec_name, sec_flags)
* in sec_to_styp_flags().
*/
static flagword
DEFUN (styp_to_sec_flags, (abfd, hdr),
bfd * abfd AND
PTR hdr)
styp_to_sec_flags (abfd, hdr)
bfd * abfd;
PTR hdr;
{
struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr;
long styp_flags = internal_s->s_flags;
@ -695,9 +695,9 @@ dependent COFF routines:
/* See whether the magic number matches. */
static boolean
DEFUN (coff_bad_format_hook, (abfd, filehdr),
bfd * abfd AND
PTR filehdr)
coff_bad_format_hook (abfd, filehdr)
bfd * abfd;
PTR filehdr;
{
struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
@ -722,9 +722,9 @@ DEFUN (coff_bad_format_hook, (abfd, filehdr),
}
static asection *
DEFUN (coff_make_section_hook, (abfd, name),
bfd * abfd AND
char *name)
coff_make_section_hook (abfd, name)
bfd * abfd;
char *name;
{
#ifdef TWO_DATA_SECS
/* FIXME: This predates the call to bfd_make_section_anyway
@ -743,9 +743,9 @@ DEFUN (coff_make_section_hook, (abfd, name),
*/
static boolean
DEFUN (coff_new_section_hook, (abfd, section),
bfd * abfd AND
asection * section)
coff_new_section_hook (abfd, section)
bfd * abfd;
asection * section;
{
section->alignment_power = abfd->xvec->align_power_min;
/* Allocate aux records for section symbols, to store size and
@ -764,10 +764,10 @@ DEFUN (coff_new_section_hook, (abfd, section),
/* Set the alignment of a BFD section. */
static void
DEFUN (coff_set_alignment_hook, (abfd, section, scnhdr),
bfd * abfd AND
asection * section AND
PTR scnhdr)
coff_set_alignment_hook (abfd, section, scnhdr)
bfd * abfd;
asection * section;
PTR scnhdr;
{
struct internal_scnhdr *hdr = (struct internal_scnhdr *) scnhdr;
unsigned int i;
@ -786,15 +786,15 @@ DEFUN (coff_set_alignment_hook, (abfd, section, scnhdr),
#endif /* ! I960 */
static boolean
DEFUN (coff_mkobject, (abfd),
bfd * abfd)
coff_mkobject (abfd)
bfd * abfd;
{
coff_data_type *coff;
abfd->tdata.coff_obj_data = (struct coff_tdata *) bfd_zalloc (abfd, sizeof (coff_data_type));
if (abfd->tdata.coff_obj_data == 0)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return false;
}
coff = coff_data (abfd);
@ -810,10 +810,10 @@ DEFUN (coff_mkobject, (abfd),
/* Create the COFF backend specific information. */
static PTR
DEFUN (coff_mkobject_hook, (abfd, filehdr, aouthdr),
bfd * abfd AND
PTR filehdr AND
PTR aouthdr)
coff_mkobject_hook (abfd, filehdr, aouthdr)
bfd * abfd;
PTR filehdr;
PTR aouthdr;
{
struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr;
coff_data_type *coff;
@ -1015,9 +1015,9 @@ coff_set_arch_mach_hook (abfd, filehdr)
#ifdef SYMNAME_IN_DEBUG
static boolean
DEFUN (symname_in_debug_hook, (abfd, sym),
bfd * abfd AND
struct internal_syment *sym)
symname_in_debug_hook (abfd, sym)
bfd * abfd;
struct internal_syment *sym;
{
return SYMNAME_IN_DEBUG (sym) ? true : false;
}
@ -1046,8 +1046,8 @@ SUBSUBSECTION
*/
static void
DEFUN (coff_write_relocs, (abfd),
bfd * abfd)
coff_write_relocs (abfd)
bfd * abfd;
{
asection *s;
for (s = abfd->sections; s != (asection *) NULL; s = s->next)
@ -1109,10 +1109,10 @@ DEFUN (coff_write_relocs, (abfd),
type. Result is true if we can represent the arch&type, false if not. */
static boolean
DEFUN (coff_set_flags, (abfd, magicp, flagsp),
bfd * abfd AND
unsigned *magicp AND
unsigned short *flagsp)
coff_set_flags (abfd, magicp, flagsp)
bfd * abfd;
unsigned *magicp;
unsigned short *flagsp;
{
switch (bfd_get_arch (abfd))
{
@ -1275,10 +1275,10 @@ DEFUN (coff_set_flags, (abfd, magicp, flagsp),
static boolean
DEFUN (coff_set_arch_mach, (abfd, arch, machine),
bfd * abfd AND
enum bfd_architecture arch AND
unsigned long machine)
coff_set_arch_mach (abfd, arch, machine)
bfd * abfd;
enum bfd_architecture arch;
unsigned long machine;
{
unsigned dummy1;
unsigned short dummy2;
@ -1294,8 +1294,8 @@ DEFUN (coff_set_arch_mach, (abfd, arch, machine),
/* Calculate the file position for each section. */
static void
DEFUN (coff_compute_section_file_positions, (abfd),
bfd * abfd)
coff_compute_section_file_positions (abfd)
bfd * abfd;
{
asection *current;
asection *previous = (asection *) NULL;
@ -1422,7 +1422,7 @@ coff_add_missing_symbols (abfd)
sympp2 = (asymbol **) bfd_alloc_by_size_t (abfd, nsyms * sizeof (asymbol *));
if (!sympp2)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return false;
}
memcpy (sympp2, sympp, i * sizeof (asymbol *));
@ -1447,8 +1447,8 @@ coff_add_missing_symbols (abfd)
/* SUPPRESS 558 */
/* SUPPRESS 529 */
static boolean
DEFUN (coff_write_object_contents, (abfd),
bfd * abfd)
coff_write_object_contents (abfd)
bfd * abfd;
{
asection *current;
unsigned int count;
@ -1470,7 +1470,7 @@ DEFUN (coff_write_object_contents, (abfd),
struct internal_aouthdr internal_a;
bfd_error = system_call_error;
bfd_set_error (bfd_error_system_call);
/* Number the output sections, starting from one on the first section
with a name which doesn't start with a *.
@@ The code doesn't make this check. Is it supposed to be done,
@ -1808,12 +1808,12 @@ DEFUN (coff_write_object_contents, (abfd),
}
static boolean
DEFUN (coff_set_section_contents, (abfd, section, location, offset, count),
bfd * abfd AND
sec_ptr section AND
PTR location AND
file_ptr offset AND
bfd_size_type count)
coff_set_section_contents (abfd, section, location, offset, count)
bfd * abfd;
sec_ptr section;
PTR location;
file_ptr offset;
bfd_size_type count;
{
if (abfd->output_has_begun == false) /* set by bfd.c handler */
coff_compute_section_file_positions (abfd);
@ -1857,7 +1857,7 @@ coff_close_and_cleanup (abfd)
return false;
break;
default:
bfd_error = invalid_operation;
bfd_set_error (bfd_error_invalid_operation);
return false;
}
@ -1878,13 +1878,13 @@ buy_and_read (abfd, where, seek_direction, size)
PTR area = (PTR) bfd_alloc (abfd, size);
if (!area)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return (NULL);
}
bfd_seek (abfd, where, seek_direction);
if (bfd_read (area, 1, size, abfd) != size)
{
bfd_error = system_call_error;
bfd_set_error (bfd_error_system_call);
return (NULL);
} /* on error */
return (area);
@ -1930,7 +1930,7 @@ coff_slurp_line_table (abfd, asect)
(alent *) bfd_alloc (abfd, (size_t) ((asect->lineno_count + 1) * sizeof (alent)));
if (lineno_cache == NULL)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return false;
}
else
@ -1972,8 +1972,8 @@ coff_slurp_line_table (abfd, asect)
}
static boolean
DEFUN (coff_slurp_symbol_table, (abfd),
bfd * abfd)
coff_slurp_symbol_table (abfd)
bfd * abfd;
{
combined_entry_type *native_symbols;
coff_symbol_type *cached_area;
@ -1997,7 +1997,7 @@ DEFUN (coff_slurp_symbol_table, (abfd),
if (cached_area == NULL)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return false;
} /* on error */
table_ptr =
@ -2006,7 +2006,7 @@ DEFUN (coff_slurp_symbol_table, (abfd),
if (table_ptr == NULL)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return false;
}
else
@ -2277,10 +2277,10 @@ SUBSUBSECTION
#endif
static boolean
DEFUN (coff_slurp_reloc_table, (abfd, asect, symbols),
bfd * abfd AND
sec_ptr asect AND
asymbol ** symbols)
coff_slurp_reloc_table (abfd, asect, symbols)
bfd * abfd;
sec_ptr asect;
asymbol ** symbols;
{
RELOC *native_relocs;
arelent *reloc_cache;
@ -2307,7 +2307,7 @@ DEFUN (coff_slurp_reloc_table, (abfd, asect, symbols),
if (reloc_cache == NULL)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return false;
}
@ -2376,11 +2376,11 @@ DEFUN (coff_slurp_reloc_table, (abfd, asect, symbols),
/* This is stupid. This function should be a boolean predicate. */
static unsigned int
DEFUN (coff_canonicalize_reloc, (abfd, section, relptr, symbols),
bfd * abfd AND
sec_ptr section AND
arelent ** relptr AND
asymbol ** symbols)
coff_canonicalize_reloc (abfd, section, relptr, symbols)
bfd * abfd;
sec_ptr section;
arelent ** relptr;
asymbol ** symbols;
{
arelent *tblptr = section->relocation;
unsigned int count = 0;

View File

@ -1,5 +1,5 @@
/* Core file generic interface routines for BFD.
Copyright (C) 1990-1991 Free Software Foundation, Inc.
Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@ -45,8 +45,8 @@ DESCRIPTION
*/
CONST char *
DEFUN(bfd_core_file_failing_command,(abfd),
bfd *abfd)
bfd_core_file_failing_command (abfd)
bfd *abfd;
{
if (abfd->format != bfd_core) {
bfd_set_error (bfd_error_invalid_operation);

View File

@ -38,7 +38,8 @@ static bfd_arch_info_type arch_info_struct =
0,
};
void DEFUN_VOID(bfd_a29k_arch)
void
bfd_a29k_arch ()
{
bfd_arch_linkin(&arch_info_struct);
}

View File

@ -1,5 +1,5 @@
/* BFD library support routines for constructors
Copyright (C) 1990-1991 Free Software Foundation, Inc.
Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
Hacked by Steve Chamberlain of Cygnus Support. With some help from
Judy Chamberlain too.
@ -115,10 +115,10 @@ DESCRIPTION
boolean
DEFUN(bfd_constructor_entry,(abfd, symbol_ptr_ptr, type),
bfd *abfd AND
asymbol **symbol_ptr_ptr AND
CONST char *type)
bfd_constructor_entry (abfd, symbol_ptr_ptr, type)
bfd *abfd;
asymbol **symbol_ptr_ptr;
CONST char *type;
{
/* Look up the section we're using to store the table in */
asection *rel_section = bfd_get_section_by_name (abfd, type);

View File

@ -37,17 +37,17 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
standard requires. */
static void
DEFUN (ieee_write_byte, (abfd, byte),
bfd * abfd AND
bfd_byte byte)
ieee_write_byte (abfd, byte)
bfd *abfd;
bfd_byte byte;
{
bfd_write ((PTR) & byte, 1, 1, abfd);
}
static void
DEFUN (ieee_write_twobyte, (abfd, twobyte),
bfd * abfd AND
int twobyte)
ieee_write_twobyte (abfd, twobyte)
bfd *abfd;
int twobyte;
{
bfd_byte b[2];
b[1] = twobyte & 0xff;
@ -56,9 +56,9 @@ DEFUN (ieee_write_twobyte, (abfd, twobyte),
}
static void
DEFUN (ieee_write_2bytes, (abfd, bytes),
bfd * abfd AND
int bytes)
ieee_write_2bytes (abfd, bytes)
bfd *abfd;
int bytes;
{
bfd_byte buffer[2];
buffer[0] = bytes >> 8;
@ -68,9 +68,9 @@ DEFUN (ieee_write_2bytes, (abfd, bytes),
}
static void
DEFUN (ieee_write_int, (abfd, value),
bfd * abfd AND
bfd_vma value)
ieee_write_int (abfd, value)
bfd *abfd;
bfd_vma value;
{
if (((unsigned) value) <= 127)
{
@ -113,9 +113,9 @@ DEFUN (ieee_write_int, (abfd, value),
}
static void
DEFUN (ieee_write_id, (abfd, id),
bfd * abfd AND
CONST char *id)
ieee_write_id (abfd, id)
bfd *abfd;
CONST char *id;
{
size_t length = strlen (id);
if (length <= 127)
@ -151,8 +151,8 @@ standard requires:
#define this_byte_and_next(ieee) (*((ieee)->input_p++))
static unsigned short
DEFUN (read_2bytes, (ieee),
common_header_type * ieee)
read_2bytes (ieee)
common_header_type *ieee;
{
unsigned char c1 = this_byte_and_next (ieee);
unsigned char c2 = this_byte_and_next (ieee);
@ -160,10 +160,10 @@ DEFUN (read_2bytes, (ieee),
}
static void
DEFUN (bfd_get_string, (ieee, string, length),
common_header_type * ieee AND
char *string AND
size_t length)
bfd_get_string (ieee, string, length)
common_header_type *ieee;
char *string;
size_t length;
{
size_t i;
for (i = 0; i < length; i++)
@ -173,8 +173,8 @@ DEFUN (bfd_get_string, (ieee, string, length),
}
static char *
DEFUN (read_id, (ieee),
common_header_type * ieee)
read_id (ieee)
common_header_type *ieee;
{
size_t length;
char *string;
@ -198,7 +198,7 @@ DEFUN (read_id, (ieee),
string = bfd_alloc (ieee->abfd, length + 1);
if (!string)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return NULL;
}
bfd_get_string (ieee, string, length);
@ -207,12 +207,12 @@ DEFUN (read_id, (ieee),
}
static void
DEFUN (ieee_write_expression, (abfd, value, symbol, pcrel, index),
bfd * abfd AND
bfd_vma value AND
asymbol * symbol AND
boolean pcrel AND
unsigned int index)
ieee_write_expression (abfd, value, symbol, pcrel, index)
bfd *abfd;
bfd_vma value;
asymbol *symbol;
boolean pcrel;
unsigned int index;
{
unsigned int term_count = 0;
@ -289,9 +289,9 @@ DEFUN (ieee_write_expression, (abfd, value, symbol, pcrel, index),
writes any integer into the buffer supplied and always takes 5 bytes
*/
static void
DEFUN (ieee_write_int5, (buffer, value),
bfd_byte * buffer AND
bfd_vma value)
ieee_write_int5 (buffer, value)
bfd_byte *buffer;
bfd_vma value;
{
buffer[0] = (bfd_byte) ieee_number_repeat_4_enum;
buffer[1] = (value >> 24) & 0xff;
@ -301,9 +301,9 @@ DEFUN (ieee_write_int5, (buffer, value),
}
static void
DEFUN (ieee_write_int5_out, (abfd, value),
bfd * abfd AND
bfd_vma value)
ieee_write_int5_out (abfd, value)
bfd *abfd;
bfd_vma value;
{
bfd_byte b[5];
ieee_write_int5 (b, value);
@ -311,9 +311,9 @@ DEFUN (ieee_write_int5_out, (abfd, value),
}
static boolean
DEFUN (parse_int, (ieee, value_ptr),
common_header_type * ieee AND
bfd_vma * value_ptr)
parse_int (ieee, value_ptr)
common_header_type *ieee;
bfd_vma *value_ptr;
{
int value = this_byte (ieee);
int result;
@ -340,9 +340,9 @@ DEFUN (parse_int, (ieee, value_ptr),
}
static int
DEFUN (parse_i, (ieee, ok),
common_header_type * ieee AND
boolean * ok)
parse_i (ieee, ok)
common_header_type *ieee;
boolean *ok;
{
bfd_vma x;
*ok = parse_int (ieee, &x);
@ -350,8 +350,8 @@ DEFUN (parse_i, (ieee, ok),
}
static bfd_vma
DEFUN (must_parse_int, (ieee),
common_header_type * ieee)
must_parse_int (ieee)
common_header_type *ieee;
{
bfd_vma result;
BFD_ASSERT (parse_int (ieee, &result) == true);
@ -396,13 +396,13 @@ static ieee_symbol_index_type NOSYMBOL =
static void
DEFUN (parse_expression, (ieee, value, symbol, pcrel, extra, section),
ieee_data_type * ieee AND
bfd_vma * value AND
ieee_symbol_index_type * symbol AND
boolean * pcrel AND
unsigned int *extra AND
asection ** section)
parse_expression (ieee, value, symbol, pcrel, extra, section)
ieee_data_type *ieee;
bfd_vma *value;
ieee_symbol_index_type *symbol;
boolean *pcrel;
unsigned int *extra;
asection **section;
{
#define POS sp[1]
@ -542,22 +542,22 @@ static unsigned int last_index;
static char last_type; /* is the index for an X or a D */
static ieee_symbol_type *
DEFUN (get_symbol, (abfd,
ieee,
last_symbol,
symbol_count,
pptr,
max_index,
this_type
),
bfd * abfd AND
ieee_data_type * ieee AND
ieee_symbol_type * last_symbol AND
unsigned int *symbol_count AND
ieee_symbol_type *** pptr AND
unsigned int *max_index AND
char this_type
get_symbol (abfd,
ieee,
last_symbol,
symbol_count,
pptr,
max_index,
this_type
)
bfd *abfd;
ieee_data_type *ieee;
ieee_symbol_type *last_symbol;
unsigned int *symbol_count;
ieee_symbol_type ***pptr;
unsigned int *max_index;
char this_type
;
{
/* Need a new symbol */
unsigned int new_index = must_parse_int (&(ieee->h));
@ -567,7 +567,7 @@ DEFUN (get_symbol, (abfd,
sizeof (ieee_symbol_type));
if (!new_symbol)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return NULL;
}
@ -587,8 +587,8 @@ DEFUN (get_symbol, (abfd,
}
static void
DEFUN (ieee_slurp_external_symbols, (abfd),
bfd * abfd)
ieee_slurp_external_symbols (abfd)
bfd *abfd;
{
ieee_data_type *ieee = IEEE_DATA (abfd);
file_ptr offset = ieee->w.r.external_part;
@ -763,8 +763,8 @@ DEFUN (ieee_slurp_external_symbols, (abfd),
}
static void
DEFUN (ieee_slurp_symbol_table, (abfd),
bfd * abfd)
ieee_slurp_symbol_table (abfd)
bfd *abfd;
{
if (IEEE_DATA (abfd)->read_symbols == false)
{
@ -774,8 +774,8 @@ DEFUN (ieee_slurp_symbol_table, (abfd),
}
unsigned int
DEFUN (ieee_get_symtab_upper_bound, (abfd),
bfd * abfd)
ieee_get_symtab_upper_bound (abfd)
bfd *abfd;
{
ieee_slurp_symbol_table (abfd);
@ -791,9 +791,9 @@ symbol index order
extern bfd_target ieee_vec;
unsigned int
DEFUN (ieee_get_symtab, (abfd, location),
bfd * abfd AND
asymbol ** location)
ieee_get_symtab (abfd, location)
bfd *abfd;
asymbol **location;
{
ieee_symbol_type *symp;
static bfd dummy_bfd;
@ -848,10 +848,10 @@ DEFUN (ieee_get_symtab, (abfd, location),
}
static asection *
DEFUN (get_section_entry, (abfd, ieee, index),
bfd * abfd AND
ieee_data_type * ieee AND
unsigned int index)
get_section_entry (abfd, ieee, index)
bfd *abfd;
ieee_data_type *ieee;
unsigned int index;
{
if (ieee->section_table[index] == (asection *) NULL)
{
@ -860,7 +860,7 @@ DEFUN (get_section_entry, (abfd, ieee, index),
if (!tmp)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return NULL;
}
sprintf (tmp, " fsec%4d", index);
@ -874,8 +874,8 @@ DEFUN (get_section_entry, (abfd, ieee, index),
}
static void
DEFUN (ieee_slurp_sections, (abfd),
bfd * abfd)
ieee_slurp_sections (abfd)
bfd *abfd;
{
ieee_data_type *ieee = IEEE_DATA (abfd);
file_ptr offset = ieee->w.r.section_part;
@ -1039,8 +1039,8 @@ DEFUN (ieee_slurp_sections, (abfd),
*/
bfd_target *
DEFUN (ieee_archive_p, (abfd),
bfd * abfd)
ieee_archive_p (abfd)
bfd *abfd;
{
char *library;
boolean loop;
@ -1054,7 +1054,7 @@ DEFUN (ieee_archive_p, (abfd),
abfd->tdata.ieee_ar_data = (ieee_ar_data_type *) bfd_alloc (abfd, sizeof (ieee_ar_data_type));
if (!abfd->tdata.ieee_ar_data)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return NULL;
}
ieee = IEEE_AR_DATA (abfd);
@ -1087,7 +1087,7 @@ DEFUN (ieee_archive_p, (abfd),
if (!obstack_begin (&ob, 128))
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return (bfd_target *) NULL;
}
@ -1132,7 +1132,7 @@ DEFUN (ieee_archive_p, (abfd),
ieee->elements = (ieee_ar_obstack_type *) obstack_finish (&ob);
if (!ieee->elements)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return (bfd_target *) NULL;
}
@ -1165,16 +1165,16 @@ DEFUN (ieee_archive_p, (abfd),
}
static boolean
DEFUN (ieee_mkobject, (abfd),
bfd * abfd)
ieee_mkobject (abfd)
bfd *abfd;
{
abfd->tdata.ieee_data = (ieee_data_type *) bfd_zalloc (abfd, sizeof (ieee_data_type));
return abfd->tdata.ieee_data ? true : false;
}
bfd_target *
DEFUN (ieee_object_p, (abfd),
bfd * abfd)
ieee_object_p (abfd)
bfd *abfd;
{
char *processor;
unsigned int part;
@ -1270,7 +1270,7 @@ DEFUN (ieee_object_p, (abfd),
+ 50);
if (!IEEE_DATA (abfd)->h.first_byte)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
goto fail;
}
bfd_seek (abfd, (file_ptr) 0, SEEK_SET);
@ -1285,10 +1285,10 @@ fail:
}
void
DEFUN (ieee_get_symbol_info, (ignore_abfd, symbol, ret),
bfd * ignore_abfd AND
asymbol * symbol AND
symbol_info * ret)
ieee_get_symbol_info (ignore_abfd, symbol, ret)
bfd *ignore_abfd;
asymbol *symbol;
symbol_info *ret;
{
bfd_symbol_info (symbol, ret);
if (symbol->name[0] == ' ')
@ -1298,11 +1298,11 @@ DEFUN (ieee_get_symbol_info, (ignore_abfd, symbol, ret),
}
void
DEFUN (ieee_print_symbol, (ignore_abfd, afile, symbol, how),
bfd * ignore_abfd AND
PTR afile AND
asymbol * symbol AND
bfd_print_symbol_type how)
ieee_print_symbol (ignore_abfd, afile, symbol, how)
bfd *ignore_abfd;
PTR afile;
asymbol *symbol;
bfd_print_symbol_type how;
{
FILE *file = (FILE *) afile;
@ -1344,11 +1344,11 @@ DEFUN (ieee_print_symbol, (ignore_abfd, afile, symbol, how),
}
static boolean
DEFUN (do_one, (ieee, current_map, location_ptr, s),
ieee_data_type * ieee AND
ieee_per_section_type * current_map AND
unsigned char *location_ptr AND
asection * s)
do_one (ieee, current_map, location_ptr, s)
ieee_data_type *ieee;
ieee_per_section_type *current_map;
unsigned char *location_ptr;
asection *s;
{
switch (this_byte (&(ieee->h)))
{
@ -1389,7 +1389,7 @@ DEFUN (do_one, (ieee, current_map, location_ptr, s),
sizeof (ieee_reloc_type));
if (!r)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return false;
}
@ -1540,8 +1540,8 @@ DEFUN (do_one, (ieee, current_map, location_ptr, s),
/* Read in all the section data and relocation stuff too */
static boolean
DEFUN (ieee_slurp_section_data, (abfd),
bfd * abfd)
ieee_slurp_section_data (abfd)
bfd *abfd;
{
bfd_byte *location_ptr = (bfd_byte *) NULL;
ieee_data_type *ieee = IEEE_DATA (abfd);
@ -1563,7 +1563,7 @@ DEFUN (ieee_slurp_section_data, (abfd),
per->data = (bfd_byte *) bfd_alloc (ieee->h.abfd, s->_raw_size);
if (!per->data)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return false;
}
/*SUPPRESS 68*/
@ -1668,15 +1668,15 @@ DEFUN (ieee_slurp_section_data, (abfd),
}
boolean
DEFUN (ieee_new_section_hook, (abfd, newsect),
bfd * abfd AND
asection * newsect)
ieee_new_section_hook (abfd, newsect)
bfd *abfd;
asection *newsect;
{
newsect->used_by_bfd = (PTR)
bfd_alloc (abfd, sizeof (ieee_per_section_type));
if (!newsect->used_by_bfd)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return false;
}
ieee_per_section (newsect)->data = (bfd_byte *) NULL;
@ -1685,21 +1685,21 @@ DEFUN (ieee_new_section_hook, (abfd, newsect),
}
unsigned int
DEFUN (ieee_get_reloc_upper_bound, (abfd, asect),
bfd * abfd AND
sec_ptr asect)
ieee_get_reloc_upper_bound (abfd, asect)
bfd *abfd;
sec_ptr asect;
{
ieee_slurp_section_data (abfd);
return (asect->reloc_count + 1) * sizeof (arelent *);
}
static boolean
DEFUN (ieee_get_section_contents, (abfd, section, location, offset, count),
bfd * abfd AND
sec_ptr section AND
PTR location AND
file_ptr offset AND
bfd_size_type count)
ieee_get_section_contents (abfd, section, location, offset, count)
bfd *abfd;
sec_ptr section;
PTR location;
file_ptr offset;
bfd_size_type count;
{
ieee_per_section_type *p = (ieee_per_section_type *) section->used_by_bfd;
ieee_slurp_section_data (abfd);
@ -1708,11 +1708,11 @@ DEFUN (ieee_get_section_contents, (abfd, section, location, offset, count),
}
unsigned int
DEFUN (ieee_canonicalize_reloc, (abfd, section, relptr, symbols),
bfd * abfd AND
sec_ptr section AND
arelent ** relptr AND
asymbol ** symbols)
ieee_canonicalize_reloc (abfd, section, relptr, symbols)
bfd *abfd;
sec_ptr section;
arelent **relptr;
asymbol **symbols;
{
/* ieee_per_section_type *p = (ieee_per_section_type *) section->used_by_bfd;*/
ieee_reloc_type *src = (ieee_reloc_type *) (section->relocation);
@ -1743,9 +1743,9 @@ DEFUN (ieee_canonicalize_reloc, (abfd, section, relptr, symbols),
}
static int
DEFUN (comp, (ap, bp),
CONST PTR ap AND
CONST PTR bp)
comp (ap, bp)
CONST PTR ap;
CONST PTR bp;
{
arelent *a = *((arelent **) ap);
arelent *b = *((arelent **) bp);
@ -1757,8 +1757,8 @@ Write the section headers
*/
static void
DEFUN (ieee_write_section_part, (abfd),
bfd * abfd)
ieee_write_section_part (abfd)
bfd *abfd;
{
ieee_data_type *ieee = IEEE_DATA (abfd);
asection *s;
@ -1831,9 +1831,9 @@ DEFUN (ieee_write_section_part, (abfd),
static boolean
DEFUN (do_with_relocs, (abfd, s),
bfd * abfd AND
asection * s)
do_with_relocs (abfd, s)
bfd *abfd;
asection *s;
{
unsigned int relocs_to_go = s->reloc_count;
@ -1898,7 +1898,7 @@ DEFUN (do_with_relocs, (abfd, s),
stream = (unsigned char *) (bfd_alloc (abfd, s->_raw_size));
if (!stream)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return false;
}
memset ((PTR) stream, 0, s->_raw_size);
@ -2007,9 +2007,9 @@ be clever about how we write. We block items up into a max of 127
bytes */
static void
DEFUN (do_as_repeat, (abfd, s),
bfd * abfd AND
asection * s)
do_as_repeat (abfd, s)
bfd *abfd;
asection *s;
{
if (s->_raw_size)
{
@ -2029,9 +2029,9 @@ DEFUN (do_as_repeat, (abfd, s),
}
static void
DEFUN (do_without_relocs, (abfd, s),
bfd * abfd AND
asection * s)
do_without_relocs (abfd, s)
bfd *abfd;
asection *s;
{
bfd_byte *stream = ieee_per_section (s)->data;
@ -2261,8 +2261,8 @@ struct output_buffer_struct
};
static void
DEFUN (fill_int, (buf),
struct output_buffer_struct *buf)
fill_int (buf)
struct output_buffer_struct *buf;
{
if (buf->buffer == output_buffer)
{
@ -2276,8 +2276,8 @@ DEFUN (fill_int, (buf),
}
static void
DEFUN (drop_int, (buf),
struct output_buffer_struct *buf)
drop_int (buf)
struct output_buffer_struct *buf;
{
int type = THIS ();
int ch;
@ -2670,7 +2670,7 @@ e2_record ()
}
static void
DEFUN_VOID (block)
block ()
{
int ch;
while (1)
@ -2711,9 +2711,9 @@ DEFUN_VOID (block)
*/
static void
DEFUN (relocate_debug, (output, input),
bfd * output AND
bfd * input)
relocate_debug (output, input)
bfd *output;
bfd *input;
{
#define IBS 400
#define OBS 400
@ -2733,8 +2733,8 @@ DEFUN (relocate_debug, (output, input),
*/
static void
DEFUN (ieee_write_debug_part, (abfd),
bfd * abfd)
ieee_write_debug_part (abfd)
bfd *abfd;
{
ieee_data_type *ieee = IEEE_DATA (abfd);
bfd_chain_type *chain = ieee->chain_root;
@ -2822,8 +2822,8 @@ DEFUN (ieee_write_debug_part, (abfd),
/* write the data in an ieee way */
static void
DEFUN (ieee_write_data_part, (abfd),
bfd * abfd)
ieee_write_data_part (abfd)
bfd *abfd;
{
asection *s;
ieee_data_type *ieee = IEEE_DATA (abfd);
@ -2845,8 +2845,8 @@ DEFUN (ieee_write_data_part, (abfd),
static boolean
DEFUN (init_for_output, (abfd),
bfd * abfd)
init_for_output (abfd)
bfd *abfd;
{
asection *s;
for (s = abfd->sections; s != (asection *) NULL; s = s->next)
@ -2856,7 +2856,7 @@ DEFUN (init_for_output, (abfd),
ieee_per_section (s)->data = (bfd_byte *) (bfd_alloc (abfd, s->_raw_size));
if (!ieee_per_section (s)->data)
{
bfd_error = no_memory;
bfd_set_error (bfd_error_no_memory);
return false;
}
}
@ -2870,12 +2870,12 @@ DEFUN (init_for_output, (abfd),
* not a byte image, but a record stream.
*/
boolean
DEFUN (ieee_set_section_contents, (abfd, section, location, offset, count),
bfd * abfd AND
sec_ptr section AND
PTR location AND
file_ptr offset AND
bfd_size_type count)
ieee_set_section_contents (abfd, section, location, offset, count)
bfd *abfd;
sec_ptr section;
PTR location;
file_ptr offset;
bfd_size_type count;
{
if (ieee_per_section (section)->data == (bfd_byte *) NULL)
{
@ -2895,8 +2895,8 @@ to index them as well. When we write them out we turn their symbol
values into indexes from the right base.
*/
static void
DEFUN (ieee_write_external_part, (abfd),
bfd * abfd)
ieee_write_external_part (abfd)
bfd *abfd;
{
asymbol **q;
ieee_data_type *ieee = IEEE_DATA (abfd);
@ -3017,8 +3017,8 @@ static CONST unsigned char envi[] =
static
void
DEFUN (ieee_write_me_part, (abfd),
bfd * abfd)
ieee_write_me_part (abfd)
bfd *abfd;
{
ieee_data_type *ieee = IEEE_DATA (abfd);
ieee->w.r.trailer_part = bfd_tell (abfd);
@ -3039,8 +3039,8 @@ DEFUN (ieee_write_me_part, (abfd),
}
boolean
DEFUN (ieee_write_object_contents, (abfd),
bfd * abfd)
ieee_write_object_contents (abfd)
bfd *abfd;
{
ieee_data_type *ieee = IEEE_DATA (abfd);
unsigned int i;
@ -3128,15 +3128,15 @@ function exits. We read the strings into a buffer large enough to
hold them all plus all the cached symbol entries. */
asymbol *
DEFUN (ieee_make_empty_symbol, (abfd),
bfd * abfd)
ieee_make_empty_symbol (abfd)
bfd *abfd;
{
ieee_symbol_type *new =
(ieee_symbol_type *) bfd_zmalloc (sizeof (ieee_symbol_type));
if (!new)
{
bfd_error = no_error;
bfd_set_error (bfd_error_no_error);
return NULL;
}
new->symbol.the_bfd = abfd;
@ -3144,9 +3144,9 @@ DEFUN (ieee_make_empty_symbol, (abfd),
}
static bfd *
DEFUN (ieee_openr_next_archived_file, (arch, prev),
bfd * arch AND
bfd * prev)
ieee_openr_next_archived_file (arch, prev)
bfd *arch;
bfd *prev;
{
ieee_ar_data_type *ar = IEEE_AR_DATA (arch);
/* take the next one from the arch state, or reset */
@ -3173,7 +3173,7 @@ DEFUN (ieee_openr_next_archived_file, (arch, prev),
}
else
{
bfd_error = no_more_archived_files;
bfd_set_error (bfd_error_no_more_archived_files);
return (bfd *) NULL;
}
@ -3207,7 +3207,7 @@ ieee_generic_stat_arch_elt (abfd, buf)
ieee_ar_data_type *ar = abfd->my_archive->tdata.ieee_ar_data;
if (ar == (ieee_ar_data_type *) NULL)
{
bfd_error = invalid_operation;
bfd_set_error (bfd_error_invalid_operation);
return -1;
}
else
@ -3219,24 +3219,24 @@ ieee_generic_stat_arch_elt (abfd, buf)
}
static int
DEFUN (ieee_sizeof_headers, (abfd, x),
bfd * abfd AND
boolean x)
ieee_sizeof_headers (abfd, x)
bfd *abfd;
boolean x;
{
return 0;
}
static void
DEFUN (ieee_bfd_debug_info_start, (abfd),
bfd * abfd)
ieee_bfd_debug_info_start (abfd)
bfd *abfd;
{
}
static void
DEFUN (ieee_bfd_debug_info_end, (abfd),
bfd * abfd)
ieee_bfd_debug_info_end (abfd)
bfd *abfd;
{
}
@ -3246,9 +3246,9 @@ DEFUN (ieee_bfd_debug_info_end, (abfd),
be ready to output it at close time
*/
static void
DEFUN (ieee_bfd_debug_info_accumulate, (abfd, section),
bfd * abfd AND
asection * section)
ieee_bfd_debug_info_accumulate (abfd, section)
bfd *abfd;
asection *section;
{
ieee_data_type *ieee = IEEE_DATA (section->owner);
ieee_data_type *output_ieee = IEEE_DATA (abfd);
@ -3270,8 +3270,8 @@ DEFUN (ieee_bfd_debug_info_accumulate, (abfd, section),
bfd_chain_type *n = (bfd_chain_type *) bfd_alloc (abfd, sizeof (bfd_chain_type));
if (!n)
{
bfd_error = no_memory;
abort(); /* FIXME */
bfd_set_error (bfd_error_no_memory);
abort (); /* FIXME */
}
n->this = section->owner;
n->next = (bfd_chain_type *) NULL;

View File

@ -282,8 +282,7 @@ bfd_constructor_entry PARAMS ((bfd *abfd,
const struct reloc_howto_struct *
bfd_default_reloc_type_lookup
PARAMS ((bfd *abfd AND
bfd_reloc_code_real_type code));
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
boolean
bfd_generic_relax_section

File diff suppressed because it is too large Load Diff

View File

@ -247,6 +247,12 @@ CODE_FRAGMENT
. discarded. *}
.#define SEC_DEBUGGING 0x10000
.
. {* The contents of this section are held in memory pointed to
. by the contents field. This is checked by
. bfd_get_section_contents, and the data is retrieved from
. memory if appropriate. *}
.#define SEC_IN_MEMORY 0x20000
.
. {* End of section flags. *}
.
. {* The virtual memory address of the section - where it will be
@ -326,7 +332,9 @@ CODE_FRAGMENT
.
. PTR userdata;
.
. struct lang_output_section *otheruserdata;
. {* If the SEC_IN_MEMORY flag is set, this points to the actual
. contents. *}
. unsigned char *contents;
.
. {* Attached line number information *}
.
@ -395,12 +403,13 @@ CODE_FRAGMENT
/* These symbols are global, not specific to any BFD. Therefore, anything
that tries to change them is broken, and should be repaired. */
static CONST asymbol global_syms[] = {
/* the_bfd, name, value, attr, section [, udata] */
{ 0, BFD_COM_SECTION_NAME, 0, BSF_SECTION_SYM, &bfd_com_section },
{ 0, BFD_UND_SECTION_NAME, 0, BSF_SECTION_SYM, &bfd_und_section },
{ 0, BFD_ABS_SECTION_NAME, 0, BSF_SECTION_SYM, &bfd_abs_section },
{ 0, BFD_IND_SECTION_NAME, 0, BSF_SECTION_SYM, &bfd_ind_section },
static CONST asymbol global_syms[] =
{
/* the_bfd, name, value, attr, section [, udata] */
{0, BFD_COM_SECTION_NAME, 0, BSF_SECTION_SYM, &bfd_com_section},
{0, BFD_UND_SECTION_NAME, 0, BSF_SECTION_SYM, &bfd_und_section},
{0, BFD_ABS_SECTION_NAME, 0, BSF_SECTION_SYM, &bfd_abs_section},
{0, BFD_IND_SECTION_NAME, 0, BSF_SECTION_SYM, &bfd_ind_section},
};
#define STD_SECTION(SEC, FLAGS, SYM, NAME, IDX) \
@ -444,14 +453,15 @@ DESCRIPTION
*/
asection *
DEFUN(bfd_get_section_by_name,(abfd, name),
bfd *abfd AND
CONST char *name)
bfd_get_section_by_name (abfd, name)
bfd *abfd;
CONST char *name;
{
asection *sect;
for (sect = abfd->sections; sect != NULL; sect = sect->next)
if (!strcmp (sect->name, name)) return sect;
if (!strcmp (sect->name, name))
return sect;
return NULL;
}
@ -483,14 +493,14 @@ DESCRIPTION
asection *
DEFUN(bfd_make_section_old_way,(abfd, name),
bfd *abfd AND
CONST char * name)
bfd_make_section_old_way (abfd, name)
bfd *abfd;
CONST char *name;
{
asection *sec = bfd_get_section_by_name(abfd, name);
if (sec == (asection *)NULL)
asection *sec = bfd_get_section_by_name (abfd, name);
if (sec == (asection *) NULL)
{
sec = bfd_make_section(abfd, name);
sec = bfd_make_section (abfd, name);
}
return sec;
}
@ -519,7 +529,7 @@ bfd_make_section_anyway (abfd, name)
{
asection *newsect;
asection **prev = &abfd->sections;
asection * sect = abfd->sections;
asection *sect = abfd->sections;
if (abfd->output_has_begun)
{
@ -527,32 +537,35 @@ bfd_make_section_anyway (abfd, name)
return NULL;
}
while (sect) {
prev = &sect->next;
sect = sect->next;
}
while (sect)
{
prev = &sect->next;
sect = sect->next;
}
newsect = (asection *) bfd_zalloc(abfd, sizeof (asection));
if (newsect == NULL) {
bfd_set_error (bfd_error_no_memory);
return NULL;
}
newsect = (asection *) bfd_zalloc (abfd, sizeof (asection));
if (newsect == NULL)
{
bfd_set_error (bfd_error_no_memory);
return NULL;
}
newsect->name = name;
newsect->index = abfd->section_count++;
newsect->flags = SEC_NO_FLAGS;
newsect->userdata = 0;
newsect->next = (asection *)NULL;
newsect->relocation = (arelent *)NULL;
newsect->userdata = NULL;
newsect->contents = NULL;
newsect->next = (asection *) NULL;
newsect->relocation = (arelent *) NULL;
newsect->reloc_count = 0;
newsect->line_filepos =0;
newsect->line_filepos = 0;
newsect->owner = abfd;
/* Create a symbol whos only job is to point to this section. This is
useful for things like relocs which are relative to the base of a
section. */
newsect->symbol = bfd_make_empty_symbol(abfd);
newsect->symbol = bfd_make_empty_symbol (abfd);
if (!newsect)
return NULL;
newsect->symbol->name = name;
@ -562,10 +575,11 @@ bfd_make_section_anyway (abfd, name)
newsect->symbol_ptr_ptr = &newsect->symbol;
if (BFD_SEND (abfd, _new_section_hook, (abfd, newsect)) != true) {
free (newsect);
return NULL;
}
if (BFD_SEND (abfd, _new_section_hook, (abfd, newsect)) != true)
{
free (newsect);
return NULL;
}
*prev = newsect;
return newsect;
@ -586,34 +600,36 @@ DESCRIPTION
*/
sec_ptr
DEFUN(bfd_make_section,(abfd, name),
bfd *abfd AND
CONST char * name)
bfd_make_section (abfd, name)
bfd *abfd;
CONST char *name;
{
asection * sect = abfd->sections;
asection *sect = abfd->sections;
if (strcmp(name, BFD_ABS_SECTION_NAME) == 0)
{
return &bfd_abs_section;
}
if (strcmp(name, BFD_COM_SECTION_NAME) == 0)
{
return &bfd_com_section;
}
if (strcmp(name, BFD_UND_SECTION_NAME) == 0)
{
return &bfd_und_section;
}
if (strcmp (name, BFD_ABS_SECTION_NAME) == 0)
{
return &bfd_abs_section;
}
if (strcmp (name, BFD_COM_SECTION_NAME) == 0)
{
return &bfd_com_section;
}
if (strcmp (name, BFD_UND_SECTION_NAME) == 0)
{
return &bfd_und_section;
}
if (strcmp(name, BFD_IND_SECTION_NAME) == 0)
{
return &bfd_ind_section;
}
if (strcmp (name, BFD_IND_SECTION_NAME) == 0)
{
return &bfd_ind_section;
}
while (sect) {
if (!strcmp(sect->name, name)) return NULL;
sect = sect->next;
}
while (sect)
{
if (!strcmp (sect->name, name))
return NULL;
sect = sect->next;
}
/* The name is not already used; go ahead and make a new section. */
return bfd_make_section_anyway (abfd, name);
@ -641,10 +657,10 @@ DESCRIPTION
/*ARGSUSED*/
boolean
DEFUN(bfd_set_section_flags,(abfd, section, flags),
bfd *abfd AND
sec_ptr section AND
flagword flags)
bfd_set_section_flags (abfd, section, flags)
bfd *abfd;
sec_ptr section;
flagword flags;
{
#if 0
/* If you try to copy a text section from an input file (where it
@ -652,10 +668,11 @@ DEFUN(bfd_set_section_flags,(abfd, section, flags),
the bfd_applicable_section_flags (abfd) doesn't have the SEC_CODE
set - which it doesn't, at least not for a.out. FIXME */
if ((flags & bfd_applicable_section_flags (abfd)) != flags) {
bfd_set_error (bfd_error_invalid_operation);
return false;
}
if ((flags & bfd_applicable_section_flags (abfd)) != flags)
{
bfd_set_error (bfd_error_invalid_operation);
return false;
}
#endif
section->flags = flags;
@ -693,10 +710,10 @@ DESCRIPTION
/*VARARGS2*/
void
DEFUN(bfd_map_over_sections,(abfd, operation, user_storage),
bfd *abfd AND
void (*operation) PARAMS ((bfd *abfd, asection *sect, PTR obj)) AND
PTR user_storage)
bfd_map_over_sections (abfd, operation, user_storage)
bfd *abfd;
void (*operation) PARAMS ((bfd * abfd, asection * sect, PTR obj));
PTR user_storage;
{
asection *sect;
int i = 0;
@ -704,8 +721,8 @@ DEFUN(bfd_map_over_sections,(abfd, operation, user_storage),
for (sect = abfd->sections; sect != NULL; i++, sect = sect->next)
(*operation) (abfd, sect, user_storage);
if (i != abfd->section_count) /* Debugging */
abort();
if (i != abfd->section_count) /* Debugging */
abort ();
}
@ -727,18 +744,19 @@ DESCRIPTION
*/
boolean
DEFUN(bfd_set_section_size,(abfd, ptr, val),
bfd *abfd AND
sec_ptr ptr AND
bfd_size_type val)
bfd_set_section_size (abfd, ptr, val)
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. */
if (abfd->output_has_begun) {
bfd_set_error (bfd_error_invalid_operation);
return false;
}
if (abfd->output_has_begun)
{
bfd_set_error (bfd_error_invalid_operation);
return false;
}
ptr->_cooked_size = val;
ptr->_raw_size = val;
@ -786,20 +804,20 @@ DESCRIPTION
: bfd_get_section_size_before_reloc (sec))
boolean
DEFUN(bfd_set_section_contents,(abfd, section, location, offset, count),
bfd *abfd AND
sec_ptr section AND
PTR location AND
file_ptr offset AND
bfd_size_type count)
bfd_set_section_contents (abfd, section, location, offset, count)
bfd *abfd;
sec_ptr section;
PTR location;
file_ptr offset;
bfd_size_type count;
{
bfd_size_type sz;
if (!bfd_get_section_flags(abfd, section) & SEC_HAS_CONTENTS)
{
bfd_set_error (bfd_error_no_contents);
return(false);
}
if (!bfd_get_section_flags (abfd, section) & SEC_HAS_CONTENTS)
{
bfd_set_error (bfd_error_no_contents);
return (false);
}
if (offset < 0)
{
@ -815,28 +833,28 @@ DEFUN(bfd_set_section_contents,(abfd, section, location, offset, count),
switch (abfd->direction)
{
case read_direction:
case no_direction:
bfd_set_error (bfd_error_invalid_operation);
return false;
case read_direction:
case no_direction:
bfd_set_error (bfd_error_invalid_operation);
return false;
case write_direction:
break;
case write_direction:
break;
case both_direction:
/* File is opened for update. `output_has_begun' some time ago when
case both_direction:
/* File is opened for update. `output_has_begun' some time ago when
the file was created. Do not recompute sections sizes or alignments
in _bfd_set_section_content. */
abfd->output_has_begun = true;
break;
abfd->output_has_begun = true;
break;
}
if (BFD_SEND (abfd, _bfd_set_section_contents,
(abfd, section, location, offset, count)))
{
abfd->output_has_begun = true;
return true;
}
(abfd, section, location, offset, count)))
{
abfd->output_has_begun = true;
return true;
}
return false;
}
@ -866,18 +884,18 @@ DESCRIPTION
*/
boolean
DEFUN(bfd_get_section_contents,(abfd, section, location, offset, count),
bfd *abfd AND
sec_ptr section AND
PTR location AND
file_ptr offset AND
bfd_size_type count)
bfd_get_section_contents (abfd, section, location, offset, count)
bfd *abfd;
sec_ptr section;
PTR location;
file_ptr offset;
bfd_size_type count;
{
bfd_size_type sz;
if (section->flags & SEC_CONSTRUCTOR)
{
memset(location, 0, (unsigned)count);
memset (location, 0, (unsigned) count);
return true;
}
@ -899,7 +917,13 @@ DEFUN(bfd_get_section_contents,(abfd, section, location, offset, count),
if ((section->flags & SEC_HAS_CONTENTS) == 0)
{
memset(location, 0, (unsigned)count);
memset (location, 0, (unsigned) count);
return true;
}
if ((section->flags & SEC_IN_MEMORY) != 0)
{
memcpy (location, section->contents + offset, count);
return true;
}

View File

@ -127,7 +127,7 @@ static char hex_value[256];
/* Initialize by filling in the hex conversion array. */
static void
DEFUN_VOID (srec_init)
srec_init ()
{
unsigned int i;
static boolean inited = false;
@ -243,12 +243,12 @@ fillup_symbols (abfd, buf, len, val)
}
/*ARGSUSED*/
static void
DEFUN (size_srec, (abfd, section, address, raw, length),
bfd * abfd AND
asection * section AND
bfd_vma address AND
bfd_byte * raw AND
unsigned int length)
size_srec (abfd, section, address, raw, length)
bfd *abfd;
asection *section;
bfd_vma address;
bfd_byte *raw;
unsigned int length;
{
if (address < low)
low = address;
@ -263,12 +263,12 @@ DEFUN (size_srec, (abfd, section, address, raw, length),
/*ARGSUSED*/
static void
DEFUN (fillup, (abfd, section, address, raw, length),
bfd * abfd AND
asection * section AND
bfd_vma address AND
bfd_byte * raw AND
unsigned int length)
fillup (abfd, section, address, raw, length)
bfd *abfd;
asection *section;
bfd_vma address;
bfd_byte *raw;
unsigned int length;
{
unsigned int i;
bfd_byte *dst =
@ -305,8 +305,8 @@ skipwhite (src, abfd)
}
static boolean
DEFUN (srec_mkobject, (abfd),
bfd * abfd)
srec_mkobject (abfd)
bfd *abfd;
{
if (abfd->tdata.srec_data == 0)
{
@ -480,8 +480,8 @@ object_p (abfd)
}
static bfd_target *
DEFUN (srec_object_p, (abfd),
bfd * abfd)
srec_object_p (abfd)
bfd *abfd;
{
char b[4];
@ -501,8 +501,8 @@ DEFUN (srec_object_p, (abfd),
static bfd_target *
DEFUN (symbolsrec_object_p, (abfd),
bfd * abfd)
symbolsrec_object_p (abfd)
bfd *abfd;
{
char b[4];
@ -519,12 +519,12 @@ DEFUN (symbolsrec_object_p, (abfd),
static boolean
DEFUN (srec_get_section_contents, (abfd, section, location, offset, count),
bfd * abfd AND
asection * section AND
PTR location AND
file_ptr offset AND
bfd_size_type count)
srec_get_section_contents (abfd, section, location, offset, count)
bfd *abfd;
asection *section;
PTR location;
file_ptr offset;
bfd_size_type count;
{
if (section->used_by_bfd == (PTR) NULL)
{
@ -538,18 +538,18 @@ DEFUN (srec_get_section_contents, (abfd, section, location, offset, count),
pass_over (abfd, fillup, fillup_symbols, section);
}
memcpy ((PTR) location,
(PTR) ((char *) (section->used_by_bfd) + offset),
count);
(PTR) ((char *) (section->used_by_bfd) + offset),
count);
return true;
}
boolean
DEFUN (srec_set_arch_mach, (abfd, arch, machine),
bfd * abfd AND
enum bfd_architecture arch AND
unsigned long machine)
srec_set_arch_mach (abfd, arch, machine)
bfd *abfd;
enum bfd_architecture arch;
unsigned long machine;
{
return bfd_default_set_arch_mach (abfd, arch, machine);
}
@ -559,16 +559,16 @@ DEFUN (srec_set_arch_mach, (abfd, arch, machine),
also remember */
static boolean
DEFUN (srec_set_section_contents, (abfd, section, location, offset, bytes_to_do),
bfd * abfd AND
sec_ptr section AND
PTR location AND
file_ptr offset AND
bfd_size_type bytes_to_do)
srec_set_section_contents (abfd, section, location, offset, bytes_to_do)
bfd *abfd;
sec_ptr section;
PTR location;
file_ptr offset;
bfd_size_type bytes_to_do;
{
tdata_type *tdata = abfd->tdata.srec_data;
srec_data_list_type *entry = (srec_data_list_type *)
bfd_alloc (abfd, sizeof (srec_data_list_type));
bfd_alloc (abfd, sizeof (srec_data_list_type));
if (!entry)
{
@ -616,12 +616,12 @@ DEFUN (srec_set_section_contents, (abfd, section, location, offset, bytes_to_do)
*/
static
void
DEFUN (srec_write_record, (abfd, type, address, data, end),
bfd * abfd AND
char type AND
bfd_vma address AND
CONST unsigned char *data AND
CONST unsigned char *end)
srec_write_record (abfd, type, address, data, end)
bfd *abfd;
char type;
bfd_vma address;
CONST unsigned char *data;
CONST unsigned char *end;
{
char buffer[MAXCHUNK];
@ -679,8 +679,8 @@ DEFUN (srec_write_record, (abfd, type, address, data, end),
static void
DEFUN (srec_write_header, (abfd),
bfd * abfd)
srec_write_header (abfd)
bfd *abfd;
{
unsigned char buffer[MAXCHUNK];
unsigned char *dst = buffer;
@ -695,10 +695,10 @@ DEFUN (srec_write_header, (abfd),
}
static void
DEFUN (srec_write_section, (abfd, tdata, list),
bfd * abfd AND
tdata_type * tdata AND
srec_data_list_type * list)
srec_write_section (abfd, tdata, list)
bfd *abfd;
tdata_type *tdata;
srec_data_list_type *list;
{
unsigned int bytes_written = 0;
unsigned char *location = list->data;
@ -729,9 +729,9 @@ DEFUN (srec_write_section, (abfd, tdata, list),
}
static void
DEFUN (srec_write_terminator, (abfd, tdata),
bfd * abfd AND
tdata_type * tdata)
srec_write_terminator (abfd, tdata)
bfd *abfd;
tdata_type *tdata;
{
unsigned char buffer[2];
@ -842,16 +842,16 @@ symbolsrec_write_object_contents (abfd)
/*ARGSUSED*/
static int
DEFUN (srec_sizeof_headers, (abfd, exec),
bfd * abfd AND
boolean exec)
srec_sizeof_headers (abfd, exec)
bfd *abfd;
boolean exec;
{
return 0;
}
static asymbol *
DEFUN (srec_make_empty_symbol, (abfd),
bfd * abfd)
srec_make_empty_symbol (abfd)
bfd *abfd;
{
asymbol *new = (asymbol *) bfd_zalloc (abfd, sizeof (asymbol));
if (new)
@ -869,9 +869,9 @@ srec_get_symtab_upper_bound (abfd)
}
static unsigned int
DEFUN (srec_get_symtab, (abfd, alocation),
bfd * abfd AND
asymbol ** alocation)
srec_get_symtab (abfd, alocation)
bfd *abfd;
asymbol **alocation;
{
int lim = abfd->symcount;
int i;
@ -885,21 +885,21 @@ DEFUN (srec_get_symtab, (abfd, alocation),
/*ARGSUSED*/
void
DEFUN (srec_get_symbol_info, (ignore_abfd, symbol, ret),
bfd * ignore_abfd AND
asymbol * symbol AND
symbol_info * ret)
srec_get_symbol_info (ignore_abfd, symbol, ret)
bfd *ignore_abfd;
asymbol *symbol;
symbol_info *ret;
{
bfd_symbol_info (symbol, ret);
}
/*ARGSUSED*/
void
DEFUN (srec_print_symbol, (ignore_abfd, afile, symbol, how),
bfd * ignore_abfd AND
PTR afile AND
asymbol * symbol AND
bfd_print_symbol_type how)
srec_print_symbol (ignore_abfd, afile, symbol, how)
bfd *ignore_abfd;
PTR afile;
asymbol *symbol;
bfd_print_symbol_type how;
{
FILE *file = (FILE *) afile;
switch (how)

View File

@ -71,7 +71,7 @@ SUBSECTION
| if (storage_needed == 0) {
| return ;
| }
| symbol_table = (asymbol **) bfd_xmalloc (storage_needed);
| symbol_table = (asymbol **) xmalloc (storage_needed);
| ...
| number_of_symbols =
| bfd_canonicalize_symtab (abfd, symbol_table);
@ -333,10 +333,11 @@ bfd_set_symtab (abfd, location, symcount)
asymbol **location;
unsigned int symcount;
{
if ((abfd->format != bfd_object) || (bfd_read_p (abfd))) {
bfd_error = invalid_operation;
return false;
}
if ((abfd->format != bfd_object) || (bfd_read_p (abfd)))
{
bfd_set_error (bfd_error_invalid_operation);
return false;
}
bfd_get_outsymbols (abfd) = location;
bfd_get_symcount (abfd) = symcount;
@ -355,32 +356,32 @@ DESCRIPTION
stream @var{file}.
*/
void
DEFUN(bfd_print_symbol_vandf,(arg, symbol),
PTR arg AND
asymbol *symbol)
bfd_print_symbol_vandf (arg, symbol)
PTR arg;
asymbol *symbol;
{
FILE *file = (FILE *) arg;
flagword type = symbol->flags;
if (symbol->section != (asection *)NULL)
{
fprintf_vma(file, symbol->value+symbol->section->vma);
}
if (symbol->section != (asection *) NULL)
{
fprintf_vma (file, symbol->value + symbol->section->vma);
}
else
{
fprintf_vma(file, symbol->value);
}
{
fprintf_vma (file, symbol->value);
}
/* This presumes that a symbol can not be both BSF_DEBUGGING and
BSF_DYNAMIC. */
fprintf(file," %c%c%c%c%c%c%c",
(type & BSF_LOCAL) ? 'l':' ',
(type & BSF_GLOBAL) ? 'g' : ' ',
(type & BSF_WEAK) ? 'w' : ' ',
(type & BSF_CONSTRUCTOR) ? 'C' : ' ',
(type & BSF_WARNING) ? 'W' : ' ',
(type & BSF_INDIRECT) ? 'I' : ' ',
(type & BSF_DEBUGGING) ? 'd'
: (type & BSF_DYNAMIC) ? 'D' : ' ');
fprintf (file, " %c%c%c%c%c%c%c",
(type & BSF_LOCAL) ? 'l' : ' ',
(type & BSF_GLOBAL) ? 'g' : ' ',
(type & BSF_WEAK) ? 'w' : ' ',
(type & BSF_CONSTRUCTOR) ? 'C' : ' ',
(type & BSF_WARNING) ? 'W' : ' ',
(type & BSF_INDIRECT) ? 'I' : ' ',
(type & BSF_DEBUGGING) ? 'd'
: (type & BSF_DYNAMIC) ? 'D' : ' ');
}
@ -423,7 +424,8 @@ struct section_to_type
/* Map section names to POSIX/BSD single-character symbol types.
This table is probably incomplete. It is sorted for convenience of
adding entries. Since it is so short, a linear search is used. */
static CONST struct section_to_type stt[] = {
static CONST struct section_to_type stt[] =
{
{"*DEBUG*", 'N'},
{".bss", 'b'},
{".data", 'd'},
@ -468,8 +470,8 @@ SYNOPSIS
int bfd_decode_symclass(asymbol *symbol);
*/
int
DEFUN(bfd_decode_symclass,(symbol),
asymbol *symbol)
bfd_decode_symclass (symbol)
asymbol *symbol;
{
char c;
@ -479,7 +481,7 @@ asymbol *symbol)
return 'U';
if (symbol->section == &bfd_ind_section)
return 'I';
if (!(symbol->flags & (BSF_GLOBAL|BSF_LOCAL)))
if (!(symbol->flags & (BSF_GLOBAL | BSF_LOCAL)))
return '?';
if (symbol->section == &bfd_abs_section)
@ -516,21 +518,20 @@ SYNOPSIS
*/
void
DEFUN(bfd_symbol_info,(symbol, ret),
asymbol *symbol AND
symbol_info *ret)
bfd_symbol_info (symbol, ret)
asymbol *symbol;
symbol_info *ret;
{
ret->type = bfd_decode_symclass (symbol);
if (ret->type != 'U')
ret->value = symbol->value+symbol->section->vma;
ret->value = symbol->value + symbol->section->vma;
else
ret->value = 0;
ret->name = symbol->name;
}
void
bfd_symbol_is_absolute()
bfd_symbol_is_absolute ()
{
abort();
abort ();
}

View File

@ -621,9 +621,9 @@ DESCRIPTION
*/
bfd_target *
DEFUN(bfd_find_target,(target_name, abfd),
CONST char *target_name AND
bfd *abfd)
bfd_find_target (target_name, abfd)
CONST char *target_name;
bfd *abfd;
{
bfd_target **target;
extern char *getenv ();
@ -663,7 +663,7 @@ DESCRIPTION
*/
CONST char **
DEFUN_VOID(bfd_target_list)
bfd_target_list ()
{
int vec_length= 0;
#ifdef NATIVE_HPPAHPUX_COMPILER