SECTIONS { /* * check to see if we defined section starts in the makefile - if not, * define them here. * * Align everything to a 16-byte boundary if youre specifying the * addresses here. */ TEXT_START = DEFINED(TEXT_START) ? TEXT_START : 0x00000000; IMAGE_TEXT_START = DEFINED(IMAGE_TEXT_START) ? IMAGE_TEXT_START : 0x00000000; .text TEXT_START : AT (IMAGE_TEXT_START) { /* Were building a s-record with the .text section located at TEXT_START that were going to load into memory at IMAGE_TEXT_START. _img_text_start and _img_text_end indicate the locations of the start and end of the text segment at the loaded location. These values are used by the routine that relocates the text. */ *(.text) *(.rodata) *(.rodata1) *(.got1); } /* Save text location in image and the final location to be used in except2.S */ _img_text_start = LOADADDR(.text); _img_text_end = ( LOADADDR(.text) + SIZEOF(.text) ); _final_text_start = ADDR(.text); /* * Put the data section right after the text in the load image * as well as after the relocation unless else specified * If the user specified an address, assume its aligned to a * 32-byte boundary (typical cache block size). If were * calculating the address, align it to cache block size ourself. */ DATA_START = DEFINED(DATA_START) ? DATA_START : (((ADDR(.text) + SIZEOF(.text)) & 0xFFFFFFE0) + 0x00000020); IMAGE_DATA_START = DEFINED(IMAGE_DATA_START) ? IMAGE_DATA_START : (((LOADADDR(.text) + SIZEOF(.text)) & 0xFFFFFFE0) + 0x00000020); .data DATA_START : AT (IMAGE_DATA_START) { _final_data_start = .; *(.data) *(.data1) *(.sdata) *(.sdata2) *(.got.plt) *(.got) *(.got2) *(.dynamic) ; *(.fixup) _final_data_end = .; } /* Now save off the start of the data in the image */ _img_data_start = LOADADDR(.data); /* * Place bss right after the data section. * * We only define one set of location variables for the BSS because * it doesnt actually exist in the image. All we do is go the the * final location and zero out an appropriate chunk of memory. */ .bss (ADDR(.data) + SIZEOF(.data)) : { _bss_start = .; *(.sbss) *(.scommon) *(.dynbss) *(.bss) *(COMMON) ; _bss_end = . ; } _end = .; /* These are needed for ELF backends which have not yet been converted to the new style linker. */ .stab 0 : { *(.stab) } .stabstr 0 : { *(.stabstr) } /* DWARF debug sections */ .debug 0 : {*(.debug)} .debug_srcinfo 0 : {*(.debug_srcinfo)} .debug_aranges 0 : {*(.debug_aranges)} .debug_pubnames 0 : {*(.debug_pubnames)} .debug_sfnames 0 : {*(.debug_sfnames)} .line 0 : {*(.line)} }