(bfd_getb32, bfd_getl32, bfd_getb16, bfd_getl16): Likewise.
(bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
(bfd_getb_signed_32, bfd_getl_signed_32): Likewise.
(bfd_getb_signed_16, bfd_getl_signed_16): Likewise.
(bfd_putb64, bfd_putl64, bfd_putb32, bfd_putl32): Likewise.
(bfd_putb16, bfd_putl16, bfd_get_bits, bfd_put_bits): Likewise.
* libbfd.c: Likewise in function definitions.
(bfd_put_8): Mask with 0xff rather than casting to char.
(bfd_putb16, bfd_putl16, bfd_putb32, bfd_putl32): Likewise.
(bfd_putb64, bfd_putl64, bfd_put_bits): Likewise.
(H_PUT_64, H_PUT_32, H_PUT_16, H_PUT_8): Remove casts, simplify.
(H_PUT_S64, H_PUT_S32, H_PUT_S16, H_PUT_S8): Likewise.
(H_GET_64, H_GET_32, H_GET_16, H_GET_8): Likewise.
(H_GET_S64, H_GET_S32, H_GET_S16, H_GET_S8): Likewise.
* libaout.h (H_PUT_64 H_PUT_32, H_PUT_16): Remove casts, simplify.
(H_PUT_S64, H_PUT_S32, H_PUT_S16): Likewise.
(H_GET_64, H_GET_32, H_GET_16): Likewise.
(H_GET_S64, H_GET_S32, H_GET_S16): Likewise.
* archive.c (do_slurp_coff_armap): Update swap prototype.
* coff-tic54x.c (tic54x_getl32): Replace bfd_byte* with void*.
(tic54x_getl_signed_32): Likewise.
(tic54x_putl32): Likewise. Mask with 0xff rather than casting to char.
* mach-o.c (bfd_mach_o_read_header): Update get32 prototype.
* pdp11.c (bfd_getp32): Make static, replace bfd_byte* with void*.
(bfd_getp_signed_32, bfd_putp32): Likewise.
* targets.c (struct bfd_target): Use void* in place of bfd_byte* for
bfd_getx64, bfd_getx_signed_64, bfd_putx64, bfd_getx32,
bfd_getx_signed_32, bfd_putx32, bfd_getx16, bfd_getx_signed_16,
bfd_putx16, bfd_h_getx64, bfd_h_getx_signed_64, bfd_h_putx64,
bfd_h_getx32, bfd_h_getx_signed_32, bfd_h_putx32, bfd_h_getx16,
bfd_h_getx_signed_16, bfd_h_putx16.
* aix386-core.c (NO_GET, NO_GETS, NO_PUT): Update prototypes.
* hppabsd-core.c: Similarly. Rename NO_SIGNED_GET to NO_GETS.
* hpux-core.c: Likewise.
* irix-core.c: Likewise.
* netbsd-core.c: Likewise.
* osf-core.c: Likewise.
* ptrace-core.c: Likewise.
* sco5-core.c: Likewise.
* trad-core.c: Likewise.
* bfd-in2.h: Regenerate.
+2004-03-15 Alan Modra <amodra@bigpond.net.au>
+
+ * bfd-in.h (bfd_getb64, bfd_getl64): Replace bfd_byte* with void*.
+ (bfd_getb32, bfd_getl32, bfd_getb16, bfd_getl16): Likewise.
+ (bfd_getb_signed_64, bfd_getl_signed_64): Likewise.
+ (bfd_getb_signed_32, bfd_getl_signed_32): Likewise.
+ (bfd_getb_signed_16, bfd_getl_signed_16): Likewise.
+ (bfd_putb64, bfd_putl64, bfd_putb32, bfd_putl32): Likewise.
+ (bfd_putb16, bfd_putl16, bfd_get_bits, bfd_put_bits): Likewise.
+ * libbfd.c: Likewise in function definitions.
+ (bfd_put_8): Mask with 0xff rather than casting to char.
+ (bfd_putb16, bfd_putl16, bfd_putb32, bfd_putl32): Likewise.
+ (bfd_putb64, bfd_putl64, bfd_put_bits): Likewise.
+ (H_PUT_64, H_PUT_32, H_PUT_16, H_PUT_8): Remove casts, simplify.
+ (H_PUT_S64, H_PUT_S32, H_PUT_S16, H_PUT_S8): Likewise.
+ (H_GET_64, H_GET_32, H_GET_16, H_GET_8): Likewise.
+ (H_GET_S64, H_GET_S32, H_GET_S16, H_GET_S8): Likewise.
+ * libaout.h (H_PUT_64 H_PUT_32, H_PUT_16): Remove casts, simplify.
+ (H_PUT_S64, H_PUT_S32, H_PUT_S16): Likewise.
+ (H_GET_64, H_GET_32, H_GET_16): Likewise.
+ (H_GET_S64, H_GET_S32, H_GET_S16): Likewise.
+ * archive.c (do_slurp_coff_armap): Update swap prototype.
+ * coff-tic54x.c (tic54x_getl32): Replace bfd_byte* with void*.
+ (tic54x_getl_signed_32): Likewise.
+ (tic54x_putl32): Likewise. Mask with 0xff rather than casting to char.
+ * mach-o.c (bfd_mach_o_read_header): Update get32 prototype.
+ * pdp11.c (bfd_getp32): Make static, replace bfd_byte* with void*.
+ (bfd_getp_signed_32, bfd_putp32): Likewise.
+ * targets.c (struct bfd_target): Use void* in place of bfd_byte* for
+ bfd_getx64, bfd_getx_signed_64, bfd_putx64, bfd_getx32,
+ bfd_getx_signed_32, bfd_putx32, bfd_getx16, bfd_getx_signed_16,
+ bfd_putx16, bfd_h_getx64, bfd_h_getx_signed_64, bfd_h_putx64,
+ bfd_h_getx32, bfd_h_getx_signed_32, bfd_h_putx32, bfd_h_getx16,
+ bfd_h_getx_signed_16, bfd_h_putx16.
+ * aix386-core.c (NO_GET, NO_GETS, NO_PUT): Update prototypes.
+ * hppabsd-core.c: Similarly. Rename NO_SIGNED_GET to NO_GETS.
+ * hpux-core.c: Likewise.
+ * irix-core.c: Likewise.
+ * netbsd-core.c: Likewise.
+ * osf-core.c: Likewise.
+ * ptrace-core.c: Likewise.
+ * sco5-core.c: Likewise.
+ * trad-core.c: Likewise.
+ * bfd-in2.h: Regenerate.
+
2004-03-15 Matt Thomas <matt@3am-software.com>
* config.bfd: Add x86-64 vector to NetBSD/i386 if 64bit BFD is
This was based on trad-core.c, which was written by John Gilmore of
Cygnus Support.
Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1996, 1998, 1999, 2000,
- 2001, 2002
+ 2001, 2002, 2004
Free Software Foundation, Inc.
Written by Minh Tran-Le <TRANLE@INTELLICORP.COM>.
Converted to back end form by Ian Lance Taylor <ian@cygnus.com>.
abort ();
}
-#define NO_GET ((bfd_vma (*) PARAMS ((const bfd_byte *))) swap_abort)
-#define NO_GETS ((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort)
-#define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort)
+#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
+#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
+#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
const bfd_target aix386_core_vec = {
"aix386-core",
unsigned int parsed_size;
carsym *carsyms;
bfd_size_type nsymz; /* Number of symbols in armap. */
- bfd_vma (*swap) (const bfd_byte *);
+ bfd_vma (*swap) (const void *);
char int_buf[sizeof (long)];
bfd_size_type carsym_size, ptrsize;
unsigned int i;
/* Byte swapping routines. */
-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 *);
+bfd_vma bfd_getb64 (const void *);
+bfd_vma bfd_getl64 (const void *);
+bfd_signed_vma bfd_getb_signed_64 (const void *);
+bfd_signed_vma bfd_getl_signed_64 (const void *);
+bfd_vma bfd_getb32 (const void *);
+bfd_vma bfd_getl32 (const void *);
+bfd_signed_vma bfd_getb_signed_32 (const void *);
+bfd_signed_vma bfd_getl_signed_32 (const void *);
+bfd_vma bfd_getb16 (const void *);
+bfd_vma bfd_getl16 (const void *);
+bfd_signed_vma bfd_getb_signed_16 (const void *);
+bfd_signed_vma bfd_getl_signed_16 (const void *);
+void bfd_putb64 (bfd_vma, void *);
+void bfd_putl64 (bfd_vma, void *);
+void bfd_putb32 (bfd_vma, void *);
+void bfd_putl32 (bfd_vma, void *);
+void bfd_putb16 (bfd_vma, void *);
+void bfd_putl16 (bfd_vma, void *);
/* Byte swapping routines which take size and endiannes as arguments. */
-bfd_vma bfd_get_bits (bfd_byte *, int, bfd_boolean);
-void bfd_put_bits (bfd_vma, bfd_byte *, int, bfd_boolean);
+bfd_vma bfd_get_bits (const void *, int, bfd_boolean);
+void bfd_put_bits (bfd_vma, void *, int, bfd_boolean);
\f
/* Externally visible ECOFF routines. */
/* Byte swapping routines. */
-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 *);
+bfd_vma bfd_getb64 (const void *);
+bfd_vma bfd_getl64 (const void *);
+bfd_signed_vma bfd_getb_signed_64 (const void *);
+bfd_signed_vma bfd_getl_signed_64 (const void *);
+bfd_vma bfd_getb32 (const void *);
+bfd_vma bfd_getl32 (const void *);
+bfd_signed_vma bfd_getb_signed_32 (const void *);
+bfd_signed_vma bfd_getl_signed_32 (const void *);
+bfd_vma bfd_getb16 (const void *);
+bfd_vma bfd_getl16 (const void *);
+bfd_signed_vma bfd_getb_signed_16 (const void *);
+bfd_signed_vma bfd_getl_signed_16 (const void *);
+void bfd_putb64 (bfd_vma, void *);
+void bfd_putl64 (bfd_vma, void *);
+void bfd_putb32 (bfd_vma, void *);
+void bfd_putl32 (bfd_vma, void *);
+void bfd_putb16 (bfd_vma, void *);
+void bfd_putl16 (bfd_vma, void *);
/* Byte swapping routines which take size and endiannes as arguments. */
-bfd_vma bfd_get_bits (bfd_byte *, int, bfd_boolean);
-void bfd_put_bits (bfd_vma, bfd_byte *, int, bfd_boolean);
+bfd_vma bfd_get_bits (const void *, int, bfd_boolean);
+void bfd_put_bits (bfd_vma, void *, int, bfd_boolean);
\f
/* Externally visible ECOFF routines. */
/* 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)) = (val) & 0xff))
#define bfd_put_signed_8 \
bfd_put_8
#define bfd_get_8(abfd, ptr) \
#define bfd_h_get_signed_64(abfd, ptr) \
BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
-/* Refinements on the above, which should eventually go away. Save
- cluttering the source with (bfd_vma) and (bfd_byte *) casts. */
-
-#define H_PUT_64(abfd, val, where) \
- bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
-
-#define H_PUT_32(abfd, val, where) \
- bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
-
-#define H_PUT_16(abfd, val, where) \
- bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
-
-#define H_PUT_8 bfd_h_put_8
-
-#define H_PUT_S64(abfd, val, where) \
- bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
-
-#define H_PUT_S32(abfd, val, where) \
- bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
-
-#define H_PUT_S16(abfd, val, where) \
- bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
-
-#define H_PUT_S8 bfd_h_put_signed_8
-
-#define H_GET_64(abfd, where) \
- bfd_h_get_64 ((abfd), (bfd_byte *) (where))
-
-#define H_GET_32(abfd, where) \
- bfd_h_get_32 ((abfd), (bfd_byte *) (where))
-
-#define H_GET_16(abfd, where) \
- bfd_h_get_16 ((abfd), (bfd_byte *) (where))
-
-#define H_GET_8 bfd_h_get_8
-
-#define H_GET_S64(abfd, where) \
- bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where))
-
-#define H_GET_S32(abfd, where) \
- bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where))
-
-#define H_GET_S16(abfd, where) \
- bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where))
-
-#define H_GET_S8 bfd_h_get_signed_8
+/* Aliases for the above, which should eventually go away. */
+
+#define H_PUT_64 bfd_h_put_64
+#define H_PUT_32 bfd_h_put_32
+#define H_PUT_16 bfd_h_put_16
+#define H_PUT_8 bfd_h_put_8
+#define H_PUT_S64 bfd_h_put_signed_64
+#define H_PUT_S32 bfd_h_put_signed_32
+#define H_PUT_S16 bfd_h_put_signed_16
+#define H_PUT_S8 bfd_h_put_signed_8
+#define H_GET_64 bfd_h_get_64
+#define H_GET_32 bfd_h_get_32
+#define H_GET_16 bfd_h_get_16
+#define H_GET_8 bfd_h_get_8
+#define H_GET_S64 bfd_h_get_signed_64
+#define H_GET_S32 bfd_h_get_signed_32
+#define H_GET_S16 bfd_h_get_signed_16
+#define H_GET_S8 bfd_h_get_signed_8
/* Extracted from bfdio.c. */
/* 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) (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 *);
+ bfd_vma (*bfd_getx64) (const void *);
+ bfd_signed_vma (*bfd_getx_signed_64) (const void *);
+ void (*bfd_putx64) (bfd_vma, void *);
+ bfd_vma (*bfd_getx32) (const void *);
+ bfd_signed_vma (*bfd_getx_signed_32) (const void *);
+ void (*bfd_putx32) (bfd_vma, void *);
+ bfd_vma (*bfd_getx16) (const void *);
+ bfd_signed_vma (*bfd_getx_signed_16) (const void *);
+ void (*bfd_putx16) (bfd_vma, void *);
/* Byte swapping for the headers. */
- 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 *);
+ bfd_vma (*bfd_h_getx64) (const void *);
+ bfd_signed_vma (*bfd_h_getx_signed_64) (const void *);
+ void (*bfd_h_putx64) (bfd_vma, void *);
+ bfd_vma (*bfd_h_getx32) (const void *);
+ bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
+ void (*bfd_h_putx32) (bfd_vma, void *);
+ bfd_vma (*bfd_h_getx16) (const void *);
+ bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
+ void (*bfd_h_putx16) (bfd_vma, void *);
/* Format dependent routines: these are vectors of entry points
within the target vector structure, one for each format to check. */
PARAMS ((bfd *, sec_ptr, const PTR, file_ptr, bfd_size_type));
static reloc_howto_type *coff_tic54x_rtype_to_howto
PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *));
-static bfd_vma tic54x_getl32
- PARAMS ((const bfd_byte *));
-static void tic54x_putl32
- PARAMS ((bfd_vma, bfd_byte *));
-static bfd_signed_vma tic54x_getl_signed_32
- PARAMS ((const bfd_byte *));
static bfd_boolean tic54x_set_arch_mach
PARAMS ((bfd *, enum bfd_architecture, unsigned long));
static reloc_howto_type * tic54x_coff_reloc_type_lookup
Don't bother with 64-bits, as there aren't any. */
static bfd_vma
-tic54x_getl32 (addr)
- const bfd_byte *addr;
+tic54x_getl32 (const void *p)
{
+ const bfd_byte *addr = p;
unsigned long v;
v = (unsigned long) addr[2];
v |= (unsigned long) addr[3] << 8;
v |= (unsigned long) addr[0] << 16;
v |= (unsigned long) addr[1] << 24;
- return (bfd_vma) v;
+ return v;
}
static void
-tic54x_putl32 (data, addr)
- bfd_vma data;
- bfd_byte *addr;
+tic54x_putl32 (bfd_vma data, void *p)
{
- addr[2] = (bfd_byte)data;
- addr[3] = (bfd_byte) (data >> 8);
- addr[0] = (bfd_byte) (data >> 16);
- addr[1] = (bfd_byte) (data >> 24);
+ bfd_byte *addr = p;
+ addr[2] = data & 0xff;
+ addr[3] = (data >> 8) & 0xff;
+ addr[0] = (data >> 16) & 0xff;
+ addr[1] = (data >> 24) & 0xff;
}
-bfd_signed_vma
-tic54x_getl_signed_32 (addr)
- register const bfd_byte *addr;
+static bfd_signed_vma
+tic54x_getl_signed_32 (const void *p)
{
+ const bfd_byte *addr = p;
unsigned long v;
v = (unsigned long) addr[2];
/* BFD back-end for HPPA BSD core files.
- Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002
+ Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
abort ();
}
-#define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort )
-#define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort )
-#define NO_SIGNED_GET \
- ((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort )
+#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
+#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
+#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
const bfd_target hppabsd_core_vec =
{
0, /* symbol prefix */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit hdrs */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit hdrs */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 64 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 32 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 16 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 64 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 32 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 16 bit hdrs */
{ /* bfd_check_format */
_bfd_dummy_target, /* unknown format */
/* BFD back-end for HP/UX core files.
- Copyright 1993, 1994, 1996, 1998, 1999, 2001, 2002
+ Copyright 1993, 1994, 1996, 1998, 1999, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Stu Grossman, Cygnus Support.
Converted to back-end form by Ian Lance Taylor, Cygnus SUpport
{
abort(); /* This way doesn't require any declaration for ANSI to fuck up */
}
-#define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort )
-#define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort )
-#define NO_SIGNED_GET \
- ((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort )
+#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
+#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
+#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
const bfd_target hpux_core_vec =
{
0, /* symbol prefix */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit hdrs */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit hdrs */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 64 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 32 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 16 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 64 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 32 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 16 bit hdrs */
{ /* bfd_check_format */
_bfd_dummy_target, /* unknown format */
/* BFD back-end for Irix core files.
- Copyright 1993, 1994, 1996, 1999, 2001, 2002
+ Copyright 1993, 1994, 1996, 1999, 2001, 2002, 2004
Free Software Foundation, Inc.
Written by Stu Grossman, Cygnus Support.
Converted to back-end form by Ian Lance Taylor, Cygnus Support
{
abort(); /* This way doesn't require any declaration for ANSI to fuck up */
}
-#define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort )
-#define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort )
-#define NO_SIGNED_GET \
- ((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort )
+#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
+#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
+#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
const bfd_target irix_core_vec =
{
0, /* symbol prefix */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit hdrs */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit hdrs */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 64 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 32 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 16 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 64 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 32 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 16 bit hdrs */
{ /* bfd_check_format */
_bfd_dummy_target, /* unknown format */
#include "bfdlink.h"
-/* Macros for accessing components in an aout header. Saves cluttering
- the source with (bfd_vma) and (bfd_byte *) casts. */
-
-#define H_PUT_64(abfd, val, where) \
- bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
-
-#define H_PUT_32(abfd, val, where) \
- bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
-
-#define H_PUT_16(abfd, val, where) \
- bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
+/* Macros for accessing components in an aout header. */
+#define H_PUT_64 bfd_h_put_64
+#define H_PUT_32 bfd_h_put_32
+#define H_PUT_16 bfd_h_put_16
#define H_PUT_8 bfd_h_put_8
-
-#define H_PUT_S64(abfd, val, where) \
- bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
-
-#define H_PUT_S32(abfd, val, where) \
- bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
-
-#define H_PUT_S16(abfd, val, where) \
- bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
-
+#define H_PUT_S64 bfd_h_put_signed_64
+#define H_PUT_S32 bfd_h_put_signed_32
+#define H_PUT_S16 bfd_h_put_signed_16
#define H_PUT_S8 bfd_h_put_signed_8
-
-#define H_GET_64(abfd, where) \
- bfd_h_get_64 ((abfd), (bfd_byte *) (where))
-
-#define H_GET_32(abfd, where) \
- bfd_h_get_32 ((abfd), (bfd_byte *) (where))
-
-#define H_GET_16(abfd, where) \
- bfd_h_get_16 ((abfd), (bfd_byte *) (where))
-
+#define H_GET_64 bfd_h_get_64
+#define H_GET_32 bfd_h_get_32
+#define H_GET_16 bfd_h_get_16
#define H_GET_8 bfd_h_get_8
-
-#define H_GET_S64(abfd, where) \
- bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where))
-
-#define H_GET_S32(abfd, where) \
- bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where))
-
-#define H_GET_S16(abfd, where) \
- bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where))
-
+#define H_GET_S64 bfd_h_get_signed_64
+#define H_GET_S32 bfd_h_get_signed_32
+#define H_GET_S16 bfd_h_get_signed_16
#define H_GET_S8 bfd_h_get_signed_8
/* Parameterize the a.out code based on whether it is being built
/* Assorted BFD support routines, only used internally.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003
+ 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Cygnus Support.
.{* 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)) = (val) & 0xff))
.#define bfd_put_signed_8 \
. bfd_put_8
.#define bfd_get_8(abfd, ptr) \
.#define bfd_h_get_signed_64(abfd, ptr) \
. BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
.
-.{* Refinements on the above, which should eventually go away. Save
-. cluttering the source with (bfd_vma) and (bfd_byte *) casts. *}
+.{* Aliases for the above, which should eventually go away. *}
.
-.#define H_PUT_64(abfd, val, where) \
-. bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
-.
-.#define H_PUT_32(abfd, val, where) \
-. bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
-.
-.#define H_PUT_16(abfd, val, where) \
-. bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
-.
-.#define H_PUT_8 bfd_h_put_8
-.
-.#define H_PUT_S64(abfd, val, where) \
-. bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
-.
-.#define H_PUT_S32(abfd, val, where) \
-. bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
-.
-.#define H_PUT_S16(abfd, val, where) \
-. bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where))
-.
-.#define H_PUT_S8 bfd_h_put_signed_8
-.
-.#define H_GET_64(abfd, where) \
-. bfd_h_get_64 ((abfd), (bfd_byte *) (where))
-.
-.#define H_GET_32(abfd, where) \
-. bfd_h_get_32 ((abfd), (bfd_byte *) (where))
-.
-.#define H_GET_16(abfd, where) \
-. bfd_h_get_16 ((abfd), (bfd_byte *) (where))
-.
-.#define H_GET_8 bfd_h_get_8
-.
-.#define H_GET_S64(abfd, where) \
-. bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where))
-.
-.#define H_GET_S32(abfd, where) \
-. bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where))
-.
-.#define H_GET_S16(abfd, where) \
-. bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where))
-.
-.#define H_GET_S8 bfd_h_get_signed_8
+.#define H_PUT_64 bfd_h_put_64
+.#define H_PUT_32 bfd_h_put_32
+.#define H_PUT_16 bfd_h_put_16
+.#define H_PUT_8 bfd_h_put_8
+.#define H_PUT_S64 bfd_h_put_signed_64
+.#define H_PUT_S32 bfd_h_put_signed_32
+.#define H_PUT_S16 bfd_h_put_signed_16
+.#define H_PUT_S8 bfd_h_put_signed_8
+.#define H_GET_64 bfd_h_get_64
+.#define H_GET_32 bfd_h_get_32
+.#define H_GET_16 bfd_h_get_16
+.#define H_GET_8 bfd_h_get_8
+.#define H_GET_S64 bfd_h_get_signed_64
+.#define H_GET_S32 bfd_h_get_signed_32
+.#define H_GET_S16 bfd_h_get_signed_16
+.#define H_GET_S8 bfd_h_get_signed_8
.
.*/
(((bfd_signed_vma) (x) ^ EIGHT_GAZILLION) - EIGHT_GAZILLION)
bfd_vma
-bfd_getb16 (const bfd_byte *addr)
+bfd_getb16 (const void *p)
{
+ const bfd_byte *addr = p;
return (addr[0] << 8) | addr[1];
}
bfd_vma
-bfd_getl16 (const bfd_byte *addr)
+bfd_getl16 (const void *p)
{
+ const bfd_byte *addr = p;
return (addr[1] << 8) | addr[0];
}
bfd_signed_vma
-bfd_getb_signed_16 (const bfd_byte *addr)
+bfd_getb_signed_16 (const void *p)
{
+ const bfd_byte *addr = p;
return COERCE16 ((addr[0] << 8) | addr[1]);
}
bfd_signed_vma
-bfd_getl_signed_16 (const bfd_byte *addr)
+bfd_getl_signed_16 (const void *p)
{
+ const bfd_byte *addr = p;
return COERCE16 ((addr[1] << 8) | addr[0]);
}
void
-bfd_putb16 (bfd_vma data, bfd_byte *addr)
+bfd_putb16 (bfd_vma data, void *p)
{
- addr[0] = (bfd_byte) (data >> 8);
- addr[1] = (bfd_byte) data;
+ bfd_byte *addr = p;
+ addr[0] = (data >> 8) & 0xff;
+ addr[1] = data & 0xff;
}
void
-bfd_putl16 (bfd_vma data, bfd_byte *addr)
+bfd_putl16 (bfd_vma data, void *p)
{
- addr[0] = (bfd_byte) data;
- addr[1] = (bfd_byte) (data >> 8);
+ bfd_byte *addr = p;
+ addr[0] = data & 0xff;
+ addr[1] = (data >> 8) & 0xff;
}
bfd_vma
-bfd_getb32 (const bfd_byte *addr)
+bfd_getb32 (const void *p)
{
+ const bfd_byte *addr = p;
unsigned long v;
v = (unsigned long) addr[0] << 24;
}
bfd_vma
-bfd_getl32 (const bfd_byte *addr)
+bfd_getl32 (const void *p)
{
+ const bfd_byte *addr = p;
unsigned long v;
v = (unsigned long) addr[0];
}
bfd_signed_vma
-bfd_getb_signed_32 (const bfd_byte *addr)
+bfd_getb_signed_32 (const void *p)
{
+ const bfd_byte *addr = p;
unsigned long v;
v = (unsigned long) addr[0] << 24;
}
bfd_signed_vma
-bfd_getl_signed_32 (const bfd_byte *addr)
+bfd_getl_signed_32 (const void *p)
{
+ const bfd_byte *addr = p;
unsigned long v;
v = (unsigned long) addr[0];
}
bfd_vma
-bfd_getb64 (const bfd_byte *addr ATTRIBUTE_UNUSED)
+bfd_getb64 (const void *p ATTRIBUTE_UNUSED)
{
#ifdef BFD64
+ const bfd_byte *addr = p;
bfd_vma v;
v = addr[0]; v <<= 8;
}
bfd_vma
-bfd_getl64 (const bfd_byte *addr ATTRIBUTE_UNUSED)
+bfd_getl64 (const void *p ATTRIBUTE_UNUSED)
{
#ifdef BFD64
+ const bfd_byte *addr = p;
bfd_vma v;
v = addr[7]; v <<= 8;
}
bfd_signed_vma
-bfd_getb_signed_64 (addr)
- register const bfd_byte *addr ATTRIBUTE_UNUSED;
+bfd_getb_signed_64 (const void *p ATTRIBUTE_UNUSED)
{
#ifdef BFD64
+ const bfd_byte *addr = p;
bfd_vma v;
v = addr[0]; v <<= 8;
}
bfd_signed_vma
-bfd_getl_signed_64 (addr)
- register const bfd_byte *addr ATTRIBUTE_UNUSED;
+bfd_getl_signed_64 (const void *p ATTRIBUTE_UNUSED)
{
#ifdef BFD64
+ const bfd_byte *addr = p;
bfd_vma v;
v = addr[7]; v <<= 8;
}
void
-bfd_putb32 (bfd_vma data, bfd_byte *addr)
+bfd_putb32 (bfd_vma data, void *p)
{
- addr[0] = (bfd_byte) (data >> 24);
- addr[1] = (bfd_byte) (data >> 16);
- addr[2] = (bfd_byte) (data >> 8);
- addr[3] = (bfd_byte) data;
+ bfd_byte *addr = p;
+ addr[0] = (data >> 24) & 0xff;
+ addr[1] = (data >> 16) & 0xff;
+ addr[2] = (data >> 8) & 0xff;
+ addr[3] = data & 0xff;
}
void
-bfd_putl32 (bfd_vma data, bfd_byte *addr)
+bfd_putl32 (bfd_vma data, void *p)
{
- addr[0] = (bfd_byte) data;
- addr[1] = (bfd_byte) (data >> 8);
- addr[2] = (bfd_byte) (data >> 16);
- addr[3] = (bfd_byte) (data >> 24);
+ bfd_byte *addr = p;
+ addr[0] = data & 0xff;
+ addr[1] = (data >> 8) & 0xff;
+ addr[2] = (data >> 16) & 0xff;
+ addr[3] = (data >> 24) & 0xff;
}
void
-bfd_putb64 (bfd_vma data ATTRIBUTE_UNUSED, bfd_byte *addr ATTRIBUTE_UNUSED)
+bfd_putb64 (bfd_vma data ATTRIBUTE_UNUSED, void *p ATTRIBUTE_UNUSED)
{
#ifdef BFD64
- addr[0] = (bfd_byte) (data >> (7*8));
- addr[1] = (bfd_byte) (data >> (6*8));
- addr[2] = (bfd_byte) (data >> (5*8));
- addr[3] = (bfd_byte) (data >> (4*8));
- addr[4] = (bfd_byte) (data >> (3*8));
- addr[5] = (bfd_byte) (data >> (2*8));
- addr[6] = (bfd_byte) (data >> (1*8));
- addr[7] = (bfd_byte) (data >> (0*8));
+ bfd_byte *addr = p;
+ addr[0] = (data >> (7*8)) & 0xff;
+ addr[1] = (data >> (6*8)) & 0xff;
+ addr[2] = (data >> (5*8)) & 0xff;
+ addr[3] = (data >> (4*8)) & 0xff;
+ addr[4] = (data >> (3*8)) & 0xff;
+ addr[5] = (data >> (2*8)) & 0xff;
+ addr[6] = (data >> (1*8)) & 0xff;
+ addr[7] = (data >> (0*8)) & 0xff;
#else
BFD_FAIL();
#endif
}
void
-bfd_putl64 (bfd_vma data ATTRIBUTE_UNUSED, bfd_byte *addr ATTRIBUTE_UNUSED)
+bfd_putl64 (bfd_vma data ATTRIBUTE_UNUSED, void *p ATTRIBUTE_UNUSED)
{
#ifdef BFD64
- addr[7] = (bfd_byte) (data >> (7*8));
- addr[6] = (bfd_byte) (data >> (6*8));
- addr[5] = (bfd_byte) (data >> (5*8));
- addr[4] = (bfd_byte) (data >> (4*8));
- addr[3] = (bfd_byte) (data >> (3*8));
- addr[2] = (bfd_byte) (data >> (2*8));
- addr[1] = (bfd_byte) (data >> (1*8));
- addr[0] = (bfd_byte) (data >> (0*8));
+ bfd_byte *addr = p;
+ addr[7] = (data >> (7*8)) & 0xff;
+ addr[6] = (data >> (6*8)) & 0xff;
+ addr[5] = (data >> (5*8)) & 0xff;
+ addr[4] = (data >> (4*8)) & 0xff;
+ addr[3] = (data >> (3*8)) & 0xff;
+ addr[2] = (data >> (2*8)) & 0xff;
+ addr[1] = (data >> (1*8)) & 0xff;
+ addr[0] = (data >> (0*8)) & 0xff;
#else
BFD_FAIL();
#endif
}
void
-bfd_put_bits (bfd_vma data, bfd_byte *addr, int bits, bfd_boolean big_p)
+bfd_put_bits (bfd_vma data, void *p, int bits, bfd_boolean big_p)
{
+ bfd_byte *addr = p;
int i;
int bytes;
{
int index = big_p ? bytes - i - 1 : i;
- addr[index] = (bfd_byte) data;
+ addr[index] = data & 0xff;
data >>= 8;
}
}
bfd_vma
-bfd_get_bits (bfd_byte *addr, int bits, bfd_boolean big_p)
+bfd_get_bits (const void *p, int bits, bfd_boolean big_p)
{
+ const bfd_byte *addr = p;
bfd_vma data;
int i;
int bytes;
bfd_mach_o_header *header;
{
unsigned char buf[28];
- bfd_vma (*get32) PARAMS ((const bfd_byte *)) = NULL;
+ bfd_vma (*get32) (const void *) = NULL;
bfd_seek (abfd, 0, SEEK_SET);
/* BFD back end for NetBSD style core files
Copyright 1988, 1989, 1991, 1992, 1993, 1996, 1998, 1999, 2000, 2001,
- 2002, 2004
+ 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Paul Kranenburg, EUR
abort ();
}
-#define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort )
-#define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort )
-#define NO_SIGNED_GET \
- ((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort )
+#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
+#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
+#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
const bfd_target netbsd_core_vec =
{
0, /* Symbol prefix. */
' ', /* ar_pad_char. */
16, /* ar_max_namelen. */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit data. */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit data. */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit data. */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit hdrs. */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit hdrs. */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit hdrs. */
-
- { /* bfd_check_format. */
- _bfd_dummy_target, /* Unknown format. */
- _bfd_dummy_target, /* Object file. */
- _bfd_dummy_target, /* Archive. */
- netbsd_core_file_p /* A core file. */
+ NO_GET, NO_GETS, NO_PUT, /* 64 bit data. */
+ NO_GET, NO_GETS, NO_PUT, /* 32 bit data. */
+ NO_GET, NO_GETS, NO_PUT, /* 16 bit data. */
+ NO_GET, NO_GETS, NO_PUT, /* 64 bit hdrs. */
+ NO_GET, NO_GETS, NO_PUT, /* 32 bit hdrs. */
+ NO_GET, NO_GETS, NO_PUT, /* 16 bit hdrs. */
+
+ { /* bfd_check_format. */
+ _bfd_dummy_target, /* Unknown format. */
+ _bfd_dummy_target, /* Object file. */
+ _bfd_dummy_target, /* Archive. */
+ netbsd_core_file_p /* A core file. */
},
{ /* bfd_set_format. */
bfd_false, bfd_false,
/* BFD back-end for OSF/1 core files.
- Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002
+ Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
{
abort(); /* This way doesn't require any declaration for ANSI to fuck up */
}
-#define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort )
-#define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort )
-#define NO_SIGNED_GET \
- ((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort )
+#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
+#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
+#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
const bfd_target osf_core_vec =
{
0, /* symbol prefix */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit hdrs */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit hdrs */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 64 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 32 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 16 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 64 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 32 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 16 bit hdrs */
{ /* bfd_check_format */
_bfd_dummy_target, /* unknown format */
static bfd_boolean MY(write_object_contents) PARAMS ((bfd *abfd));
#define MY_text_includes_header 1
-bfd_vma bfd_getp32 PARAMS ((const bfd_byte *));
-bfd_signed_vma bfd_getp_signed_32 PARAMS ((const bfd_byte *));
-void bfd_putp32 PARAMS ((bfd_vma, bfd_byte *));
+static bfd_vma bfd_getp32 (const void *);
+static bfd_signed_vma bfd_getp_signed_32 (const void *);
+static void bfd_putp32 (bfd_vma, void *);
#define MY_BFD_TARGET
}
/* end of modified aoutx.h */
-bfd_vma
-bfd_getp32 (addr)
- const bfd_byte *addr;
+static bfd_vma
+bfd_getp32 (const void *p)
{
- return (((((bfd_vma)addr[1] << 8) | addr[0]) << 8)
- | addr[3]) << 8 | addr[2];
+ const bfd_byte *addr = p;
+ unsigned long v;
+ v = (unsigned long) addr[1] << 24;
+ v |= (unsigned long) addr[0] << 16;
+ v |= (unsigned long) addr[3] << 8;
+ v |= (unsigned long) addr[2];
+ return v;
}
#define COERCE32(x) (((bfd_signed_vma) (x) ^ 0x80000000) - 0x80000000)
-bfd_signed_vma
-bfd_getp_signed_32 (addr)
- const bfd_byte *addr;
+static bfd_signed_vma
+bfd_getp_signed_32 (const void *p)
{
- return COERCE32((((((bfd_vma)addr[1] << 8) | addr[0]) << 8)
- | addr[3]) << 8 | addr[2]);
+ const bfd_byte *addr = p;
+ unsigned long v;
+ v = (unsigned long) addr[1] << 24;
+ v |= (unsigned long) addr[0] << 16;
+ v |= (unsigned long) addr[3] << 8;
+ v |= (unsigned long) addr[2];
+ return COERCE32 (v);
}
-void
-bfd_putp32 (data, addr)
- bfd_vma data;
- bfd_byte *addr;
+static void
+bfd_putp32 (bfd_vma data, void *p)
{
- addr[0] = (bfd_byte)(data >> 16);
- addr[1] = (bfd_byte)(data >> 24);
- addr[2] = (bfd_byte)data;
- addr[3] = (bfd_byte)(data >> 8);
+ bfd_byte *addr = p;
+ addr[0] = (data >> 16) & 0xff;
+ addr[1] = (data >> 24) & 0xff;
+ addr[2] = (data >> 0) & 0xff;
+ addr[3] = (data >> 8) & 0xff;
}
/* BFD backend for core files which use the ptrace_user structure
- Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002
+ Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
The structure of this file is based on trad-core.c written by John Gilmore
of Cygnus Support.
{
abort (); /* This way doesn't require any declaration for ANSI to fuck up */
}
-#define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort )
-#define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort )
-#define NO_SIGNED_GET \
- ((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort )
+#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
+#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
+#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
const bfd_target ptrace_core_vec =
{
0, /* symbol prefix */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit hdrs */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit hdrs */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 64 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 32 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 16 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 64 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 32 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 16 bit hdrs */
{ /* bfd_check_format */
_bfd_dummy_target, /* unknown format */
/* BFD back end for SCO5 core files (U-area and raw sections)
- Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Free Software Foundation, Inc.
Written by Jouke Numan <jnuman@hiscom.nl>
This file is part of BFD, the Binary File Descriptor library.
{
abort (); /* This way doesn't require any declaration for ANSI to fuck up */
}
-#define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort )
-#define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort )
-#define NO_SIGNED_GET \
- ((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort )
+#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
+#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
+#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
const bfd_target sco5_core_vec =
{
0, /* symbol prefix */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit hdrs */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit hdrs */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 64 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 32 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 16 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 64 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 32 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 16 bit hdrs */
{ /* bfd_check_format */
_bfd_dummy_target, /* unknown format */
/* Generic target-file-type support for the BFD library.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003
+ 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by Cygnus Support.
. {* 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) (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 *);
+. bfd_vma (*bfd_getx64) (const void *);
+. bfd_signed_vma (*bfd_getx_signed_64) (const void *);
+. void (*bfd_putx64) (bfd_vma, void *);
+. bfd_vma (*bfd_getx32) (const void *);
+. bfd_signed_vma (*bfd_getx_signed_32) (const void *);
+. void (*bfd_putx32) (bfd_vma, void *);
+. bfd_vma (*bfd_getx16) (const void *);
+. bfd_signed_vma (*bfd_getx_signed_16) (const void *);
+. void (*bfd_putx16) (bfd_vma, void *);
.
. {* Byte swapping for the headers. *}
-. 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 *);
+. bfd_vma (*bfd_h_getx64) (const void *);
+. bfd_signed_vma (*bfd_h_getx_signed_64) (const void *);
+. void (*bfd_h_putx64) (bfd_vma, void *);
+. bfd_vma (*bfd_h_getx32) (const void *);
+. bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
+. void (*bfd_h_putx32) (bfd_vma, void *);
+. bfd_vma (*bfd_h_getx16) (const void *);
+. bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
+. void (*bfd_h_putx16) (bfd_vma, void *);
.
. {* Format dependent routines: these are vectors of entry points
. within the target vector structure, one for each format to check. *}
/* BFD back end for traditional Unix core files (U-area and raw sections)
Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
- 2000, 2001, 2002
+ 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Written by John Gilmore of Cygnus Support.
{
abort (); /* This way doesn't require any declaration for ANSI to fuck up */
}
-#define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort )
-#define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort )
-#define NO_SIGNED_GET \
- ((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort )
+#define NO_GET ((bfd_vma (*) (const void *)) swap_abort)
+#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort)
+#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort)
const bfd_target trad_core_vec =
{
0, /* symbol prefix */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit data */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit hdrs */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit hdrs */
- NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 64 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 32 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 16 bit data */
+ NO_GET, NO_GETS, NO_PUT, /* 64 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 32 bit hdrs */
+ NO_GET, NO_GETS, NO_PUT, /* 16 bit hdrs */
{ /* bfd_check_format */
_bfd_dummy_target, /* unknown format */