aboutsummaryrefslogtreecommitdiff
path: root/bfd/bfd-in.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2004-03-15 14:21:43 +0000
committerAlan Modra <amodra@gmail.com>2004-03-15 14:21:43 +0000
commit8ce8c090f3e7509af869a05090bc5b0656c487d8 (patch)
treeedb56dd469bb8c892ab94115ea54ffec36599a9c /bfd/bfd-in.h
parent7bfeee7be23ed74042abf81e7e3b64eb05f8fb62 (diff)
downloadgdb-8ce8c090f3e7509af869a05090bc5b0656c487d8.zip
gdb-8ce8c090f3e7509af869a05090bc5b0656c487d8.tar.gz
gdb-8ce8c090f3e7509af869a05090bc5b0656c487d8.tar.bz2
* bfd-in.h (bfd_int64_t, bfd_uint64_t): New types.
(BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Don't define here. (bfd_getb64, bfd_getl64, bfd_get_bits): Return bfd_uint64_t. (bfd_getb_signed_64, bfd_getl_signed_64): Return bfd_int64_t. (bfd_putb64, bfd_putl64, bfd_put_bits): Accept bfd_uint64_t. * configure.in (HOST_U_64BIT_TYPE): Set when sizeof long is 8. (BFD_HOST_64_BIT_DEFINED, BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Set when using long. * libbfd.c (EIGHT_GAZILLION, COERCE64): Use bfd_int64_t. (bfd_getb64): Return bfd_uint64_t. Enable when BFD_HOST_64_BIT. (bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise. (bfd_putb64): Accept bfd_uint64_t. Enable when BFD_HOST_64_BIT. (bfd_putl64, bfd_put_bits, bfd_get_bits): Likewise. * dwarf2.c (struct attribute): Use bfd_int64_t and bfd_uint64_t. (read_8_bytes, read_indirect_string, read_address): Likewise. (read_abbrevs, parse_comp_unit): Likewise. * targets.c (struct bfd_target): Likewise. * aix386-core.c (NO_GET64, NO_PUT64, NO_GETS64): Define and use. * hppabsd-core.c: Likewise. Formatting. * 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. * configure: Regenerate. * bfd-in2.h: Regenerate.
Diffstat (limited to 'bfd/bfd-in.h')
-rw-r--r--bfd/bfd-in.h45
1 files changed, 19 insertions, 26 deletions
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 482e88d..37df5f2 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -55,6 +55,8 @@ extern "C" {
#if @BFD_HOST_64_BIT_DEFINED@
#define BFD_HOST_64_BIT @BFD_HOST_64_BIT@
#define BFD_HOST_U_64_BIT @BFD_HOST_U_64_BIT@
+typedef BFD_HOST_64_BIT bfd_int64_t;
+typedef BFD_HOST_U_64_BIT bfd_uint64_t;
#endif
#if BFD_ARCH_SIZE >= 64
@@ -95,24 +97,6 @@ typedef int bfd_boolean;
#define true dont_use_true_in_bfd
#endif
-/* Support for different sizes of target format ints and addresses.
- If the type `long' is at least 64 bits, BFD_HOST_64BIT_LONG will be
- set to 1 above. Otherwise, if the host compiler used during
- configuration supports long long, this code will use it.
- Otherwise, BFD_HOST_64_BIT must be defined above. */
-
-#ifndef BFD_HOST_64_BIT
-# if BFD_HOST_64BIT_LONG
-# define BFD_HOST_64_BIT long
-# define BFD_HOST_U_64_BIT unsigned long
-# else
-# if BFD_HOST_LONG_LONG
-# define BFD_HOST_64_BIT long long
-# define BFD_HOST_U_64_BIT unsigned long long
-# endif /* ! BFD_HOST_LONG_LONG */
-# endif /* ! BFD_HOST_64BIT_LONG */
-#endif /* ! defined (BFD_HOST_64_BIT) */
-
#ifdef BFD64
#ifndef BFD_HOST_64_BIT
@@ -160,6 +144,15 @@ typedef unsigned long bfd_size_type;
#endif /* not BFD64 */
+#ifndef BFD_HOST_64_BIT
+/* Fall back on a 32 bit type. The idea is to make these types always
+ available for function return types, but in the case that
+ BFD_HOST_64_BIT is undefined such a function should abort or
+ otherwise signal an error. */
+typedef bfd_signed_vma bfd_int64_t;
+typedef bfd_vma bfd_uint64_t;
+#endif
+
/* An offset into a file. BFD always uses the largest possible offset
based on the build time availability of fseek, fseeko, or fseeko64. */
typedef @bfd_file_ptr@ file_ptr;
@@ -518,10 +511,10 @@ extern bfd_boolean bfd_record_phdr
/* Byte swapping routines. */
-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_uint64_t bfd_getb64 (const void *);
+bfd_uint64_t bfd_getl64 (const void *);
+bfd_int64_t bfd_getb_signed_64 (const void *);
+bfd_int64_t 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 *);
@@ -530,8 +523,8 @@ 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_putb64 (bfd_uint64_t, void *);
+void bfd_putl64 (bfd_uint64_t, void *);
void bfd_putb32 (bfd_vma, void *);
void bfd_putl32 (bfd_vma, void *);
void bfd_putb16 (bfd_vma, void *);
@@ -539,8 +532,8 @@ void bfd_putl16 (bfd_vma, void *);
/* Byte swapping routines which take size and endiannes as arguments. */
-bfd_vma bfd_get_bits (const void *, int, bfd_boolean);
-void bfd_put_bits (bfd_vma, void *, int, bfd_boolean);
+bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
+void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
/* Externally visible ECOFF routines. */