Keep m68klynx.h
[deliverable/binutils-gdb.git] / bfd / bfd-in.h
index a1e00dde9665e6ba414183738a2ad4e51280d41d..5c2b63678c9682d5f27e3e45a4671cc49f5176e1 100644 (file)
@@ -1,9 +1,11 @@
 /* Main header file for the bfd library -- portable access to object files.
-   ==> The bfd.h file is generated from bfd-in.h and various .c files; if you
-   ==> change it, your changes will probably be lost.
    Copyright 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
    Contributed by Cygnus Support.
 
+** NOTE: bfd.h and bfd-in2.h are GENERATED files.  Don't change them;
+** instead, change bfd-in.h or the other BFD source files processed to
+** generate these files.
+
 This file is part of BFD, the Binary File Descriptor library.
 
 This program is free software; you can redistribute it and/or modify
@@ -45,11 +47,34 @@ here.  */
 #include "ansidecl.h"
 #include "obstack.h"
 
-#define BFD_VERSION "2.1"
+#define BFD_VERSION "2.2"
+
+#define BFD_ARCH_SIZE @WORDSIZE@
+
+#if BFD_ARCH_SIZE >= 64
+#define BFD64
+#endif
+
+#ifndef INLINE
+#if __GNUC__ >= 2
+#define INLINE __inline__
+#else
+#define INLINE
+#endif
+#endif
+
+/* 64-bit type definition (if any) from bfd's sysdep.h goes here */
+
 
 /* forward declaration */
 typedef struct _bfd bfd;
 
+/* To squelch erroneous compiler warnings ("illegal pointer
+   combination") from the SVR3 compiler, we would like to typedef
+   boolean to int (it doesn't like functions which return boolean.
+   Making sure they are never implicitly declared to return int
+   doesn't seem to help).  But this file is not configured based on
+   the host.  */
 /* General rules: functions which are boolean return true on success
    and false on failure (unless they're a predicate).   -- bfd.doc */
 /* I'm sure this is going to break something and someone is going to
@@ -68,20 +93,59 @@ typedef enum bfd_boolean {false, true} boolean;
 /* typedef off_t       file_ptr; */
 typedef long int file_ptr;
 
-/* Support for different sizes of target format ints and addresses */
+/* Support for different sizes of target format ints and addresses.  If the
+   host implements 64-bit values, it defines HOST_64_BIT to be the appropriate
+   type.  Otherwise, this code will fall back on gcc's "long long" type if gcc
+   is being used.  HOST_64_BIT must be defined in such a way as to be a valid
+   type name by itself or with "unsigned" prefixed.  It should be a signed
+   type by itself.
+
+   If neither is the case, then compilation will fail if 64-bit targets are
+   requested.  If you don't request any 64-bit targets, you should be safe. */
+
+#ifdef BFD64
 
-#ifdef HOST_64_BIT
-typedef HOST_64_BIT bfd_vma;
-typedef HOST_64_BIT bfd_size_type;
-typedef HOST_64_BIT symvalue;
+#if defined (__GNUC__) && !defined (HOST_64_BIT)
+#define HOST_64_BIT long long
+typedef HOST_64_BIT int64_type;
+typedef unsigned HOST_64_BIT uint64_type;
+#endif
+
+#if !defined (uint64_type) && defined (__GNUC__)
+#define uint64_type unsigned long long
+#define int64_type long long
+#define uint64_typeLOW(x) (unsigned long)(((x) & 0xffffffff))
+#define uint64_typeHIGH(x) (unsigned long)(((x) >> 32) & 0xffffffff)
+#endif
+
+typedef unsigned HOST_64_BIT bfd_vma;
+typedef HOST_64_BIT bfd_signed_vma;
+typedef unsigned HOST_64_BIT bfd_size_type;
+typedef unsigned HOST_64_BIT symvalue;
 #define fprintf_vma(s,x) \
                fprintf(s,"%08x%08x", uint64_typeHIGH(x), uint64_typeLOW(x))
