Scott McNutt | 2ca0085 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2004, Psyent Corporation <www.psyent.com> |
| 3 | * Scott McNutt <smcnutt@psyent.com> |
| 4 | * |
Wolfgang Denk | bd8ec7e | 2013-10-07 13:07:26 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
Scott McNutt | 2ca0085 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | |
| 9 | OUTPUT_FORMAT("elf32-littlenios2") |
| 10 | OUTPUT_ARCH(nios2) |
| 11 | ENTRY(_start) |
| 12 | |
| 13 | SECTIONS |
| 14 | { |
| 15 | .text : |
| 16 | { |
Scott McNutt | 12a8a65 | 2010-04-16 16:12:39 -0400 | [diff] [blame] | 17 | arch/nios2/cpu/start.o (.text) |
Scott McNutt | 2ca0085 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 18 | *(.text) |
| 19 | *(.text.*) |
| 20 | *(.gnu.linkonce.t*) |
Trent Piepho | 4438e5e | 2009-02-18 15:22:05 -0800 | [diff] [blame] | 21 | *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) |
Scott McNutt | 2ca0085 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 22 | *(.gnu.linkonce.r*) |
| 23 | } |
| 24 | . = ALIGN (4); |
| 25 | _etext = .; |
| 26 | PROVIDE (etext = .); |
| 27 | |
| 28 | /* CMD TABLE - sandwich this in between text and data so |
| 29 | * the initialization code relocates the command table as |
| 30 | * well -- admittedly, this is just pure laziness ;-) |
| 31 | */ |
Scott McNutt | 2ca0085 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 32 | |
Marek Vasut | 607092a | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 33 | . = ALIGN(4); |
| 34 | .u_boot_list : { |
Albert ARIBAUD | c24895e | 2013-02-25 00:59:00 +0000 | [diff] [blame] | 35 | KEEP(*(SORT(.u_boot_list*))); |
Marek Vasut | 607092a | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 36 | } |
| 37 | |
Scott McNutt | 2ca0085 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 38 | /* INIT DATA sections - "Small" data (see the gcc -G option) |
| 39 | * is always gp-relative. Here we make all init data sections |
| 40 | * adjacent to simplify the startup code -- and provide |
| 41 | * the global pointer for gp-relative access. |
| 42 | */ |
| 43 | _data = .; |
| 44 | .data : |
| 45 | { |
| 46 | *(.data) |
| 47 | *(.data.*) |
| 48 | *(.gnu.linkonce.d*) |
| 49 | } |
| 50 | |
| 51 | . = ALIGN(16); |
| 52 | _gp = .; /* Global pointer addr */ |
| 53 | PROVIDE (gp = .); |
| 54 | |
| 55 | .sdata : |
| 56 | { |
| 57 | *(.sdata) |
| 58 | *(.sdata.*) |
| 59 | *(.gnu.linkonce.s.*) |
| 60 | } |
| 61 | . = ALIGN(4); |
| 62 | |
| 63 | _edata = .; |
| 64 | PROVIDE (edata = .); |
| 65 | |
| 66 | /* UNINIT DATA - Small uninitialized data is first so it's |
| 67 | * adjacent to sdata and can be referenced via gp. The normal |
| 68 | * bss follows. We keep it adjacent to simplify init code. |
| 69 | */ |
| 70 | __bss_start = .; |
Wolfgang Denk | 828a978 | 2008-01-12 20:31:39 +0100 | [diff] [blame] | 71 | .sbss (NOLOAD) : |
Scott McNutt | 2ca0085 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 72 | { |
| 73 | *(.sbss) |
| 74 | *(.sbss.*) |
| 75 | *(.gnu.linkonce.sb.*) |
| 76 | *(.scommon) |
| 77 | } |
| 78 | . = ALIGN(4); |
Wolfgang Denk | 828a978 | 2008-01-12 20:31:39 +0100 | [diff] [blame] | 79 | .bss (NOLOAD) : |
Scott McNutt | 2ca0085 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 80 | { |
| 81 | *(.bss) |
| 82 | *(.bss.*) |
| 83 | *(.dynbss) |
| 84 | *(COMMON) |
| 85 | *(.scommon) |
| 86 | } |
| 87 | . = ALIGN(4); |
Simon Glass | ed70c8f | 2013-03-14 06:54:53 +0000 | [diff] [blame] | 88 | __bss_end = .; |
Scott McNutt | 2ca0085 | 2006-06-08 13:37:39 -0400 | [diff] [blame] | 89 | PROVIDE (end = .); |
| 90 | |
| 91 | /* DEBUG -- symbol table, string table, etc. etc. |
| 92 | */ |
| 93 | .stab 0 : { *(.stab) } |
| 94 | .stabstr 0 : { *(.stabstr) } |
| 95 | .stab.excl 0 : { *(.stab.excl) } |
| 96 | .stab.exclstr 0 : { *(.stab.exclstr) } |
| 97 | .stab.index 0 : { *(.stab.index) } |
| 98 | .stab.indexstr 0 : { *(.stab.indexstr) } |
| 99 | .comment 0 : { *(.comment) } |
| 100 | .debug 0 : { *(.debug) } |
| 101 | .line 0 : { *(.line) } |
| 102 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
| 103 | .debug_sfnames 0 : { *(.debug_sfnames) } |
| 104 | .debug_aranges 0 : { *(.debug_aranges) } |
| 105 | .debug_pubnames 0 : { *(.debug_pubnames) } |
| 106 | .debug_info 0 : { *(.debug_info) } |
| 107 | .debug_abbrev 0 : { *(.debug_abbrev) } |
| 108 | .debug_line 0 : { *(.debug_line) } |
| 109 | .debug_frame 0 : { *(.debug_frame) } |
| 110 | .debug_str 0 : { *(.debug_str) } |
| 111 | .debug_loc 0 : { *(.debug_loc) } |
| 112 | .debug_macinfo 0 : { *(.debug_macinfo) } |
| 113 | .debug_weaknames 0 : { *(.debug_weaknames) } |
| 114 | .debug_funcnames 0 : { *(.debug_funcnames) } |
| 115 | .debug_typenames 0 : { *(.debug_typenames) } |
| 116 | .debug_varnames 0 : { *(.debug_varnames) } |
| 117 | } |