Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Simon Glass | 9e8dd4f | 2017-01-16 07:04:02 -0700 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2002 |
| 4 | * Daniel Engström, Omicron Ceti AB, daniel@omicron.se. |
Simon Glass | 9e8dd4f | 2017-01-16 07:04:02 -0700 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <config.h> |
| 8 | OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") |
| 9 | OUTPUT_ARCH(i386) |
| 10 | ENTRY(_start) |
| 11 | |
| 12 | SECTIONS |
| 13 | { |
Tom Rini | 2aaa27d | 2019-01-22 17:09:26 -0500 | [diff] [blame] | 14 | . = IMAGE_TEXT_BASE; /* Location of bootcode in flash */ |
Simon Glass | 9e8dd4f | 2017-01-16 07:04:02 -0700 | [diff] [blame] | 15 | __text_start = .; |
Simon Glass | 7a13138 | 2019-12-06 21:42:00 -0700 | [diff] [blame] | 16 | .text : { |
| 17 | __image_copy_start = .; |
| 18 | *(.text*); |
| 19 | } |
Simon Glass | 9e8dd4f | 2017-01-16 07:04:02 -0700 | [diff] [blame] | 20 | |
| 21 | . = ALIGN(4); |
| 22 | |
| 23 | . = ALIGN(4); |
Andrew Scull | 5a9095c | 2022-05-30 10:00:04 +0000 | [diff] [blame] | 24 | __u_boot_list : { |
| 25 | KEEP(*(SORT(__u_boot_list*))); |
Simon Glass | 9e8dd4f | 2017-01-16 07:04:02 -0700 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | . = ALIGN(4); |
| 29 | .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } |
| 30 | |
| 31 | . = ALIGN(4); |
Simon Glass | 92cb9dc | 2021-03-15 17:25:44 +1300 | [diff] [blame] | 32 | |
| 33 | .priv_data : { |
| 34 | __priv_data_start = .; |
| 35 | *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.priv_data*))) |
| 36 | __priv_data_end = .; |
| 37 | } |
| 38 | |
| 39 | . = ALIGN(4); |
Simon Glass | 9e8dd4f | 2017-01-16 07:04:02 -0700 | [diff] [blame] | 40 | .data : { *(.data*) } |
| 41 | |
| 42 | . = ALIGN(4); |
| 43 | __data_end = .; |
| 44 | __init_end = .; |
Simon Glass | 5a4e018 | 2019-09-25 08:11:36 -0600 | [diff] [blame] | 45 | . = ALIGN(4); |
| 46 | .binman_sym_table : { |
| 47 | __binman_sym_start = .; |
| 48 | KEEP(*(SORT(.binman_sym*))); |
| 49 | __binman_sym_end = .; |
Simon Glass | be6f958 | 2021-01-24 10:06:05 -0700 | [diff] [blame] | 50 | |
| 51 | /* |
| 52 | * Force 32-byte alignment so that it lines up with the start of |
| 53 | * bss, which may have up to 32-byte alignment. This ensures |
| 54 | * that the end of the .bin file matches up with |
| 55 | * _image_binary_end or __bss_end - see board_fdt_blob_setup(). |
| 56 | * The alignment of BSS depends on what is in it, so can range |
| 57 | * from 4 to 32 bytes. |
| 58 | */ |
| 59 | . = ALIGN(32); |
Simon Glass | 5a4e018 | 2019-09-25 08:11:36 -0600 | [diff] [blame] | 60 | } |
Simon Glass | 9e8dd4f | 2017-01-16 07:04:02 -0700 | [diff] [blame] | 61 | |
| 62 | _image_binary_end = .; |
| 63 | |
Simon Glass | 8dda596 | 2021-01-24 10:06:06 -0700 | [diff] [blame] | 64 | #if CONFIG_IS_ENABLED(SEPARATE_BSS) |
Simon Glass | 9e8dd4f | 2017-01-16 07:04:02 -0700 | [diff] [blame] | 65 | . = 0x120000; |
Simon Glass | 8dda596 | 2021-01-24 10:06:06 -0700 | [diff] [blame] | 66 | #endif |
Simon Glass | 9e8dd4f | 2017-01-16 07:04:02 -0700 | [diff] [blame] | 67 | .bss (OVERLAY) : { |
| 68 | __bss_start = .; |
| 69 | *(.bss*) |
| 70 | *(COM*) |
| 71 | . = ALIGN(4); |
| 72 | __bss_end = .; |
| 73 | } |
| 74 | __bss_size = __bss_end - __bss_start; |
| 75 | |
| 76 | /DISCARD/ : { *(.dynstr*) } |
| 77 | /DISCARD/ : { *(.dynamic*) } |
| 78 | /DISCARD/ : { *(.plt*) } |
| 79 | /DISCARD/ : { *(.interp*) } |
| 80 | /DISCARD/ : { *(.gnu*) } |
Bin Meng | 3eb15f5 | 2021-06-18 15:09:30 +0800 | [diff] [blame] | 81 | /DISCARD/ : { *(.note.gnu.property) } |
Simon Glass | 9e8dd4f | 2017-01-16 07:04:02 -0700 | [diff] [blame] | 82 | |
Simon Glass | 79ef699 | 2019-04-25 21:58:53 -0600 | [diff] [blame] | 83 | #if defined(CONFIG_SPL_X86_16BIT_INIT) || defined(CONFIG_TPL_X86_16BIT_INIT) |
Simon Glass | 9e8dd4f | 2017-01-16 07:04:02 -0700 | [diff] [blame] | 84 | /* |
| 85 | * The following expressions place the 16-bit Real-Mode code and |
| 86 | * Reset Vector at the end of the Flash ROM |
| 87 | */ |
| 88 | . = START_16 - RESET_SEG_START; |
| 89 | .start16 : AT (START_16) { |
| 90 | KEEP(*(.start16)); |
| 91 | } |
| 92 | |
| 93 | . = RESET_VEC_LOC - RESET_SEG_START; |
| 94 | .resetvec : AT (RESET_VEC_LOC) { |
| 95 | KEEP(*(.resetvec)); |
| 96 | } |
| 97 | #endif |
| 98 | |
| 99 | } |