Back to home page

LXR

 
 

    


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

0001 /*  linkcmds
0002  */
0003 
0004 /*
0005  * For alignment, SPARC v9 specifies that instructions are 4-byte aligned, 
0006  * and the worst-case alignment requirements for data are for quad-word 
0007  * accesses, which must be 16-byte aligned.
0008  */
0009 
0010 /*
0011  * Declare some sizes.
0012  */
0013 RamBase = DEFINED(RamBase) ? RamBase : 0x0;
0014 RamSize = DEFINED(RamSize) ? RamSize : 4M;
0015 RamEnd = RamBase + RamSize;
0016 HeapSize = DEFINED(HeapSize) ? HeapSize : 1M;
0017 
0018 RAM_END = RamBase + RamSize;
0019 
0020 /* Default linker script, for normal executables */
0021 OUTPUT_FORMAT("elf64-sparc")
0022 ENTRY(_start)
0023 STARTUP(start.o)
0024 
0025 MEMORY
0026 {
0027   ram : ORIGIN = 0x0, LENGTH = 12M
0028 }
0029 
0030 SECTIONS
0031 {
0032   /* Read-only sections, merged into text segment: */
0033   .hash          : { *(.hash)           }
0034   .dynsym        : { *(.dynsym)         }
0035   .dynstr        : { *(.dynstr)         }
0036   .gnu.version   : { *(.gnu.version)    }
0037   .gnu.version_d   : { *(.gnu.version_d)        }
0038   .gnu.version_r   : { *(.gnu.version_r)        }
0039   /* Internal text space or external memory */
0040   .text 0x4000 : AT (0x4000)
0041   {
0042     *(BOOTSTRAP);
0043     *(.text*)
0044 
0045     KEEP (*(.init))
0046     KEEP (*(.fini))
0047 
0048     /*
0049      * Special FreeBSD sysctl sections.
0050      */
0051     . = ALIGN (16);
0052     __start_set_sysctl_set = .;
0053     *(set_sysctl_*);
0054     __stop_set_sysctl_set = ABSOLUTE(.);
0055     *(set_domain_*);
0056     *(set_pseudo_*);
0057 
0058     *(.eh_frame)
0059     . = ALIGN (16);
0060 
0061     *(.gnu.linkonce.t*)
0062     *(.gcc_except_table*)
0063 
0064     /*
0065      * C++ constructors
0066      */
0067     /* gcc uses crtbegin.o to find the start of
0068        the constructors, so we make sure it is
0069        first.  Because this is a wildcard, it
0070        doesn't matter if the user does not
0071        actually link against crtbegin.o; the
0072        linker won't look for a file to match a
0073        wildcard.  The wildcard also means that it
0074        doesn't matter which directory crtbegin.o
0075        is in.  */
0076     KEEP (*crtbegin.o(.ctors))
0077     KEEP (*crtbegin?.o(.ctors))
0078     /* We don't want to include the .ctor section from
0079        the crtend.o file until after the sorted ctors.
0080        The .ctor section from the crtend file contains the
0081        end of ctors marker and it must be last */
0082     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
0083     KEEP (*(SORT(.ctors.*)))
0084     KEEP (*(.ctors))
0085     KEEP (*crtbegin.o(.dtors))
0086     KEEP (*crtbegin?.o(.dtors))
0087     KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
0088     KEEP (*(SORT(.dtors.*)))
0089     KEEP (*(.dtors))
0090 
0091     _rodata_start = . ;
0092     *(.rodata*)
0093     KEEP (*(SORT(.rtemsroset.*)))
0094     *(.gnu.linkonce.r*)
0095     _erodata = ALIGN( 0x10 ) ;
0096 
0097     *(.lit)
0098     *(.shdata)
0099 
0100      . = ALIGN (16);
0101     _endtext = . ;
0102     _etext = . ;
0103   } > ram
0104 
0105   .tdata : AT (ADDR (.text) + SIZEOF (.text)) {
0106     _TLS_Data_begin = .;
0107     *(.tdata .tdata.* .gnu.linkonce.td.*)
0108     _TLS_Data_end = .;
0109   } > ram
0110   .tbss : AT (ADDR (.tdata) + SIZEOF (.tdata)) {
0111     _TLS_BSS_begin = .;
0112     *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
0113     _TLS_BSS_end = .;
0114   } > ram
0115   _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
0116   _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
0117   _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
0118   _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
0119   _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
0120   _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
0121  
0122   .rela.dyn : AT (ADDR (.tbss) + SIZEOF (.tbss))
0123   {
0124     *(.rela.init)
0125     *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
0126     *(.rela.fini)
0127     *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
0128     *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
0129     *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
0130     *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
0131     *(.rela.ctors)
0132     *(.rela.dtors)
0133     *(.rela.got)
0134     *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
0135     *(.rela.rtemsroset*)
0136     *(.rela.rtemsrwset*)
0137   } > ram
0138 
0139   .data   : AT (ADDR (.rela.dyn) + SIZEOF (.rela.dyn))
0140   {
0141      PROVIDE (__data_start = .) ;
0142     data_start = . ;
0143     _data_start = . ;
0144     *(.data)
0145     *(.data*)
0146     KEEP (*(SORT(.rtemsrwset.*)))
0147     *(.rodata)  /* We need to include .rodata here if gcc is used */
0148     *(.rodata*) /* with -fdata-sections.  */
0149     *(.gnu.linkonce.d*)
0150     . = ALIGN(2);
0151     edata = . ;
0152     _edata = . ;
0153      PROVIDE (__data_end = .) ;
0154   } > ram
0155  
0156   /* XXX
0157    __data_load_start = LOADADDR(.data);
0158    __data_load_end = __data_load_start + SIZEOF(.data);
0159   */
0160    . = ALIGN (16);
0161   .dynamic        : { *(.dynamic)       } >ram
0162   .jcr        : { *(.jcr)     } > ram
0163   .got            : { *(.got)           } >ram
0164   .plt            : { *(.plt)           } >ram
0165   .dynrel         : { *(.dynrel)        } >ram
0166   .shbss      : { *(.shbss)  } > ram
0167   .bss        :
0168   {
0169     FILL(0x00000000);
0170     . = ALIGN(16);
0171     __bss_start = ALIGN(0x8);
0172     bss_start = .;
0173     bss_start = .;
0174     *(.bss .bss* .gnu.linkonce.b*)
0175     *(COMMON)
0176     . = ALIGN (16);
0177     end = .;
0178     _end = .;
0179     __end = .;
0180   } > ram
0181 
0182   .noinit (NOLOAD) : {
0183     *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*)))
0184   } > ram
0185 
0186   .rtemsstack (NOLOAD) : {
0187     *(SORT(.rtemsstack.*))
0188     PROVIDE (WorkAreaBase = .);
0189   } > ram
0190 
0191   .heap : {
0192     . += HeapSize;
0193     PROVIDE (HeapBase = .);
0194     . += HeapSize;
0195   } > ram
0196 
0197   /* Addition to let linker know about custom section for GDB pretty-printing support. */
0198   .debug_gdb_scripts 0 : { *(.debug_gdb_scripts) }
0199 }
0200 
0201