* bfd.h:upgrade from bfd.c
authorSteve Chamberlain <steve@cygnus>
Fri, 11 Oct 1991 19:44:01 +0000 (19:44 +0000)
committerSteve Chamberlain <steve@cygnus>
Fri, 11 Oct 1991 19:44:01 +0000 (19:44 +0000)
* internalcoff.h: add n_name, n_zeroes and n_offset macros
* amdcoff.h: Define OMAGIC and AOUTHDRSZ.

include/bfd.h
include/coff-a29k.h
include/internalcoff.h

index 1b93389b64e3af3ae30952f694e9a2b73b4ce1f9..3829d77988fe27928b7cdc13c9017b3da244aad4 100644 (file)
@@ -177,8 +177,6 @@ typedef struct lineno_cache_entry {
 /* object and core file sections */
 
 
-/* Align an address upward to a power of two.  Argument is the power
-   of two, e.g. 8-byte alignment uses argument of 3 (8 == 2^3).  */
 #define        align_power(addr, align)        \
        ( ((addr) + ((1<<(align))-1)) & (-1 << (align)))
 
@@ -271,7 +269,14 @@ CAT(NAME,_bfd_debug_info_start),\
 CAT(NAME,_bfd_debug_info_end),\
 CAT(NAME,_bfd_debug_info_accumulate)
 
-#define COFF_SWAP_TABLE coff_swap_aux_in, coff_swap_sym_in, coff_swap_lineno_in,
+#define COFF_SWAP_TABLE \
+ coff_swap_aux_in, coff_swap_sym_in, coff_swap_lineno_in, \
+ coff_swap_aux_out, coff_swap_sym_out, \
+ coff_swap_lineno_out, coff_swap_reloc_out, \
+ coff_swap_filehdr_out, coff_swap_aouthdr_out, \
+ coff_swap_scnhdr_out
+
+
 \f
 /* User program access to BFD facilities */
 
@@ -1827,6 +1832,27 @@ before); else determine modify time, cache it, and return it.
 #define bfd_set_arch_mach(abfd, arch, mach)\
         BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
 
+#define bfd_coff_swap_reloc_out(abfd, i, o) \
+        BFD_SEND (abfd, _bfd_coff_swap_reloc_out, (abfd, i, o))
+
+#define bfd_coff_swap_lineno_out(abfd, i, o) \
+        BFD_SEND (abfd, _bfd_coff_swap_lineno_out, (abfd, i, o))
+
+#define bfd_coff_swap_aux_out(abfd, i, t,c,o) \
+        BFD_SEND (abfd, _bfd_coff_swap_aux_out, (abfd, i,t,c, o))
+
+#define bfd_coff_swap_sym_out(abfd, i,o) \
+        BFD_SEND (abfd, _bfd_coff_swap_sym_out, (abfd, i, o))
+
+#define bfd_coff_swap_scnhdr_out(abfd, i,o) \
+        BFD_SEND (abfd, _bfd_coff_swap_scnhdr_out, (abfd, i, o))
+
+#define bfd_coff_swap_filehdr_out(abfd, i,o) \
+        BFD_SEND (abfd, _bfd_coff_swap_filehdr_out, (abfd, i, o))
+
+#define bfd_coff_swap_aouthdr_out(abfd, i,o) \
+        BFD_SEND (abfd, _bfd_coff_swap_aouthdr_out, (abfd, i, o))
+
 /*
 */
 
@@ -1903,7 +1929,7 @@ or else @code{false}.
 
 /*:targets.c*/
 /* bfd_target
-@node bfd_target
+@node bfd_target,  , Targets, Targets
 @subsection bfd_target
 This structure contains everything that BFD knows about a target.
 It includes things like its byte order, name, what routines to call
@@ -2151,6 +2177,47 @@ Special entry points for gdb to swap in coff symbol table parts
        PTR            ext,
        PTR             in));
 
+/*
+Special entry points for gas to swap coff parts
+*/
+
+ SDEF(unsigned int, _bfd_coff_swap_aux_out,(
+       bfd     *abfd,
+       PTR     in,
+       int     type,
+       int     class,
+       PTR     ext));
+
+ SDEF(unsigned int, _bfd_coff_swap_sym_out,(
+      bfd      *abfd,
+      PTR      in,
+      PTR      ext));
+
+ SDEF(unsigned int, _bfd_coff_swap_lineno_out,(
+       bfd     *abfd,
+       PTR     in,
+       PTR     ext));
+
+ SDEF(unsigned int, _bfd_coff_swap_reloc_out,(
+       bfd     *abfd,
+       PTR     src,
+       PTR     dst));
+
+ SDEF(unsigned int, _bfd_coff_swap_filehdr_out,(
+       bfd     *abfd,
+       PTR     in,
+       PTR     out));
+
+ SDEF(unsigned int, _bfd_coff_swap_aouthdr_out,(
+       bfd     *abfd,
+       PTR     in,
+       PTR     out));
+
+ SDEF(unsigned int, _bfd_coff_swap_scnhdr_out,(
+       bfd     *abfd,
+       PTR     in,
+       PTR     out));
+
 } bfd_target;
 
 /*
index 46c131dbd31d72ffd6e8b15fc15b9ef335b20241..8042d51fb3a6e1b05d0a4b5d3fc92a16168436ef 100755 (executable)
@@ -36,12 +36,13 @@ struct external_filehdr
 #define SIPFBOMAGIC     0572    /* Am29000 (Byte 0 is MSB) */
 #define SIPRBOMAGIC     0573    /* Am29000 (Byte 0 is LSB) */
 
+
 #define A29K_MAGIC_BIG                 SIPFBOMAGIC     
 #define A29K_MAGIC_LITTLE      SIPRBOMAGIC     
 #define A29KBADMAG(x)  (((x).f_magic!=A29K_MAGIC_BIG) && \
                          ((x).f_magic!=A29K_MAGIC_LITTLE))
 
-
+#define OMAGIC A29K_MAGIC_BIG
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
 
 /*
@@ -70,6 +71,7 @@ typedef       struct external_aouthdr
 } AOUTHDR;
 
 #define AOUTSZ (sizeof(AOUTHDR))
+#define AOUTHDRSZ (sizeof(AOUTHDR))
 
 /* aouthdr magic numbers */
 #define NMAGIC         0410    /* separate i/d executable */
index 1cfd0d4a012184b3a494d3cf4d3a435102492081..ffd497d010060b506c14d4e301bad7907101a2dc 100755 (executable)
@@ -174,6 +174,10 @@ struct internal_syment {
        char            n_sclass;       /* storage class                */
        char            n_numaux;       /* number of aux. entries       */
 };
+#define n_name         _n._n_name
+#define n_zeroes       _n._n_n._n_zeroes
+#define n_offset       _n._n_n._n_offset
+
 
 /* Relocatable symbols have number of the section in which they are defined,
    or one of the following: */
@@ -225,11 +229,11 @@ struct internal_syment {
 union internal_auxent 
 {
   struct {
+
     union {
       long l;                  /* str, un, or enum tag indx */
       struct coff_ptr_struct *p;
     } x_tagndx;
-
     union {
       struct {
        unsigned short x_lnno;  /* declaration line number */