Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/bfd/sparclynx.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* BFD support for Sparc binaries under LynxOS.
    2    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000
    3    Free Software Foundation, Inc.
     2   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000,
     3   2001, 2002, 2003 Free Software Foundation, Inc.
    44
    55This file is part of BFD, the Binary File Descriptor library.
     
    2020
    2121#if 0
    22 #define BYTES_IN_WORD 4
    2322#define N_SHARED_LIB(x) 0
    2423
     
    3029#endif
    3130
    32 #define MY(OP) CAT(sparclynx_aout_,OP)
     31/* Do not "beautify" the CONCAT* macro args.  Traditional C will not
     32   remove whitespace added here, and thus will fail to concatenate
     33   the tokens.  */
     34#define MY(OP) CONCAT2 (sparclynx_aout_,OP)
    3335#define TARGETNAME "a.out-sparc-lynx"
    3436
     
    4345#include "aout/stab_gnu.h"
    4446#include "aout/ar.h"
     47
     48void NAME (lynx,set_arch_mach) PARAMS ((bfd *, unsigned long));
     49static void choose_reloc_size PARAMS ((bfd *));
     50static bfd_boolean NAME (aout,sparclynx_write_object_contents) PARAMS ((bfd *));
    4551
    4652/* This is needed to reject a NewsOS file, e.g. in
     
    5359                            || (mtype) == M_SPARC)
    5460
    55 /*
    56 The file @code{aoutf1.h} contains the code for BFD's
    57 a.out back end. Control over the generated back end is given by these
    58 two preprocessor names:
    59 @table @code
    60 @item ARCH_SIZE
    61 This value should be either 32 or 64, depending upon the size of an
    62 int in the target format. It changes the sizes of the structs which
    63 perform the memory/disk mapping of structures.
    64 
    65 The 64 bit backend may only be used if the host compiler supports 64
    66 ints (eg long long with gcc), by defining the name @code{BFD_HOST_64_BIT} in @code{bfd.h}.
    67 With this name defined, @emph{all} bfd operations are performed with 64bit
    68 arithmetic, not just those to a 64bit target.
    69 
    70 @item TARGETNAME
    71 The name put into the target vector.
    72 @item
    73 @end table
    74 
    75 */
    76 
    77 /*SUPPRESS558*/
    78 /*SUPPRESS529*/
     61/* The file @code{aoutf1.h} contains the code for BFD's
     62   a.out back end. Control over the generated back end is given by these
     63   two preprocessor names:
     64   @table @code
     65   @item ARCH_SIZE
     66   This value should be either 32 or 64, depending upon the size of an
     67   int in the target format. It changes the sizes of the structs which
     68   perform the memory/disk mapping of structures.
     69
     70   The 64 bit backend may only be used if the host compiler supports 64
     71   ints (eg long long with gcc), by defining the name @code{BFD_HOST_64_BIT} in @code{bfd.h}.
     72   With this name defined, @emph{all} bfd operations are performed with 64bit
     73   arithmetic, not just those to a 64bit target.
     74
     75   @item TARGETNAME
     76   The name put into the target vector.
     77   @item
     78   @end table  */
    7979
    8080void
    8181NAME(lynx,set_arch_mach) (abfd, machtype)
    8282     bfd *abfd;
    83      int machtype;
     83     unsigned long machtype;
    8484{
    8585  /* Determine the architecture and machine type of the object file.  */
    8686  enum bfd_architecture arch;
    87   long machine;
     87  unsigned long machine;
     88
    8889  switch (machtype)
    8990    {
    90 
    9191    case M_UNKNOWN:
    9292      /* Some Sun3s make magic numbers without cpu types in them, so
     
    141141  choose_reloc_size(ABFD);
    142142
    143 /* Determine the size of a relocation entry, based on the architecture */
     143/* Determine the size of a relocation entry, based on the architecture.  */
     144
    144145static void
    145146choose_reloc_size (abfd)
     
    162163  file header, symbols, and relocation.  */
    163164
    164 static boolean
     165static bfd_boolean
    165166NAME(aout,sparclynx_write_object_contents) (abfd)
    166167     bfd *abfd;
     
    203204  WRITE_HEADERS (abfd, execp);
    204205
    205   return true;
     206  return TRUE;
    206207}
    207208
    208209#define MY_set_sizes sparclynx_set_sizes
    209 static boolean
     210static bfd_boolean sparclynx_set_sizes PARAMS ((bfd *));
     211
     212static bfd_boolean
    210213sparclynx_set_sizes (abfd)
    211214     bfd *abfd;
     
    214217    {
    215218    default:
    216       return false;
     219      return FALSE;
    217220    case bfd_arch_sparc:
    218221      adata (abfd).page_size = 0x2000;
    219222      adata (abfd).segment_size = 0x2000;
    220223      adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
    221       return true;
     224      return TRUE;
    222225    case bfd_arch_m68k:
    223226      adata (abfd).page_size = 0x2000;
    224227      adata (abfd).segment_size = 0x20000;
    225228      adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
    226       return true;
    227     }
    228 }
    229 
    230 static CONST struct aout_backend_data sparclynx_aout_backend =
    231 {
    232   0, 1, 0, 1, 0, sparclynx_set_sizes, 0,
    233   0,                            /* add_dynamic_symbols */
    234   0,                            /* add_one_symbol */
    235   0,                            /* link_dynamic_object */
    236   0,                            /* write_dynamic_symbol */
    237   0,                            /* check_dynamic_reloc */
    238   0                             /* finish_dynamic_link */
    239 };
     229      return TRUE;
     230    }
     231}
     232
     233static const struct aout_backend_data sparclynx_aout_backend =
     234  {
     235    0, 1, 0, 1, 0, sparclynx_set_sizes, 0,
     236    0,                          /* add_dynamic_symbols */
     237    0,                          /* add_one_symbol */
     238    0,                          /* link_dynamic_object */
     239    0,                          /* write_dynamic_symbol */
     240    0,                          /* check_dynamic_reloc */
     241    0                           /* finish_dynamic_link */
     242  };
    240243
    241244
     
    253256#ifdef LYNX_CORE
    254257
    255 char *lynx_core_file_failing_command ();
     258char * lynx_core_file_failing_command ();
    256259int lynx_core_file_failing_signal ();
    257 boolean lynx_core_file_matches_executable_p ();
    258 const bfd_target *lynx_core_file_p ();
     260bfd_boolean lynx_core_file_matches_executable_p ();
     261const bfd_target * lynx_core_file_p ();
    259262
    260263#define MY_core_file_failing_command lynx_core_file_failing_command
Note: See TracChangeset for help on using the changeset viewer.