Back to home page

LXR

 
 

    


Warning, /bsps/lm32/milkymist/start/linkcmds is written in an unsupported language. File is not indexed.

0001 OUTPUT_FORMAT("elf32-lm32", "elf32-lm32",
0002               "elf32-lm32")
0003 OUTPUT_ARCH(lm32)
0004 ENTRY(start)
0005 STARTUP(start.o)
0006 /* Do we need any of these for elf?
0007    __DYNAMIC = 0;    */
0008 
0009 /*
0010  * Declare some sizes. Heap is sized at whatever ram space is left.
0011  */
0012 RamBase = DEFINED(RamBase) ? RamBase : 0x40000000;
0013 RamSize = DEFINED(RamSize) ? RamSize : 128M;
0014 RamEnd = RamBase + RamSize;
0015 HeapSize = DEFINED(HeapSize) ? HeapSize : 92M;
0016 
0017 MEMORY {
0018         sdram   : ORIGIN = 0x40000000 , LENGTH = 128M
0019 }
0020 SECTIONS
0021 {
0022   .boot :
0023   {
0024     KEEP (*(.boot))
0025   } > sdram
0026 
0027   /* Read-only sections, merged into text segment: */
0028   .interp   : { *(.interp) }    > sdram
0029   .hash           : { *(.hash)          }       > sdram
0030   .dynsym         : { *(.dynsym)                }       > sdram
0031   .dynstr         : { *(.dynstr)                }       > sdram
0032   .gnu.version   : { *(.gnu.version)      }     > sdram
0033   .gnu.version_d   : { *(.gnu.version_d)  }     > sdram
0034   .gnu.version_r   : { *(.gnu.version_r)  }     > sdram
0035   .rela.text     :
0036     { *(.rela.text) *(.rela.gnu.linkonce.t*) }  > sdram
0037   .rela.data     :
0038     { *(.rela.data) *(.rela.gnu.linkonce.d*) }  > sdram
0039   .rela.rodata   :
0040     { *(.rela.rodata*) *(.rela.gnu.linkonce.r*) }       > sdram
0041   .rela.got       : { *(.rela.got)      }       > sdram
0042   .rela.got1      : { *(.rela.got1)     }       > sdram
0043   .rela.got2      : { *(.rela.got2)     }       > sdram
0044   .rela.ctors     : { *(.rela.ctors)    }       > sdram
0045   .rela.dtors     : { *(.rela.dtors)    }       > sdram
0046   .rela.init      : { *(.rela.init)     }       > sdram
0047   .rela.fini      : { *(.rela.fini)     }       > sdram
0048   .rela.bss       : { *(.rela.bss)      }       > sdram
0049   .rela.plt       : { *(.rela.plt)      }       > sdram
0050   .rela.sdata     : { *(.rela.sdata)    }       > sdram
0051   .rela.sbss      : { *(.rela.sbss)     }       > sdram
0052   .rela.sdata2    : { *(.rela.sdata2)   }       > sdram
0053   .rela.sbss2     : { *(.rela.sbss2)    }       > sdram
0054   .rela.dyn       : { *(.rela.dyn)      }       > sdram
0055 
0056   .init           : { KEEP(*(.init))            } > sdram
0057 
0058   .text      :  
0059   {
0060     *(.text*)   
0061 
0062     /*
0063      * Special FreeBSD sysctl sections.
0064      */
0065     . = ALIGN (16);
0066     __start_set_sysctl_set = .;
0067     *(set_sysctl_*);
0068     __stop_set_sysctl_set = ABSOLUTE(.);
0069     *(set_domain_*);
0070     *(set_pseudo_*);
0071 
0072     /* .gnu.warning sections are handled specially by elf32.em.  */
0073     *(.gnu.warning)
0074     *(.gnu.linkonce.t*)
0075   }  > sdram
0076 
0077   .fini           : { _fini = .; KEEP(*(.fini)) } > sdram
0078 
0079   .rodata         : { *(.rodata*) KEEP (*(SORT(.rtemsroset.*))) *(.gnu.linkonce.r*) }   > sdram
0080   .rodata1        : { *(.rodata1) }     > sdram
0081   .tdata : {
0082     _TLS_Data_begin = .;
0083     *(.tdata .tdata.* .gnu.linkonce.td.*)
0084     _TLS_Data_end = .;
0085   } > sdram
0086   .tbss : {
0087     _TLS_BSS_begin = .;
0088     *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
0089     _TLS_BSS_end = .;
0090   } > sdram
0091   _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
0092   _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
0093   _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
0094   _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
0095   _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
0096   _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
0097 
0098   /* Adjust the address for the data segment.  We want to adjust up to
0099      the same address within the page on the next page up.  */
0100   . = ALIGN(0x10000) + (. & (0x10000 - 1));
0101   /* Ensure the __preinit_array_start label is properly aligned.  We
0102      could instead move the label definition inside the section, but
0103      the linker would then create the section even if it turns out to
0104      be empty, which isn't pretty.  */
0105   . = ALIGN(32 / 8);
0106   PROVIDE (__preinit_array_start = .);
0107   .preinit_array     : { *(.preinit_array) } >sdram
0108   PROVIDE (__preinit_array_end = .);
0109   PROVIDE (__init_array_start = .);
0110   .init_array     : { *(.init_array) } >sdram
0111   PROVIDE (__init_array_end = .);
0112   PROVIDE (__fini_array_start = .);
0113   .fini_array     : { *(.fini_array) } >sdram
0114   PROVIDE (__fini_array_end = .);
0115 
0116 /* _SDA2_BASE_ = __SDATA2_START__ + 0xe000; */
0117   .sdata2         : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) } >sdram
0118   .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) 
0119                         /* avoid empty sdata2/sbss2 area -- __eabi would not set up r2
0120                          * which may be important if run-time loading is used
0121                          */
0122                      . += 1;
0123                     } >sdram
0124   .eh_frame       : { *.(eh_frame)              } >sdram
0125 
0126   /* NOTE: if the BSP uses page tables, the correctness of
0127    *       '_etext' (and __DATA_START__) is CRUCIAL - otherwise,
0128    *       an invalid mapping may result!!!
0129    */
0130   _etext = .;
0131   PROVIDE (etext = .);
0132 
0133   /* Adjust the address for the data segment.  We want to adjust up to
0134      the same address within the page on the next page up.  It would
0135      be more correct to do this:
0136        . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1));
0137      The current expression does not correctly handle the case of a
0138      text segment ending precisely at the end of a page; it causes the
0139      data segment to skip a page.  The above expression does not have
0140      this problem, but it will currently (2/95) cause BFD to allocate
0141      a single segment, combining both text and data, for this case.
0142      This will prevent the text segment from being shared among
0143      multiple executions of the program; I think that is more
0144      important than losing a page of the virtual address space (note
0145      that no actual memory is lost; the page which is skipped can not
0146      be referenced).  */
0147   . = ALIGN(0x1000);
0148  .data ALIGN(0x1000) :
0149   {
0150    /* NOTE: if the BSP uses page tables, the correctness of
0151     *       '__DATA_START__' (and _etext) is CRUCIAL - otherwise,
0152     *       an invalid mapping may result!!!
0153     */
0154         PROVIDE(__DATA_START__ = ABSOLUTE(.) );
0155     *(.data .data.* .gnu.linkonce.d*)   
0156     KEEP (*(SORT(.rtemsrwset.*)))
0157     SORT(CONSTRUCTORS)
0158   } > sdram
0159   .data1   : { *(.data1) }      > sdram
0160   PROVIDE (__EXCEPT_START__ = .);
0161   .gcc_except_table   : {
0162     *(.gcc_except_table)
0163     *(.gcc_except_table.*)
0164   } > sdram
0165   PROVIDE (__EXCEPT_END__ = .);
0166   .got1           : { *(.got1) }        > sdram
0167   /* Put .ctors and .dtors next to the .got2 section, so that the pointers
0168      get relocated with -mrelocatable. Also put in the .fixup pointers.
0169      The current compiler no longer needs this, but keep it around for 2.7.2  */
0170                 PROVIDE (_GOT2_START_ = .);
0171   .got2           :  { *(.got2) }       > sdram
0172   .dynamic        : { *(.dynamic) }     > sdram
0173 
0174   .ctors          :
0175   {
0176     /* gcc uses crtbegin.o to find the start of
0177        the constructors, so we make sure it is
0178        first.  Because this is a wildcard, it
0179        doesn't matter if the user does not
0180        actually link against crtbegin.o; the
0181        linker won't look for a file to match a
0182        wildcard.  The wildcard also means that it
0183        doesn't matter which directory crtbegin.o
0184        is in.  */
0185     KEEP (*crtbegin.o(.ctors))
0186     /* We don't want to include the .ctor section from
0187        from the crtend.o file until after the sorted ctors.
0188        The .ctor section from the crtend file contains the
0189        end of ctors marker and it must be last */
0190     KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
0191     KEEP (*(SORT(.ctors.*)))
0192     KEEP (*(.ctors))
0193   } > sdram
0194   .dtors          :
0195   {
0196     KEEP (*crtbegin.o(.dtors))
0197     KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
0198     KEEP (*(SORT(.dtors.*)))
0199     KEEP (*(.dtors))
0200   } > sdram
0201 
0202 
0203                 PROVIDE (_FIXUP_START_ = .);
0204   .fixup          : { *(.fixup) }       > sdram
0205                 PROVIDE (_FIXUP_END_ = .);
0206                 PROVIDE (_GOT2_END_ = .);
0207                 PROVIDE (_GOT_START_ = .);
0208 
0209   .got            : { *(.got) } > sdram
0210   .got.plt        : { *(.got.plt) }     > sdram
0211 
0212                 PROVIDE (_GOT_END_ = .);
0213 
0214   .jcr            : { KEEP (*(.jcr)) } > sdram
0215 
0216   /* We want the small data sections together, so single-instruction offsets
0217      can access them all, and initialized data all before uninitialized, so
0218      we can shorten the on-disk segment size.  */
0219 /* _SDA_BASE_ = __SDATA_START__ + 0xe000; */
0220   .sdata          : { *(.sdata*) *(.gnu.linkonce.s.*)   } >sdram
0221   _edata  =  .;
0222   _gp = .;
0223   PROVIDE (edata = .);
0224   .sbss      :
0225   {
0226     _clear_start = .;
0227     PROVIDE (__sbss_start = .);
0228     *(.dynsbss)
0229     *(.sbss* .gnu.linkonce.sb.*)
0230     *(.scommon)
0231     /* avoid empty sdata/sbss area -- __eabi would not set up r13
0232      * which may be important if run-time loading is used
0233      */
0234     . += 1;
0235     . = ALIGN(16);
0236     PROVIDE (__sbss_end = .);
0237   } > sdram
0238   .plt   : { *(.plt) }  > sdram
0239   .bss       :
0240   {
0241    PROVIDE (__bss_start = .);
0242    *(.dynbss)
0243    *(.bss .bss* .gnu.linkonce.b*)
0244    *(COMMON)
0245   . = ALIGN(16);
0246   _end = . ;
0247   __rtems_end = . ;
0248   PROVIDE (end = .);
0249 
0250     . = ALIGN (16);
0251     _clear_end = .;
0252   } > sdram
0253 
0254   .noinit (NOLOAD) : {
0255     *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*)))
0256   } > sdram
0257 
0258   .rtemsstack (NOLOAD) : {
0259     *(SORT(.rtemsstack.*))
0260     WorkAreaBase = .;
0261   } > sdram
0262 
0263   /DISCARD/ : 
0264   {
0265     *(.comment)
0266   }
0267 
0268 
0269   /* Stabs debugging sections.  */
0270   .stab 0 : { *(.stab) }
0271   .stabstr 0 : { *(.stabstr) }
0272   .stab.excl 0 : { *(.stab.excl) }
0273   .stab.exclstr 0 : { *(.stab.exclstr) }
0274   .stab.index 0 : { *(.stab.index) }
0275   .stab.indexstr 0 : { *(.stab.indexstr) }
0276   .comment 0 : { *(.comment) }
0277 
0278   /* DWARF debug sections.
0279      Symbols in the DWARF debugging sections are relative to the beginning
0280      of the section so we begin them at 0.  */
0281   /* DWARF 1 */
0282   .debug          0 : { *(.debug) }
0283   .line           0 : { *(.line) }
0284   
0285   /* GNU DWARF 1 extensions */
0286   .debug_srcinfo  0 : { *(.debug_srcinfo) }
0287   .debug_sfnames  0 : { *(.debug_sfnames) }
0288   
0289   /* DWARF 1.1 and DWARF 2 */
0290   .debug_aranges  0 : { *(.debug_aranges) }
0291   .debug_pubnames 0 : { *(.debug_pubnames) }
0292   
0293   /* DWARF 2 */
0294   .debug_info     0 : { *(.debug_info) }
0295   .debug_abbrev   0 : { *(.debug_abbrev) }
0296   .debug_line     0 : { *(.debug_line) }
0297   .debug_frame    0 : { *(.debug_frame) }
0298   .debug_str      0 : { *(.debug_str) }
0299   .debug_loc      0 : { *(.debug_loc) }
0300   .debug_macinfo  0 : { *(.debug_macinfo) }
0301   
0302   /* SGI/MIPS DWARF 2 extensions */
0303   .debug_weaknames 0 : { *(.debug_weaknames) }
0304   .debug_funcnames 0 : { *(.debug_funcnames) }
0305   .debug_typenames 0 : { *(.debug_typenames) }
0306   .debug_varnames  0 : { *(.debug_varnames) }
0307   /* These must appear regardless of  .  */
0308 
0309   /* Addition to let linker know about custom section for GDB pretty-printing support. */
0310   .debug_gdb_scripts 0 : { *(.debug_gdb_scripts) }
0311 }