startup embedded target

Vermeulen Jan
Fri Jul 20 00:50:00 GMT 2001

Hello everybody,

I've been making a led-test program for my 68040 target.
Everything compiles fine (both the making of the cross-compiler and the test

However, the linker-script i'm making has a few problems. (caused by me no

I got a flash rom and some ram in my board.
The first 4 bytes of the flash should be the stack-pointer (0x0B40000), the
following 4 bytes should be the start address of my program ('main', which
should be at 0x400).

I have been looking at the info-pages of the 'ld', but i don't really know
how to force those constants at 0x0 and 0x4.

This might be somewhat a newbie question, but i'm kind of stuck to be
I will include my linker script with which i'm toying at the moment.


OUTPUT_ARCH(m68k)   /* Specify the output machine architecture to be m68k.
OUTPUT_FORMAT(ieee) /* Output format. Should be srec (S-records).*/
                    /* Same as the --oformat command-line option.       */

PROVIDE (__stack = 0x0B40000);


  /* Flash; Read-only, execute     */
  rom1 (rx): ORIGIN = 0x0,         LENGTH = 512K
  /* Internal SRAM; RW, no execute */
  ramcode (rwx): ORIGIN = 0x800000, LENGTH = 2048K
  ramdata (rw): ORIGIN = 0x0A00000, LENGTH = 2048K

  .vector0 :
    { . = 0x0} = __stack;
  .vector1 :
    { . = 0x4} = &main;
  .text :
    } > rom1
  .data :
    } > rom1
  .bss  :
      end = ALIGN(0x8);
    } > ramdata


Best regards, and thanks,
Jan Vermeulen

Want more information?  See the CrossGCC FAQ,
Want to unsubscribe? Send a note to

More information about the crossgcc mailing list