Furquan Shaikh | 2af76f4 | 2014-04-28 16:39:40 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Memory map: |
| 3 | * |
| 4 | * CONFIG_ROMSTAGE_BASE : text segment |
| 5 | * : rodata segment |
| 6 | * : data segment |
| 7 | * : bss segment |
| 8 | * : stack |
| 9 | * : heap |
| 10 | */ |
| 11 | /* |
| 12 | * Bootstrap code for the STPC Consumer |
| 13 | * Copyright (c) 1999 by Net Insight AB. All Rights Reserved. |
| 14 | */ |
| 15 | |
| 16 | /* |
| 17 | * Written by Johan Rydberg, based on work by Daniel Kahlin. |
| 18 | * Rewritten by Eric Biederman |
| 19 | * 2005.12 yhlu add ramstage cross the vga font buffer handling |
| 20 | */ |
| 21 | |
| 22 | /* We use ELF as output format. So that we can debug the code in some form. */ |
| 23 | /* |
| 24 | INCLUDE ldoptions |
| 25 | */ |
| 26 | |
| 27 | /* We use ELF as output format. So that we can debug the code in some form. */ |
| 28 | OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64") |
| 29 | OUTPUT_ARCH(aarch64) |
| 30 | INCLUDE ldoptions |
| 31 | |
| 32 | PHDRS |
| 33 | { |
| 34 | to_load PT_LOAD; |
| 35 | } |
| 36 | |
| 37 | ENTRY(stage_entry) |
| 38 | |
| 39 | SECTIONS |
| 40 | { |
| 41 | . = CONFIG_ROMSTAGE_BASE; |
| 42 | |
| 43 | .romtext . : { |
| 44 | _start = .; |
| 45 | *(.text.stage_entry.aarch64); |
| 46 | *(.text.startup); |
| 47 | *(.text); |
| 48 | *(.text.*); |
| 49 | } : to_load |
| 50 | |
| 51 | .romdata . : { |
| 52 | *(.rodata); |
| 53 | *(.rodata.*); |
| 54 | *(.machine_param); |
| 55 | *(.data); |
| 56 | *(.data.*); |
| 57 | . = ALIGN(8); |
| 58 | _erom = .; |
| 59 | } |
| 60 | |
| 61 | __image_copy_end = .; |
| 62 | |
| 63 | /* bss does not contain data, it is just a space that should be zero |
| 64 | * initialized on startup. (typically uninitialized global variables) |
| 65 | * crt0.S fills between _bss and _ebss with zeroes. |
| 66 | */ |
| 67 | .bss . : { |
| 68 | . = ALIGN(8); |
| 69 | _bss = .; |
| 70 | *(.bss) |
| 71 | *(.bss.*) |
| 72 | *(.sbss) |
| 73 | *(.sbss.*) |
| 74 | _ebss = .; |
| 75 | } |
| 76 | |
| 77 | _end = .; |
| 78 | |
| 79 | preram_cbmem_console = CONFIG_CBMEM_CONSOLE_PRERAM_BASE; |
| 80 | |
| 81 | /* Discard the sections we don't need/want */ |
| 82 | /DISCARD/ : { |
| 83 | *(.comment) |
| 84 | *(.note) |
| 85 | *(.comment.*) |
| 86 | *(.note.*) |
| 87 | *(.eh_frame); |
| 88 | } |
| 89 | } |