Linker script for GNU cross tools

From: Rob Savoye <rob_at_nospam.org>
Date: Fri Dec 24 1993 - 07:55:56 PST

  Here's a linker script that can be used with either a stock FSF i386-aout
tool chain or djgpp. Save this script as "vsta.ld" and when you invoke gcc,
use -Tvsta.ld. You can use it from just ld, but you'll need a complete path.
I hope to crank out a whole tool chain for vsta that'll run on sun4 and Linux.
(and more). This script sets up the entry point, and the memory map. (etext is
always in the right place :-) It also sets up G++ tables for when I get that
up.

  Hacker hints, build a "i386-aout" tool chain from the FSF and install it.
in /usr/local/i386-aout/lib put vsta.ld and copy the vsta crt0.o there. (named
crt0-vsta.o) replace the existing libc.a (if you built one) with the libc.a
from vsta. Then you can do all your compiles as "i386-aout-gcc -Tvsta.ld" and
it all works.

        - rob -

---------------------------------------------------------------
STARTUP(crt0-vsta.o)
ENTRY(start)
OUTPUT_FORMAT(a.out-i386)
OUTPUT_ARCH(i386)
SEARCH_DIR(.)
__DYNAMIC = 0;

MEMORY
{
  textram : ORIGIN = 0x1020, LENGTH = 2M
  dataram : ORIGIN = 0x400000, LENGTH = 2M
}

/*
 * stick everything in ram (of course)
 */
SECTIONS
{
  .text :
  {
    CREATE_OBJECT_SYMBOLS
    *(.text)
     etext = .;
     __CTOR_LIST__ = .;
     LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
    *(.ctors)
     LONG(0)
     __CTOR_END__ = .;
     __DTOR_LIST__ = .;
     LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
    *(.dtors)
     LONG(0)
     __DTOR_END__ = .;
    *(.lit)
    *(.shdata)
  } > textram
  .shbss SIZEOF(.text) + ADDR(.text) : {
    *(.shbss)
  }
  .talias : { } > textram
  .data : {
    *(.data)
    CONSTRUCTORS
    _edata = .;
  } > dataram

  .bss SIZEOF(.data) + ADDR(.data) :
  {
   __bss_start = ALIGN(0x8);
   *(.bss)
   *(COMMON)
      end = ALIGN(0x8);
      _end = ALIGN(0x8);
  }
  .stab . (NOLOAD) :
  {
    [ .stab ]
  }
  .stabstr . (NOLOAD) :
  {
    [ .stabstr ]
  }
}
Received on Fri Dec 24 08:02:42 1993

This archive was generated by hypermail 2.1.8 : Wed Sep 21 2005 - 21:01:53 PDT