Back to home page

LXR

 
 

    


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