This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ld: memory assignments


   Date: Wed, 26 Apr 2000 13:10:28 +0200
   From: Wolfram Wadepohl <W.Wadepohl@indumat.de>

   using gcc for cross m68k development i have a problem in assigning the
   sections to memory regions. the linker script is

   MEMORY {
      flash    :  ORIGIN = 0x01200000, LENGTH = 6M
      dram     :  ORIGIN = 0x04000000, LENGTH = 1M
      }

   OUTPUT_FORMAT ( COFF )

   SECTIONS {
      .data : AT ( ADDR(.text) + SIZEOF(.text) ) {
	 } > dram = 0x0

      .text : {
	 } > flash = 0xFF

      .bss : {
	 } > dram = 0x0
      }

   The linker does not locate the .text section as exspected to the region
   beginning at 0x1200000. It locates it starting at 0x1000000 instead and
   fails because the end of the .text section is not in the flash region.

You haven't told the linker where to put any of the input sections.
You need something like
    .text : { *(.text) } > flash = 0xFF
and so on.  The linker does not make any assumptions about input
sections based on the output sections.

Ian

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]