-#else
+#define sprintf_vma(s,x) \
+               sprintf(s,"%08x%08x", uint64_typeHIGH(x), uint64_typeLOW(x))
+#else /* not BFD64  */
+
+/* Represent a target address.  Also used as a generic unsigned type
+   which is guaranteed to be big enough to hold any arithmetic types
+   we need to deal with.  */
 typedef unsigned long bfd_vma;
+
+/* A generic signed type which is guaranteed to be big enough to hold any
+   arithmetic types we need to deal with.  Can be assumed to be compatible
+   with bfd_vma in the same way that signed and unsigned ints are compatible
+   (as parameters, in assignment, etc).  */
+typedef long bfd_signed_vma;
+
 typedef unsigned long symvalue;
 typedef unsigned long bfd_size_type;
+
+/* Print a bfd_vma x on stream s.  */
 #define fprintf_vma(s,x) fprintf(s, "%08lx", x)
-#endif
+#define sprintf_vma(s,x) sprintf(s, "%08lx", x)
+#endif /* not BFD64  */
 #define printf_vma(x) fprintf_vma(stdout,x)
 
 typedef unsigned int flagword; /* 32 bits of flags */
@@ -236,23 +300,49 @@ typedef enum bfd_print_symbol
 { 
   bfd_print_symbol_name,
   bfd_print_symbol_more,
-  bfd_print_symbol_all,
-  bfd_print_symbol_nm  /* Pretty format suitable for nm program. */
+  bfd_print_symbol_all
 } bfd_print_symbol_type;
     
 \f
+/* Information about a symbol that nm needs.  */
+
+typedef struct _symbol_info
+{
+  symvalue value;
+  char type;                   /*  */
+  CONST char *name;            /* Symbol name.  */
+  char stab_other;             /* Unused. */
+  short stab_desc;             /* Info for N_TYPE.  */
+  CONST char *stab_name;
+} symbol_info;
 \f
 /* The code that implements targets can initialize a jump table with this
    macro.  It must name all its routines the same way (a prefix plus
    the standard routine suffix), or it must #define the routines that
    are not so named, before calling JUMP_TABLE in the initializer.  */
 
-/* Semi-portable string concatenation in cpp */
+/* Semi-portable string concatenation in cpp.
+   The CAT4 hack is to avoid a problem with some strict ANSI C preprocessors.
+   The problem is, "32_" is not a valid preprocessing token, and we don't
+   want extra underscores (e.g., "nlm_32_").  The XCAT2 macro will cause the
+   inner CAT macros to be evaluated first, producing still-valid pp-tokens.
+   Then the final concatenation can be done.  (Sigh.)  */
 #ifndef CAT
+#ifdef SABER
+#define CAT(a,b)       a##b
+#define CAT3(a,b,c)    a##b##c
+#define CAT4(a,b,c,d)  a##b##c##d
+#else
 #ifdef __STDC__
 #define CAT(a,b) a##b
+#define CAT3(a,b,c) a##b##c
+#define XCAT2(a,b)     CAT(a,b)
+#define CAT4(a,b,c,d)  XCAT2(CAT(a,b),CAT(c,d))
 #else
 #define CAT(a,b) a/**/b
+#define CAT3(a,b,c) a/**/b/**/c
+#define CAT4(a,b,c,d)  a/**/b/**/c/**/d
+#endif
 #endif
 #endif
 
@@ -264,7 +354,7 @@ CAT(NAME,_slurp_armap),\
 CAT(NAME,_slurp_extended_name_table),\
 CAT(NAME,_truncate_arname),\
 CAT(NAME,_write_armap),\
-CAT(NAME,_close_and_cleanup),  \
+CAT(NAME,_close_and_cleanup),\
 CAT(NAME,_set_section_contents),\
 CAT(NAME,_get_section_contents),\
 CAT(NAME,_new_section_hook),\
@@ -274,6 +364,7 @@ CAT(NAME,_get_reloc_upper_bound),\
 CAT(NAME,_canonicalize_reloc),\
 CAT(NAME,_make_empty_symbol),\
 CAT(NAME,_print_symbol),\
+CAT(NAME,_get_symbol_info),\
 CAT(NAME,_get_lineno),\
 CAT(NAME,_set_arch_mach),\
 CAT(NAME,_openr_next_archived_file),\
This page took 0.024643 seconds and 4 git commands to generate.