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