home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / gnu / djgpp / src / binutils.2 / ld / e_sh.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-30  |  2.0 KB  |  87 lines

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