Changeset 625


Ignore:
Timestamp:
Aug 17, 2003, 3:45:55 AM (22 years ago)
Author:
bird
Message:

#597: Corrected struct initialization and fixed some compiler warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/binutils/ld/emultempl/i386aoutemx.em

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r624 r625  
    3636#include "ld.h"
    3737#include "ldmain.h"
     38#include "ldfile.h"
    3839#include "ldemul.h"
    39 #include "ldfile.h"
    4040#include "ldmisc.h"
    4141#include "ldexp.h"
     
    4444#include "ldgram.h"
    4545
     46#ifdef ANSI_PROTOTYPES
     47#include <stdarg.h>
     48#else
     49#include <varargs.h>
     50#endif
     51
    4652static void gld${EMULATION_NAME}_before_parse PARAMS ((void));
    4753static char *gld${EMULATION_NAME}_get_script PARAMS ((int *isfile));
     54static int gld${EMULATION_NAME}_parse_args PARAMS ((int argc, char **argv));
     55static bfd_boolean gld${EMULATION_NAME}_unrecognized_file PARAMS ((lang_input_statement_type *entry));
     56
     57
     58static int parse PARAMS ((char *arg, char *format, char *error));
     59
    4860
    4961static void
    50 gld${EMULATION_NAME}_before_parse()
     62gld${EMULATION_NAME}_before_parse(void)
    5163{
    5264  ldfile_set_output_arch ("`echo ${ARCH}`");
     
    7183#  *isfile = 0;
    7284#
    73 #  if (link_info.relocateable == true && config.build_constructors == true)
     85#  if (link_info.relocateable == TRUE && config.build_constructors == TRUE)
    7486#    return
    7587#EOF
    7688#sed $sc ldscripts/${EMULATION_NAME}.xu                     >> e${EMULATION_NAME}.c
    77 #echo '  ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c
     89#echo '  ; else if (link_info.relocateable == TRUE) return' >> e${EMULATION_NAME}.c
    7890#sed $sc ldscripts/${EMULATION_NAME}.xr                     >> e${EMULATION_NAME}.c
    7991#echo '  ; else if (!config.text_read_only) return'         >> e${EMULATION_NAME}.c
     
    105117  *isfile = 1;
    106118
    107   if (link_info.relocateable == true && config.build_constructors == true)
     119  if (link_info.relocateable == TRUE && config.build_constructors == TRUE)
    108120    return "ldscripts/${EMULATION_NAME}.xu";
    109   else if (link_info.relocateable == true)
     121  else if (link_info.relocateable == TRUE)
    110122    return "ldscripts/${EMULATION_NAME}.xr";
    111123  else if (!config.text_read_only)
     
    125137
    126138/* Report a fatal error.
    127    STRING is a printf format string and ARG is one arg for it.  */
    128 
    129 void
    130 fatal (string, arg1, arg2)
    131  char *string, *arg1, *arg2;
    132 {
     139   FMT is a printf format string and ARG is one arg for it.  */
     140
     141static void fatal VPARAMS ((char *fmt, ...))
     142{
     143  VA_OPEN (arg, fmt);
     144  VA_FIXEDARG (arg, char *, fmt);
     145
    133146  fprintf (stderr, "%s: ", program_name);
    134   fprintf (stderr, string, arg1, arg2);
     147  vfprintf (stderr, fmt, arg);
     148  VA_CLOSE (arg);
    135149  fprintf (stderr, "\n");
    136150  xexit (1);
     
    141155   generating the error message using format string ERROR and ARG as arg.  */
    142156
    143 int
     157static int
    144158parse (arg, format, error)
    145   char *arg, *format;
    146   int error;
     159  char *arg, *format, *error;
    147160{
    148161  int x;
     
    204217} rsxnt_linked = EMX_DEFAULT;
    205218
    206 int gld_${EMULATION_NAME}_parse_args (argc, argv)
     219static int gld${EMULATION_NAME}_parse_args (argc, argv)
    207220 int argc;
    208221 char **argv;
     
    256269 * output_filename is not effective).
    257270 */
    258 void gld${EMULATION_NAME}_set_symbols ()
     271static void gld${EMULATION_NAME}_set_symbols (void)
    259272{
    260273  char *ext, *tmp_dir, *tmp;
     
    275288
    276289  /* Always generate relocatable output since ld is just the first stage ... */
    277   link_info.relocateable = true;
     290  link_info.relocateable = TRUE;
    278291
    279292  if (exe_flag)
     
    296309    if (stricmp (ext, ".dll") == 0)
    297310    {
    298       link_info.relocateable = true;
     311      link_info.relocateable = TRUE;
    299312      dll_flag = 1;
    300313    }
     
    327340}
    328341
    329 boolean gld_${EMULATION_NAME}_unrecognized_file (entry)
     342static bfd_boolean gld${EMULATION_NAME}_unrecognized_file (entry)
    330343 lang_input_statement_type *entry;
    331344{
     
    338351    {
    339352      def_filename = entry->filename;
    340       entry->loaded = true;
    341       return true;
     353      entry->loaded = TRUE;
     354      return TRUE;
    342355    }
    343356    else if (stricmp (ext, ".res") == 0)
    344357    {
    345358      res_filename = entry->filename;
    346       entry->loaded = true;
    347       return true;
    348     }
    349   }
    350 
    351   return false;
    352 }
    353 
    354 extern u_int DosCopy (char *pszSource, char *pszTarget, u_int ulOption);
     359      entry->loaded = TRUE;
     360      return TRUE;
     361    }
     362  }
     363
     364  return FALSE;
     365}
     366
     367extern u_int _System DosCopy (char *pszSource, char *pszTarget, u_int ulOption);
    355368
    356369/* Perform final action(s) on output file */
    357 void gld_${EMULATION_NAME}_finish_link (char *filename)
     370static void gld${EMULATION_NAME}_finish_link (char *filename)
    358371{
    359372  struct stat statbuf;
     
    497510
    498511/* Create any output sections needed by the target.  */
    499 void gld${EMULATION_NAME}_create_output_section_statements (void)
     512static void gld${EMULATION_NAME}_create_output_section_statements (void)
    500513{
    501514  /* Since we enabled relocations LD marked output file as non-pageable */
    502   /* However, this is not true for emx: always generate paged output */
     515  /* However, this is not TRUE for emx: always generate paged output */
    503516  output_bfd->flags |= D_PAGED;
    504517}
     
    523536  NULL, /* place orphan */
    524537  gld${EMULATION_NAME}_set_symbols, /* set symbols */
    525   gld_${EMULATION_NAME}_parse_args,
    526   gld_${EMULATION_NAME}_unrecognized_file,
     538  gld${EMULATION_NAME}_parse_args,
     539  NULL, /* add_options */
     540  NULL, /* handle_option */
     541  gld${EMULATION_NAME}_unrecognized_file,
    527542  NULL, /* list_options */
    528543  NULL, /* recognized_file */
    529544  NULL, /* find_potential_libraries */
    530   NULL  /* new_vers_pattern.  */
    531   gld_${EMULATION_NAME}_finish_link
     545  NULL, /* new_vers_pattern.  */
     546  gld${EMULATION_NAME}_finish_link
    532547};
    533548EOF
Note: See TracChangeset for help on using the changeset viewer.