home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer) / NeXT_Developer-3.3.iso / NextDeveloper / Source / GNU / cc / config / m68k / next.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-29  |  1.1 KB  |  50 lines

  1. /* next.c:  Functions for NeXT as target machine for GNU C compiler.  */
  2.  
  3. /* Note that the include below means that we can't debug routines in
  4.    m68k.c when running on a COFF system.  */
  5.  
  6. #include "m68k/m68k.c"
  7. #include "nextstep.c"
  8.  
  9. void
  10. machopic_output_stub (file, symb, stub)
  11.      FILE *file;
  12.      const char *symb, *stub;
  13. {
  14.   if (MACHOPIC_PURE)
  15.     machopic_picsymbol_stub_section ();
  16.   else
  17.     machopic_symbol_stub_section ();
  18.  
  19.   fprintf (file, "%s:\n", stub);
  20.   fprintf (file, "\t.indirect_symbol %s\n", symb);
  21.  
  22.   if (MACHOPIC_PURE)
  23.     {
  24.       fprintf (file, "\tmovel pc@(L%s$lazy_ptr-.),a0\n\tjmp a0@\n", symb);
  25.     }
  26.   else
  27.     {
  28.       fprintf (file, "\tmovel @(L%s$lazy_ptr),a0\n\tjmp a0@\n", symb);
  29.     }
  30.   
  31.   fprintf (file, "%s_binder:\n", stub);
  32.   
  33.   if (MACHOPIC_PURE)
  34.     {
  35.       fprintf (file, "\tpea pc@(L%s$lazy_ptr-.)\n", symb);
  36.     }
  37.   else
  38.     {
  39.       fprintf (file, "\tmovel #L%s$lazy_ptr,sp@-\n", symb);
  40.     }
  41.  
  42.   fprintf (file, "\tbra dyld_stub_binding_helper\n");
  43.  
  44.   machopic_lazy_symbol_ptr_section ();
  45.   fprintf (file, "L%s$lazy_ptr:\n", symb);
  46.   fprintf (file, "\t.indirect_symbol %s\n", symb);
  47.   fprintf (file, "\t.long %s_binder\n", stub);
  48. }
  49.  
  50.