File:  [Apple XNU] / GNUtools / cc / config / m68k / next.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:45:41 2018 UTC (8 years, 2 months ago) by root
Branches: MAIN, Apple
CVS tags: HEAD, GNUtools33
GNU tools for NeXTSTEP 3.3

/* next.c:  Functions for NeXT as target machine for GNU C compiler.  */

/* Note that the include below means that we can't debug routines in
   m68k.c when running on a COFF system.  */

#include "m68k/m68k.c"
#include "nextstep.c"

void
machopic_output_stub (file, symb, stub)
     FILE *file;
     const char *symb, *stub;
{
  if (MACHOPIC_PURE)
    machopic_picsymbol_stub_section ();
  else
    machopic_symbol_stub_section ();

  fprintf (file, "%s:\n", stub);
  fprintf (file, "\t.indirect_symbol %s\n", symb);

  if (MACHOPIC_PURE)
    {
      fprintf (file, "\tmovel pc@(L%s$lazy_ptr-.),a0\n\tjmp a0@\n", symb);
    }
  else
    {
      fprintf (file, "\tmovel @(L%s$lazy_ptr),a0\n\tjmp a0@\n", symb);
    }
  
  fprintf (file, "%s_binder:\n", stub);
  
  if (MACHOPIC_PURE)
    {
      fprintf (file, "\tpea pc@(L%s$lazy_ptr-.)\n", symb);
    }
  else
    {
      fprintf (file, "\tmovel #L%s$lazy_ptr,sp@-\n", symb);
    }

  fprintf (file, "\tbra dyld_stub_binding_helper\n");

  machopic_lazy_symbol_ptr_section ();
  fprintf (file, "L%s$lazy_ptr:\n", symb);
  fprintf (file, "\t.indirect_symbol %s\n", symb);
  fprintf (file, "\t.long %s_binder\n", stub);
}


unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.