home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / gnu / djgpp / src / binutils.2 / ld / sh.em < prev    next >
Encoding:
Text File  |  1993-05-30  |  2.1 KB  |  89 lines

  1. cat >e_${EMULATION_NAME}.c <<EOF
  2. /* Copyright (C) 1993 Free Software Foundation, Inc.
  3.  
  4. This file is part of GLD, the Gnu Linker.
  5.  
  6. GLD is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 1, or (at your option)
  9. any later version.
  10.  
  11. GLD is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GLD; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. /* 
  21.  Written by Steve Chamberlain sac@cygnus.com
  22.  
  23.  The controller which tells the gnu linker how to behave like one for
  24.  the Hitach SH.
  25. */
  26.  
  27. #include "bfd.h"
  28. #include "sysdep.h"
  29.  
  30. #include "ld.h"
  31. #include "config.h"
  32. #include "ldemul.h"
  33. #include "ldfile.h"
  34. #include "ldmisc.h"
  35.  
  36. extern  boolean lang_float_flag;
  37.  
  38.  
  39. extern enum bfd_architecture ldfile_output_architecture;
  40. extern unsigned long ldfile_output_machine;
  41. extern char *ldfile_output_machine_name;
  42.  
  43. extern bfd *output_bfd;
  44.  
  45.  
  46.  
  47. static void sh_before_parse()
  48. {
  49.   ldfile_output_architecture = bfd_arch_sh;
  50. }
  51.  
  52. static char *sh_script =  
  53. #include "sh.x"
  54. ;
  55. static char *sh_script_option_Ur  =  
  56. #include "sh.xu"
  57. ;
  58. static char *sh_script_option_r  =  
  59. #include "sh.xr"
  60. ;
  61.  
  62. static char *sh_get_script()
  63. {                 
  64.   extern ld_config_type config;
  65.   if (config.relocateable_output == true &&
  66.       config.build_constructors == true) {
  67.     return sh_script_option_Ur;
  68.   }
  69.   if (config.relocateable_output) {
  70.     return sh_script_option_r;
  71.   }
  72.     
  73.   return sh_script;
  74. }
  75. struct ld_emulation_xfer_struct ld_sh_emulation = 
  76. {
  77.   sh_before_parse,
  78.   syslib_default,
  79.   hll_default,
  80.   after_parse_default,
  81.   after_allocation_default,
  82.   set_output_arch_default,
  83.   ldemul_default_target,
  84.   before_allocation_default,
  85.   sh_get_script,
  86.   "sh"
  87. };
  88. EOF
  89.