summaryrefslogblamecommitdiffstats
path: root/bsps/powerpc/virtex4/start/linkcmds
blob: cb867da2e62357d330b745a9548933937e20435a (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                                              
                
                     

                      



                                                                                
                                      




                                                                               

                                                            




        



                                                                           



























































                                                                                
                                                                                         

                                                                              












                                                   

                                                                           

                                                
                                                           
 
                                                           
                                                                                                             























                                                                               
                                                   



















                                                                              

                                             
                                                

                                                                                   



                                              




                                                                                   
























                                                                              




                                                                   





                                                       
                                                 











                                                                                




                                                                                       





















                                                                              




                          







                                                         
                      














                                                                         
/*
 *  This file contains directives for the GNU linker which are specific to the
 *  Virtex 4 PPC 405.  No assumptions are made on the firmware in the FPGA.
 *  This file is intended to be used together with start.S to generate
 *  downloadable code.
 */

OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
OUTPUT_ARCH(powerpc)

STARTUP(start.o)
ENTRY(download_entry)
EXTERN(download_entry)
EXTERN(__vectors)

MsgAreaSize       = DEFINED(MsgAreaSize)   ? MsgAreaSize   : 1M;
RamBase           = DEFINED(RamBase)       ? RamBase       : 0x0;
RamSize           = DEFINED(RamSize)       ? RamSize       : 128M - MsgAreaSize;
RamEnd            = RamBase + RamSize;
HeapSize          = DEFINED(HeapSize)      ? HeapSize      : 0; /* 0=Use def */


MEMORY
{
  VECTORS         : ORIGIN = 0x00000000, LENGTH = 12K
  RAM             : ORIGIN = 0x00003000, LENGTH = 128M - 12K
}


SECTIONS
{
  bsp_exc_vector_base = 0x100;
  __exeentry          = download_entry;
  __exestart          = bsp_exc_vector_base;
  .vectors bsp_exc_vector_base : { *(.vectors)                  } > VECTORS

  /* Read-only sections, merged into text segment: */
  .interp         : { *(.interp)                                } > RAM
  .hash           : { *(.hash)                                  } > RAM
  .dynsym         : { *(.dynsym)                                } > RAM
  .dynstr         : { *(.dynstr)                                } > RAM
  .gnu.version    : { *(.gnu.version)                           } > RAM
  .gnu.version_d  : { *(.gnu.version_d)                         } > RAM
  .gnu.version_r  : { *(.gnu.version_r)                         } > RAM
  .rela.text      : { *(.rela.text) *(.rela.gnu.linkonce.t*)    } > RAM
  .rela.data      : { *(.rela.data) *(.rela.gnu.linkonce.d*)    } > RAM
  .rela.rodata    : { *(.rela.rodata*) *(.rela.gnu.linkonce.r*) } > RAM
  .rela.got       : { *(.rela.got)                              } > RAM
  .rela.got1      : { *(.rela.got1)                             } > RAM
  .rela.got2      : { *(.rela.got2)                             } > RAM
  .rela.ctors     : { *(.rela.ctors)                            } > RAM
  .rela.dtors     : { *(.rela.dtors)                            } > RAM
  .rela.init      : { *(.rela.init)                             } > RAM
  .rela.fini      : { *(.rela.fini)                             } > RAM
  .rela.bss       : { *(.rela.bss)                              } > RAM
  .rela.plt       : { *(.rela.plt)                              } > RAM
  .rela.sdata     : { *(.rela.sdata)                            } > RAM
  .rela.sbss      : { *(.rela.sbss)                             } > RAM
  .rela.sdata2    : { *(.rela.sdata2)                           } > RAM
  .rela.sbss2     : { *(.rela.sbss2)                            } > RAM
  .rela.dyn       : { *(.rela.dyn)                              } > RAM

  /* Initialization code */
  .init           : { PROVIDE (_init = .);
                      *ecrti.o(.init)
                      KEEP(*(.init))
                      *ecrtn.o(.init)
                    } > RAM

  .text           : { *(.entry)
                      *(.text)
                      *(.text.*)

                      /* Special FreeBSD sysctl sections */
                      . = ALIGN (16);
                      __start_set_sysctl_set = .;
                      *(set_sysctl_*);
                      __stop_set_sysctl_set = ABSOLUTE(.);
                      *(set_domain_*);
                      *(set_pseudo_*);

                      /* .gnu.warning sections are handled specially by elf32.em
                       */
                      *(.gnu.warning)
                      *(.gnu.linkonce.t*)
                    } > RAM

  /* Finalization code */
  .fini           : { PROVIDE (_fini = .);
                      *ecrti.o(.fini)
                      KEEP(*(.fini))
                      *ecrtn.o(.fini)
                    } > RAM

  /* Miscellaneous read-only data */
  .rodata         : { *(.rodata.* .gnu.linkonce.r*) KEEP (*(SORT(.rtemsroset.*))) } > RAM
  .rodata1        : { *(.rodata1)                                      } > RAM

  .tdata : {
    _TLS_Data_begin = .;
    *(.tdata .tdata.* .gnu.linkonce.td.*)
    _TLS_Data_end = .;
  } >RAM

  .tbss : {
    _TLS_BSS_begin = .;
    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
    _TLS_BSS_end = .;
  } >RAM

  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
  _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
  _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
  _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));

  /* Initialised small data addressed as offsets from r2 */
  .sdata2         : { PROVIDE (_SDA2_BASE_ = 32768); *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)          } > RAM

  /* Zeroed small data addressed as offsets from r2 */
  .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)

                      /* Avoid empty sdata2/sbss2 area: __eabi would not set up
                       * r2 which may be important if run-time loading is used
                       */
                      . += 1;

                      PROVIDE (__SBSS2_END__ = .);
                    } > RAM

  /* Exception frame info */
  .eh_frame       : { *(.eh_frame .eh_frame.*)                         } > RAM
  .eh_frame_hdr   : { *(.eh_frame_hdr)                                 } > RAM

  /*  Declares where the .text section ends */
  _etext          = .;
  PROVIDE (etext  = .);

  /* Initialized R/W Data section goes in RAM */
  .data           : { PROVIDE(__DATA_START__ = ABSOLUTE(.) );
                      *(.data)
                      *(.data.*)
                      KEEP (*(SORT(.rtemsrwset.*)))
                      *(.gnu.linkonce.d*)
                    } > RAM

  .data1          : { *(.data1)                                        } > RAM

                        PROVIDE (__EXCEPT_START__ = .);
  .gcc_except_table : { *(.gcc_except_table .gcc_except_table.*)       } > RAM
                        PROVIDE (__EXCEPT_END__ = .);

  .got1           : { *(.got1)                                         } > RAM

  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
   * get relocated with -mrelocatable. Also put in the .fixup pointers.
   * The current compiler no longer needs this, but keep it around for 2.7.2.
   */
                      PROVIDE (_GOT2_START_ = .);
  .got2           : { *(.got2)                                         } > RAM

  .dynamic        : { *(.dynamic)                                      } > RAM

  .ctors          : {
                      KEEP (*ecrti.o(.ctors))
                      KEEP (*crtbegin.o(.ctors))
                      KEEP (*crtbegin?.o(.ctors))
                      KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o *ecrtn.o) .ctors))
                      KEEP (*(SORT(.ctors.*)))
                      KEEP (*(.ctors))
                    } > RAM

  .dtors          : {
                      KEEP (*ecrti.o(.dtors))
                      KEEP (*crtbegin.o(.dtors))
                      KEEP (*crtbegin?.o(.dtors))
                      KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o *ecrtn.o) .dtors))
                      KEEP (*(SORT(.dtors.*)))
                      KEEP (*(.dtors))
                    } > RAM

                      PROVIDE (_FIXUP_START_ = .);
  .fixup          : { *(.fixup)                                        } > RAM
                      PROVIDE (_FIXUP_END_ = .);

                      PROVIDE (_GOT2_END_ = .);

                      PROVIDE (_GOT_START_ = .);
  .got            : { __got_start = .;
                      *(.got)
                    } > RAM

  .got.plt        : { *(.got.plt)                                      } > RAM
                      PROVIDE (_GOT_END_ = .);

  .jcr            : { KEEP (*(.jcr))                                   } > RAM

  /* We want the small data sections together, so single-instruction offsets
   * can access them all, and initialized data all before uninitialized, so
   * we can shorten the on-disk segment size.
   */
  /* Initialised small data addressed as offsets from r13 */
  .sdata          : {
	bsp_section_sdata_begin = .;
  	PROVIDE (_SDA_BASE_ = 32768); *(.sdata* .gnu.linkonce.s.*);
	bsp_section_sdata_end = .;
   } > RAM

  _edata          = .;
  PROVIDE (edata  = .);

  /* Zeroed small data addressed as offsets from r13 */
  .sbss           : { PROVIDE (__sbss_start = .);
  		      bsp_section_sbss_begin = .;
                      *(.dynsbss)
                      *(.sbss*)
                      *(.gnu.linkonce.sb.*)
                      *(.scommon)

                      /* Avoid empty sdata/sbss area: __eabi would not set up
                       * r13, which may be important if run-time loading is used
                       */
                      . += 1;

                      PROVIDE (__SBSS_END__ = .);
                      PROVIDE (__sbss_end   = .);
		      bsp_section_sbss_end = .;
		      bsp_section_sdata_libdl_begin = .;
		      . = DEFINED(bsp_section_small_data_area_size) ?
			bsp_section_sdata_begin + bsp_section_small_data_area_size : .;
		      bsp_section_sdata_libdl_end = .;
                    } > RAM

  .plt            : { *(.plt)                                          } > RAM
  .iplt           : { *(.iplt)                                         } > RAM

  /* Zeroed large data */
  .bss            : { PROVIDE (__bss_start = .);
                      *(.dynbss)
                      *(.bss)
                      *(.bss.*)
                      *(.gnu.linkonce.b*)
                      *(COMMON)

                      PROVIDE (__bss_end = ALIGN(4));
                      __bss_size = __bss_end - __bss_start;
                    } > RAM

  __exeend        = ALIGN(4);
  __rtems_end     = .;
  .               = ALIGN(0x10);        /* Align to a cache-line boundary */
  PROVIDE(__bsp_ram_start = .);

  .rtemsstack (NOLOAD) : {
    *(SORT(.rtemsstack.*))
  } >RAM

  WorkAreaBase = .;

  /* The heap comes after the work space */

   .              = RamBase + RamSize;
  PROVIDE(__bsp_ram_end = .);

  /* Message area for capturing early printk output */
  /* Placed here to be easily findable with a debugger */
  MsgAreaBase     = .;
  .              += MsgAreaSize;

  __phy_ram_end   = .;                  /* True end of physical memory */

  /DISCARD/ :
  {
    *(.comment)
  }

  /* Some configuration constants: Not clear why they're placed here */
  __dccr          = 0x80000000;
  __iccr          = 0x80000000;
  __sgr           = 0x7fffffff;
  __vectors       = 0;
}