Back to home page

LXR

 
 

    


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

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /*
0004  * Copyright (C) 2008, 2018 embedded brains GmbH & Co. KG
0005  *
0006  * Redistribution and use in source and binary forms, with or without
0007  * modification, are permitted provided that the following conditions
0008  * are met:
0009  * 1. Redistributions of source code must retain the above copyright
0010  *    notice, this list of conditions and the following disclaimer.
0011  * 2. Redistributions in binary form must reproduce the above copyright
0012  *    notice, this list of conditions and the following disclaimer in the
0013  *    documentation and/or other materials provided with the distribution.
0014  *
0015  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0016  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0017  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0018  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0019  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0020  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0021  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0022  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0023  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0024  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0025  * POSSIBILITY OF SUCH DAMAGE.
0026  */
0027 
0028 OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k")
0029 
0030 OUTPUT_ARCH(m68k)
0031 
0032 ENTRY(start)
0033 STARTUP(start.o)
0034 
0035 MEMORY {
0036         UNEXPECTED_SECTIONS : ORIGIN = 0xffffffff, LENGTH = 0
0037 }
0038 
0039 SECTIONS {
0040         .vector0 : ALIGN_WITH_INPUT {
0041                 bsp_vector0_begin = .;
0042                 KEEP (*(.vectors*))
0043                 bsp_vector0_end = .;
0044         } > REGION_TEXT AT > REGION_TEXT
0045         bsp_vector0_size = bsp_vector0_end - bsp_vector0_begin;
0046 
0047         .text : ALIGN_WITH_INPUT {
0048                 *(.text.unlikely .text.*_unlikely)
0049                 *(.text .stub .text.* .gnu.linkonce.t.*)
0050                 /* .gnu.warning sections are handled specially by elf32.em.  */
0051                 *(.gnu.warning)
0052         } > REGION_TEXT AT > REGION_TEXT_LOAD
0053         .init : ALIGN_WITH_INPUT {
0054                 KEEP (*(.init))
0055         } > REGION_TEXT AT > REGION_TEXT_LOAD
0056         .fini : ALIGN_WITH_INPUT {
0057                 KEEP (*(.fini))
0058         } > REGION_TEXT AT > REGION_TEXT_LOAD
0059         .rodata : ALIGN_WITH_INPUT {
0060                 *(.rodata .rodata.* .gnu.linkonce.r.*)
0061         } > REGION_TEXT AT > REGION_TEXT_LOAD
0062         .rodata1 : ALIGN_WITH_INPUT {
0063                 *(.rodata1)
0064         } > REGION_TEXT AT > REGION_TEXT_LOAD
0065         .eh_frame : ALIGN_WITH_INPUT {
0066                 KEEP (*(.eh_frame))
0067         } > REGION_TEXT AT > REGION_TEXT_LOAD
0068         .gcc_except_table : ALIGN_WITH_INPUT {
0069                 *(.gcc_except_table .gcc_except_table.*)
0070         } > REGION_TEXT AT > REGION_TEXT_LOAD
0071         .tdata : ALIGN_WITH_INPUT {
0072                 _TLS_Data_begin = .;
0073                 *(.tdata .tdata.* .gnu.linkonce.td.*)
0074                 _TLS_Data_end = .;
0075         } > REGION_TEXT AT > REGION_TEXT_LOAD
0076         .tbss : ALIGN_WITH_INPUT {
0077                 _TLS_BSS_begin = .;
0078                 *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
0079                 _TLS_BSS_end = .;
0080         } > REGION_TEXT AT > REGION_TEXT_LOAD
0081         _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
0082         _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
0083         _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
0084         _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
0085         _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
0086         _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
0087         .preinit_array : ALIGN_WITH_INPUT {
0088                 PROVIDE_HIDDEN (__preinit_array_start = .);
0089                 KEEP (*(.preinit_array))
0090                 PROVIDE_HIDDEN (__preinit_array_end = .);
0091         } > REGION_TEXT AT > REGION_TEXT_LOAD
0092         .init_array : ALIGN_WITH_INPUT {
0093                 PROVIDE_HIDDEN (__init_array_start = .);
0094                 KEEP (*(SORT(.init_array.*)))
0095                 KEEP (*(.init_array))
0096                 PROVIDE_HIDDEN (__init_array_end = .);
0097         } > REGION_TEXT AT > REGION_TEXT_LOAD
0098         .fini_array : ALIGN_WITH_INPUT {
0099                 PROVIDE_HIDDEN (__fini_array_start = .);
0100                 KEEP (*(.fini_array))
0101                 KEEP (*(SORT(.fini_array.*)))
0102                 PROVIDE_HIDDEN (__fini_array_end = .);
0103         } > REGION_TEXT AT > REGION_TEXT_LOAD
0104         .ctors : ALIGN_WITH_INPUT {
0105                 /* gcc uses crtbegin.o to find the start of
0106                    the constructors, so we make sure it is
0107                    first.  Because this is a wildcard, it
0108                    doesn't matter if the user does not
0109                    actually link against crtbegin.o; the
0110                    linker won't look for a file to match a
0111                    wildcard.  The wildcard also means that it
0112                    doesn't matter which directory crtbegin.o
0113                    is in.  */
0114                 KEEP (*crtbegin.o(.ctors))
0115                 KEEP (*crtbegin?.o(.ctors))
0116                 /* We don't want to include the .ctor section from
0117                    the crtend.o file until after the sorted ctors.
0118                    The .ctor section from the crtend file contains the
0119                    end of ctors marker and it must be last */
0120                 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
0121                 KEEP (*(SORT(.ctors.*)))
0122                 KEEP (*(.ctors))
0123         } > REGION_TEXT AT > REGION_TEXT_LOAD
0124         .dtors : ALIGN_WITH_INPUT {
0125                 KEEP (*crtbegin.o(.dtors))
0126                 KEEP (*crtbegin?.o(.dtors))
0127                 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
0128                 KEEP (*(SORT(.dtors.*)))
0129                 KEEP (*(.dtors))
0130         } > REGION_TEXT AT > REGION_TEXT_LOAD
0131         .data.rel.ro : ALIGN_WITH_INPUT {
0132                 *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*)
0133                 *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*)
0134         } > REGION_TEXT AT > REGION_TEXT_LOAD
0135         .jcr : ALIGN_WITH_INPUT {
0136                 KEEP (*(.jcr))
0137         } > REGION_TEXT AT > REGION_TEXT_LOAD
0138         .interp : ALIGN_WITH_INPUT {
0139                 *(.interp)
0140         } > REGION_TEXT AT > REGION_TEXT_LOAD
0141         .note.gnu.build-id : ALIGN_WITH_INPUT {
0142                 *(.note.gnu.build-id)
0143         } > REGION_TEXT AT > REGION_TEXT_LOAD
0144         .hash : ALIGN_WITH_INPUT {
0145                 *(.hash)
0146         } > REGION_TEXT AT > REGION_TEXT_LOAD
0147         .gnu.hash : ALIGN_WITH_INPUT {
0148                 *(.gnu.hash)
0149         } > REGION_TEXT AT > REGION_TEXT_LOAD
0150         .dynsym : ALIGN_WITH_INPUT {
0151                 *(.dynsym)
0152         } > REGION_TEXT AT > REGION_TEXT_LOAD
0153         .dynstr : ALIGN_WITH_INPUT {
0154                 *(.dynstr)
0155         } > REGION_TEXT AT > REGION_TEXT_LOAD
0156         .gnu.version : ALIGN_WITH_INPUT {
0157                 *(.gnu.version)
0158         } > REGION_TEXT AT > REGION_TEXT_LOAD
0159         .gnu.version_d : ALIGN_WITH_INPUT {
0160                 *(.gnu.version_d)
0161         } > REGION_TEXT AT > REGION_TEXT_LOAD
0162         .gnu.version_r : ALIGN_WITH_INPUT {
0163                 *(.gnu.version_r)
0164         } > REGION_TEXT AT > REGION_TEXT_LOAD
0165         .rel.dyn : ALIGN_WITH_INPUT {
0166                 *(.rel.init)
0167                 *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
0168                 *(.rel.fini)
0169                 *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
0170                 *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
0171                 *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
0172                 *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
0173                 *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
0174                 *(.rel.ctors)
0175                 *(.rel.dtors)
0176                 *(.rel.got)
0177                 *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
0178                 PROVIDE_HIDDEN (__rel_iplt_start = .);
0179                 *(.rel.iplt)
0180                 PROVIDE_HIDDEN (__rel_iplt_end = .);
0181                 PROVIDE_HIDDEN (__rela_iplt_start = .);
0182                 PROVIDE_HIDDEN (__rela_iplt_end = .);
0183         } > REGION_TEXT AT > REGION_TEXT_LOAD
0184         .rela.dyn : ALIGN_WITH_INPUT {
0185                 *(.rela.init)
0186                 *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
0187                 *(.rela.fini)
0188                 *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
0189                 *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
0190                 *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
0191                 *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
0192                 *(.rela.ctors)
0193                 *(.rela.dtors)
0194                 *(.rela.got)
0195                 *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
0196                 *(.rela.rtemsroset*)
0197                 *(.rela.rtemsrwset*)
0198                 PROVIDE_HIDDEN (__rel_iplt_start = .);
0199                 PROVIDE_HIDDEN (__rel_iplt_end = .);
0200                 PROVIDE_HIDDEN (__rela_iplt_start = .);
0201                 *(.rela.iplt)
0202                 PROVIDE_HIDDEN (__rela_iplt_end = .);
0203         } > REGION_TEXT AT > REGION_TEXT_LOAD
0204         .rel.plt : ALIGN_WITH_INPUT {
0205                 *(.rel.plt)
0206         } > REGION_TEXT AT > REGION_TEXT_LOAD
0207         .rela.plt : ALIGN_WITH_INPUT {
0208                 *(.rela.plt)
0209         } > REGION_TEXT AT > REGION_TEXT_LOAD
0210         .plt : ALIGN_WITH_INPUT {
0211                 *(.plt)
0212         } > REGION_TEXT AT > REGION_TEXT_LOAD
0213         .iplt : ALIGN_WITH_INPUT {
0214                 *(.iplt)
0215         } > REGION_TEXT AT > REGION_TEXT_LOAD
0216         .dynamic : ALIGN_WITH_INPUT {
0217                 *(.dynamic)
0218         } > REGION_TEXT AT > REGION_TEXT_LOAD
0219         .got : ALIGN_WITH_INPUT {
0220                 *(.got.plt) *(.igot.plt) *(.got) *(.igot)
0221         } > REGION_TEXT AT > REGION_TEXT_LOAD
0222         .rtemsroset : ALIGN_WITH_INPUT {
0223                 /* Special FreeBSD linker set sections */
0224                 __start_set_sysctl_set = .;
0225                 *(set_sysctl_*);
0226                 __stop_set_sysctl_set = .;
0227                 *(set_domain_*);
0228                 *(set_pseudo_*);
0229 
0230                 KEEP (*(SORT(.rtemsroset.*)))
0231         } > REGION_TEXT AT > REGION_TEXT_LOAD
0232 
0233         .vector1 : ALIGN_WITH_INPUT {
0234                 bsp_vector1_begin = .;
0235                 . = . + (ORIGIN (REGION_TEXT) == ORIGIN (REGION_DATA) ? 0 : bsp_vector0_size);
0236                 bsp_vector1_end = .;
0237         } > REGION_DATA AT > REGION_DATA
0238         bsp_vector1_size = bsp_vector1_end - bsp_vector1_begin;
0239 
0240         .data : ALIGN_WITH_INPUT {
0241                 bsp_section_data_begin = .;
0242                 *(.data .data.* .gnu.linkonce.d.*)
0243                 SORT(CONSTRUCTORS)
0244         } > REGION_DATA AT > REGION_DATA_LOAD
0245         .data1 : ALIGN_WITH_INPUT {
0246                 *(.data1)
0247         } > REGION_DATA AT > REGION_DATA_LOAD
0248         .rtemsrwset : ALIGN_WITH_INPUT {
0249                 KEEP (*(SORT(.rtemsrwset.*)))
0250                 bsp_section_data_end = .;
0251         } > REGION_DATA AT > REGION_DATA_LOAD
0252         bsp_section_data_size = bsp_section_data_end - bsp_section_data_begin;
0253         bsp_section_data_load_begin = LOADADDR (.data);
0254         bsp_section_data_load_end = bsp_section_data_load_begin + bsp_section_data_size;
0255 
0256         .bss : ALIGN_WITH_INPUT {
0257                 bsp_section_bss_begin = .;
0258                 *(.dynbss)
0259                 *(.bss .bss.* .gnu.linkonce.b.*)
0260                 *(COMMON)
0261                 bsp_section_bss_end = .;
0262         } > REGION_DATA AT > REGION_DATA
0263         bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_begin;
0264 
0265         .noinit (NOLOAD) : ALIGN_WITH_INPUT {
0266                 bsp_section_noinit_begin = .;
0267                 *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*)))
0268                 bsp_section_noinit_end = .;
0269         } > REGION_DATA AT > REGION_DATA
0270         bsp_section_noinit_size = bsp_section_noinit_end - bsp_section_noinit_begin;
0271 
0272         .rtemsstack (NOLOAD) : ALIGN_WITH_INPUT {
0273                 *(SORT(.rtemsstack.*))
0274         } > REGION_DATA AT > REGION_DATA
0275 
0276         .work : ALIGN_WITH_INPUT {
0277                 /*
0278                  * The work section will occupy the remaining REGION_DATA region and
0279                  * contains the RTEMS work space and heap.
0280                  */
0281                 bsp_section_work_begin = .;
0282                 . += ORIGIN (REGION_DATA) + LENGTH (REGION_DATA) - ABSOLUTE (.);
0283                 bsp_section_work_end = .;
0284         } > REGION_DATA AT > REGION_DATA
0285         bsp_section_work_size = bsp_section_work_end - bsp_section_work_begin;
0286 
0287         /* FIXME */
0288         RamBase = ORIGIN (REGION_DATA);
0289         RamSize = LENGTH (REGION_DATA);
0290         RamEnd = RamBase + RamSize;
0291         WorkAreaBase = bsp_section_work_begin;
0292         HeapSize = 0;
0293 
0294         /* Stabs debugging sections.  */
0295         .stab          0 : { *(.stab) }
0296         .stabstr       0 : { *(.stabstr) }
0297         .stab.excl     0 : { *(.stab.excl) }
0298         .stab.exclstr  0 : { *(.stab.exclstr) }
0299         .stab.index    0 : { *(.stab.index) }
0300         .stab.indexstr 0 : { *(.stab.indexstr) }
0301         .comment       0 : { *(.comment) }
0302         /* DWARF debug sections.
0303            Symbols in the DWARF debugging sections are relative to the beginning
0304            of the section so we begin them at 0.  */
0305         /* DWARF 1.  */
0306         .debug          0 : { *(.debug) }
0307         .line           0 : { *(.line) }
0308         /* GNU DWARF 1 extensions.  */
0309         .debug_srcinfo  0 : { *(.debug_srcinfo) }
0310         .debug_sfnames  0 : { *(.debug_sfnames) }
0311         /* DWARF 1.1 and DWARF 2.  */
0312         .debug_aranges  0 : { *(.debug_aranges) }
0313         .debug_pubnames 0 : { *(.debug_pubnames) }
0314         /* DWARF 2.  */
0315         .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
0316         .debug_abbrev   0 : { *(.debug_abbrev) }
0317         .debug_line     0 : { *(.debug_line .debug_line.* .debug_line_end) }
0318         .debug_frame    0 : { *(.debug_frame) }
0319         .debug_str      0 : { *(.debug_str) }
0320         .debug_loc      0 : { *(.debug_loc) }
0321         .debug_macinfo  0 : { *(.debug_macinfo) }
0322         /* SGI/MIPS DWARF 2 extensions.  */
0323         .debug_weaknames 0 : { *(.debug_weaknames) }
0324         .debug_funcnames 0 : { *(.debug_funcnames) }
0325         .debug_typenames 0 : { *(.debug_typenames) }
0326         .debug_varnames  0 : { *(.debug_varnames) }
0327         /* DWARF 3.  */
0328         .debug_pubtypes 0 : { *(.debug_pubtypes) }
0329         .debug_ranges   0 : { *(.debug_ranges) }
0330         /* DWARF 5.  */
0331         .debug_addr     0 : { *(.debug_addr) }
0332         .debug_line_str 0 : { *(.debug_line_str) }
0333         .debug_loclists 0 : { *(.debug_loclists) }
0334         .debug_macro    0 : { *(.debug_macro) }
0335         .debug_names    0 : { *(.debug_names) }
0336         .debug_rnglists 0 : { *(.debug_rnglists) }
0337         .debug_str_offsets 0 : { *(.debug_str_offsets) }
0338         .debug_sup      0 : { *(.debug_sup) }
0339 
0340         /* Addition to let linker know about custom section for GDB pretty-printing support. */
0341         .debug_gdb_scripts 0 : { *(.debug_gdb_scripts) }
0342         
0343         /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
0344 
0345         /*
0346          * This is a RTEMS specific section to catch all unexpected input
0347          * sections.  In case you get an error like
0348          *   "section `.unexpected_sections' will not fit in region
0349          *   `UNEXPECTED_SECTIONS'"
0350          * you have to figure out the offending input section and add it to the
0351          * appropriate output section definition above.
0352          */
0353         .unexpected_sections : { *(*) } > UNEXPECTED_SECTIONS
0354 }