Back to home page

LXR

 
 

    


Warning, /bsps/or1k/shared/start/linkcmds.base is written in an unsupported language. File is not indexed.

0001 /**
0002  * @file
0003  *
0004  * @ingroup bsp_linker
0005  *
0006  * @brief Linker command base file.
0007  */
0008 
0009 /*
0010  * COPYRIGHT (c) 2014 Hesham ALMatary <heshamelmatary@gmail.com>
0011  *
0012  * The license and distribution terms for this file may be
0013  * found in the file LICENSE in this distribution or at
0014  * http://www.rtems.org/license/LICENSE
0015  */
0016 
0017 OUTPUT_ARCH (or1k)
0018 
0019 ENTRY (_start)
0020 STARTUP (start.o)
0021 
0022 /*
0023  * Global symbols that may be defined externally
0024  */
0025 
0026 bsp_start_vector_table_begin = 0x1F00;
0027 bsp_vector_table_size = DEFINED (bsp_vector_table_size) ? bsp_vector_table_size
0028 : 8260;
0029 /* 8192 for raw vector table, and 17 * 4 for handlers vector. */
0030 
0031 bsp_section_xbarrier_align  = DEFINED (bsp_section_xbarrier_align) ? bsp_section_xbarrier_align : 1;
0032 bsp_section_robarrier_align = DEFINED (bsp_section_robarrier_align) ? bsp_section_robarrier_align : 1;
0033 bsp_section_rwbarrier_align = DEFINED (bsp_section_rwbarrier_align) ? bsp_section_rwbarrier_align : 1;
0034 
0035 bsp_stack_align = DEFINED (bsp_stack_align) ? bsp_stack_align : 8;
0036 
0037 SECTIONS {
0038 
0039   .vector : ALIGN_WITH_INPUT {
0040     *(.vector)
0041     . = ALIGN(bsp_vector_table_size);
0042     bsp_section_vector_end = .;
0043   } > REGION_VECTOR AT > REGION_VECTOR
0044   bsp_section_vector_size = bsp_section_vector_end - bsp_section_vector_begin;
0045   bsp_vector_table_begin = bsp_section_vector_begin;
0046   bsp_vector_table_end = bsp_vector_table_begin + bsp_vector_table_size;
0047 
0048   .start : ALIGN_WITH_INPUT {
0049     bsp_section_start_begin = .;
0050     KEEP (*(.bsp_start_text))
0051     KEEP (*(.bsp_start_data))
0052     bsp_section_start_end = .;
0053   } > REGION_START AT > REGION_START
0054   bsp_section_start_size = bsp_section_start_end - bsp_section_start_begin;
0055 
0056 .xbarrier : ALIGN_WITH_INPUT {
0057     . = ALIGN (bsp_section_xbarrier_align);
0058   } > REGION_VECTOR AT > REGION_VECTOR
0059 
0060 .text : ALIGN_WITH_INPUT {
0061     bsp_section_text_begin = .;
0062     *(.text.unlikely .text.*_unlikely)
0063     *(.text .stub .text.* .gnu.linkonce.t.*)
0064     /* .gnu.warning sections are handled specially by elf32.em.  */
0065     *(.gnu.warning)
0066     *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)
0067   } > REGION_TEXT AT > REGION_TEXT_LOAD
0068   .init : ALIGN_WITH_INPUT {
0069     KEEP (*(.init))
0070   } > REGION_TEXT AT > REGION_TEXT_LOAD
0071   .fini : ALIGN_WITH_INPUT {
0072     KEEP (*(.fini))
0073     bsp_section_text_end = .;
0074   } > REGION_TEXT AT > REGION_TEXT_LOAD
0075   bsp_section_text_size = bsp_section_text_end - bsp_section_text_begin;
0076   bsp_section_text_load_begin = LOADADDR (.text);
0077   bsp_section_text_load_end = bsp_section_text_load_begin + bsp_section_text_size;
0078 
0079 .robarrier : ALIGN_WITH_INPUT {
0080     . = ALIGN (bsp_section_robarrier_align);
0081   } > REGION_RODATA AT > REGION_RODATA
0082 
0083 .rodata : ALIGN_WITH_INPUT {
0084     bsp_section_rodata_begin = .;
0085     *(.rodata .rodata.* .gnu.linkonce.r.*)
0086   } > REGION_RODATA AT > REGION_RODATA_LOAD
0087 .eh_frame : ALIGN_WITH_INPUT {
0088                KEEP (*(.eh_frame))
0089        } > REGION_RODATA AT > REGION_RODATA_LOAD
0090        .gcc_except_table : ALIGN_WITH_INPUT {
0091                *(.gcc_except_table .gcc_except_table.*)
0092        } > REGION_RODATA AT > REGION_RODATA_LOAD
0093        .tdata : ALIGN_WITH_INPUT {
0094                _TLS_Data_begin = .;
0095                *(.tdata .tdata.* .gnu.linkonce.td.*)
0096                _TLS_Data_end = .;
0097        } > REGION_RODATA AT > REGION_RODATA_LOAD
0098        .tbss : ALIGN_WITH_INPUT {
0099                _TLS_BSS_begin = .;
0100                *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
0101                _TLS_BSS_end = .;
0102        } > REGION_RODATA AT > REGION_RODATA_LOAD
0103        _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
0104        _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
0105        _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
0106        _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
0107        _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
0108        _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
0109        .preinit_array : ALIGN_WITH_INPUT {
0110                PROVIDE_HIDDEN (__preinit_array_start = .);
0111                KEEP (*(.preinit_array))
0112                PROVIDE_HIDDEN (__preinit_array_end = .);
0113        } > REGION_RODATA AT > REGION_RODATA_LOAD
0114        .init_array : ALIGN_WITH_INPUT {
0115                PROVIDE_HIDDEN (__init_array_start = .);
0116                KEEP (*(SORT(.init_array.*)))
0117                KEEP (*(.init_array))
0118                PROVIDE_HIDDEN (__init_array_end = .);
0119        } > REGION_RODATA AT > REGION_RODATA_LOAD
0120        .fini_array : ALIGN_WITH_INPUT {
0121                PROVIDE_HIDDEN (__fini_array_start = .);
0122                KEEP (*(.fini_array))
0123                KEEP (*(SORT(.fini_array.*)))
0124                PROVIDE_HIDDEN (__fini_array_end = .);
0125        } > REGION_RODATA AT > REGION_RODATA_LOAD
0126        .ctors : ALIGN_WITH_INPUT {
0127                /* gcc uses crtbegin.o to find the start of
0128                   the constructors, so we make sure it is
0129                   first.  Because this is a wildcard, it
0130                   doesn't matter if the user does not
0131                   actually link against crtbegin.o; the
0132                   linker won't look for a file to match a
0133                   wildcard.  The wildcard also means that it
0134                   doesn't matter which directory crtbegin.o
0135                   is in.  */
0136                KEEP (*crtbegin.o(.ctors))
0137                KEEP (*crtbegin?.o(.ctors))
0138                /* We don't want to include the .ctor section from
0139                   the crtend.o file until after the sorted ctors.
0140                   The .ctor section from the crtend file contains the
0141                   end of ctors marker and it must be last */
0142                KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
0143                KEEP (*(SORT(.ctors.*)))
0144                KEEP (*(.ctors))
0145        } > REGION_RODATA AT > REGION_RODATA_LOAD
0146        .dtors : ALIGN_WITH_INPUT {
0147                KEEP (*crtbegin.o(.dtors))
0148                KEEP (*crtbegin?.o(.dtors))
0149                KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
0150                KEEP (*(SORT(.dtors.*)))
0151                KEEP (*(.dtors))
0152        } > REGION_RODATA AT > REGION_RODATA_LOAD
0153        .data.rel.ro : ALIGN_WITH_INPUT {
0154                *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*)
0155                *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*)
0156        } > REGION_RODATA AT > REGION_RODATA_LOAD
0157        .jcr : ALIGN_WITH_INPUT {
0158                KEEP (*(.jcr))
0159        } > REGION_RODATA AT > REGION_RODATA_LOAD
0160        .interp : ALIGN_WITH_INPUT {
0161                *(.interp)
0162        } > REGION_RODATA AT > REGION_RODATA_LOAD
0163        .note.gnu.build-id : ALIGN_WITH_INPUT {
0164                *(.note.gnu.build-id)
0165        } > REGION_RODATA AT > REGION_RODATA_LOAD
0166        .hash : ALIGN_WITH_INPUT {
0167                *(.hash)
0168        } > REGION_RODATA AT > REGION_RODATA_LOAD
0169        .gnu.hash : ALIGN_WITH_INPUT {
0170                *(.gnu.hash)
0171        } > REGION_RODATA AT > REGION_RODATA_LOAD
0172        .dynsym : ALIGN_WITH_INPUT {
0173                *(.dynsym)
0174        } > REGION_RODATA AT > REGION_RODATA_LOAD
0175        .dynstr : ALIGN_WITH_INPUT {
0176                *(.dynstr)
0177        } > REGION_RODATA AT > REGION_RODATA_LOAD
0178        .gnu.version : ALIGN_WITH_INPUT {
0179                *(.gnu.version)
0180        } > REGION_RODATA AT > REGION_RODATA_LOAD
0181        .gnu.version_d : ALIGN_WITH_INPUT {
0182                *(.gnu.version_d)
0183        } > REGION_RODATA AT > REGION_RODATA_LOAD
0184        .gnu.version_r : ALIGN_WITH_INPUT {
0185                *(.gnu.version_r)
0186        } > REGION_RODATA AT > REGION_RODATA_LOAD
0187        .rel.dyn : ALIGN_WITH_INPUT {
0188                *(.rel.init)
0189                *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
0190                *(.rel.fini)
0191                *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
0192                *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
0193                *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
0194                *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
0195                *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
0196                *(.rel.ctors)
0197                *(.rel.dtors)
0198                *(.rel.got)
0199                *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
0200                PROVIDE_HIDDEN (__rel_iplt_start = .);
0201                *(.rel.iplt)
0202                PROVIDE_HIDDEN (__rel_iplt_end = .);
0203                PROVIDE_HIDDEN (__rela_iplt_start = .);
0204                PROVIDE_HIDDEN (__rela_iplt_end = .);
0205        } > REGION_RODATA AT > REGION_RODATA_LOAD
0206        .rela.dyn : ALIGN_WITH_INPUT {
0207                *(.rela.init)
0208                *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
0209                *(.rela.fini)
0210                *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
0211                *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
0212                *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
0213                *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
0214                *(.rela.ctors)
0215                *(.rela.dtors)
0216                *(.rela.got)
0217                *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
0218                *(.rela.rtemsroset*)
0219                *(.rela.rtemsrwset*)
0220                PROVIDE_HIDDEN (__rel_iplt_start = .);
0221                PROVIDE_HIDDEN (__rel_iplt_end = .);
0222                PROVIDE_HIDDEN (__rela_iplt_start = .);
0223                *(.rela.iplt)
0224                PROVIDE_HIDDEN (__rela_iplt_end = .);
0225        } > REGION_RODATA AT > REGION_RODATA_LOAD
0226        .rel.plt : ALIGN_WITH_INPUT {
0227                *(.rel.plt)
0228        } > REGION_RODATA AT > REGION_RODATA_LOAD
0229        .rela.plt : ALIGN_WITH_INPUT {
0230                *(.rela.plt)
0231        } > REGION_RODATA AT > REGION_RODATA_LOAD
0232        .plt : ALIGN_WITH_INPUT {
0233                *(.plt)
0234        } > REGION_RODATA AT > REGION_RODATA_LOAD
0235        .iplt : ALIGN_WITH_INPUT {
0236                *(.iplt)
0237        } > REGION_RODATA AT > REGION_RODATA_LOAD
0238        .dynamic : ALIGN_WITH_INPUT {
0239                *(.dynamic)
0240        } > REGION_RODATA AT > REGION_RODATA_LOAD
0241        .got : ALIGN_WITH_INPUT {
0242                *(.got.plt) *(.igot.plt) *(.got) *(.igot)
0243        } > REGION_RODATA AT > REGION_RODATA_LOAD
0244        .rtemsroset : ALIGN_WITH_INPUT {
0245                /* Special FreeBSD linker set sections */
0246                __start_set_sysctl_set = .;
0247                *(set_sysctl_*);
0248                __stop_set_sysctl_set = .;
0249                *(set_domain_*);
0250                *(set_pseudo_*);
0251 
0252                KEEP (*(SORT(.rtemsroset.*)))
0253                bsp_section_rodata_end = .;
0254        } > REGION_RODATA AT > REGION_RODATA_LOAD
0255   bsp_section_rodata_size = bsp_section_rodata_end - bsp_section_rodata_begin;
0256   bsp_section_rodata_load_begin = LOADADDR (.rodata);
0257   bsp_section_rodata_load_end = bsp_section_rodata_load_begin + bsp_section_rodata_size;
0258 
0259   .rwbarrier : ALIGN_WITH_INPUT {
0260     . = ALIGN (bsp_section_rwbarrier_align);
0261   } > REGION_DATA AT > REGION_DATA
0262 
0263 .data : ALIGN_WITH_INPUT {
0264     bsp_section_data_begin = .;
0265     *(.data .data.* .gnu.linkonce.d.*)
0266     SORT(CONSTRUCTORS)
0267   } > REGION_DATA AT > REGION_DATA_LOAD
0268   .data1 : ALIGN_WITH_INPUT {
0269     *(.data1)
0270   } > REGION_DATA AT > REGION_DATA_LOAD
0271   .rtemsrwset : ALIGN_WITH_INPUT {
0272     KEEP (*(SORT(.rtemsrwset.*)))
0273     bsp_section_data_end = .;
0274   } > REGION_DATA AT > REGION_DATA_LOAD
0275   bsp_section_data_size = bsp_section_data_end - bsp_section_data_begin;
0276   bsp_section_data_load_begin = LOADADDR (.data);
0277   bsp_section_data_load_end = bsp_section_data_load_begin + bsp_section_data_size;
0278 
0279   .bss : ALIGN_WITH_INPUT {
0280     bsp_section_bss_begin = .;
0281     *(.dynbss)
0282     *(.bss .bss.* .gnu.linkonce.b.*)
0283     *(COMMON)
0284     bsp_section_bss_end = .;
0285   } > REGION_BSS AT > REGION_BSS
0286   bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_begin;
0287 
0288   .noinit (NOLOAD) : ALIGN_WITH_INPUT {
0289     bsp_section_noinit_begin = .;
0290     *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*)))
0291     bsp_section_noinit_end = .;
0292   } > REGION_BSS AT > REGION_BSS
0293   bsp_section_noinit_size = bsp_section_noinit_end - bsp_section_noinit_begin;
0294 
0295   .rtemsstack (NOLOAD) : ALIGN_WITH_INPUT{
0296     *(SORT(.rtemsstack.*))
0297   } > REGION_WORK AT > REGION_WORK
0298 
0299 .work : ALIGN_WITH_INPUT {
0300     /*
0301      * The work section will occupy the remaining REGION_WORK region and
0302      * contains the RTEMS work space and heap.
0303      */
0304     bsp_section_work_begin = .;
0305     . += ORIGIN (REGION_WORK) + LENGTH (REGION_WORK) - ABSOLUTE (.);
0306     bsp_section_work_end = .;
0307   } > REGION_WORK AT > REGION_WORK
0308   bsp_section_work_size = bsp_section_work_end - bsp_section_work_begin;
0309 
0310   .stack : ALIGN_WITH_INPUT {
0311     bsp_section_stack_end = .;
0312   } > REGION_STACK AT > REGION_STACK
0313   bsp_section_stack_size = bsp_section_stack_begin - bsp_section_stack_end;
0314 
0315   RamBase = ORIGIN (REGION_WORK);
0316   RamSize = LENGTH (REGION_WORK);
0317   RamEnd = RamBase + RamSize;
0318   WorkAreaBase = bsp_section_work_begin;
0319   HeapSize = 0;
0320 
0321   /* Addition to let linker know about custom section for GDB pretty-printing support. */
0322   .debug_gdb_scripts 0 : { *(.debug_gdb_scripts) }
0323 }