Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Simon Glass | 3c2dd537 | 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 | 3c2dd537 | 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 |
| 15 | /DISCARD/ : { *(.u_boot_list_2_cmd_*) } |
| 16 | #endif |
| 17 | |
Tom Rini | 2f41ade | 2019-01-22 17:09:26 -0500 | [diff] [blame] | 18 | . = IMAGE_TEXT_BASE; /* Location of bootcode in flash */ |
Simon Glass | 3c2dd537 | 2017-01-16 07:04:02 -0700 | [diff] [blame] | 19 | __text_start = .; |
Simon Glass | b93757c | 2019-12-06 21:42:00 -0700 | [diff] [blame] | 20 | .text : { |
| 21 | __image_copy_start = .; |
| 22 | *(.text*); |
| 23 | } |
Simon Glass | 3c2dd537 | 2017-01-16 07:04:02 -0700 | [diff] [blame] | 24 | |
| 25 | . = ALIGN(4); |
| 26 | |
| 27 | . = ALIGN(4); |
| 28 | .u_boot_list : { |
| 29 | KEEP(*(SORT(.u_boot_list*))); |
| 30 | } |
| 31 | |
| 32 | . = ALIGN(4); |
| 33 | .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } |
| 34 | |
| 35 | . = ALIGN(4); |
| 36 | .data : { *(.data*) } |
| 37 | |
| 38 | . = ALIGN(4); |
| 39 | __data_end = .; |
| 40 | __init_end = .; |
Simon Glass | 1eeb557 | 2019-09-25 08:11:36 -0600 | [diff] [blame] | 41 | . = ALIGN(4); |
| 42 | .binman_sym_table : { |
| 43 | __binman_sym_start = .; |
| 44 | KEEP(*(SORT(.binman_sym*))); |
| 45 | __binman_sym_end = .; |
Simon Glass | 37c664e | 2021-01-24 10:06:05 -0700 | [diff] [blame] | 46 | |
| 47 | /* |
| 48 | * Force 32-byte alignment so that it lines up with the start of |
| 49 | * bss, which may have up to 32-byte alignment. This ensures |
| 50 | * that the end of the .bin file matches up with |
| 51 | * _image_binary_end or __bss_end - see board_fdt_blob_setup(). |
| 52 | * The alignment of BSS depends on what is in it, so can range |
| 53 | * from 4 to 32 bytes. |
| 54 | */ |
| 55 | . = ALIGN(32); |
Simon Glass | 1eeb557 | 2019-09-25 08:11:36 -0600 | [diff] [blame] | 56 | } |
Simon Glass | 3c2dd537 | 2017-01-16 07:04:02 -0700 | [diff] [blame] | 57 | |
| 58 | _image_binary_end = .; |
| 59 | |
Simon Glass | 76baecf | 2021-01-24 10:06:06 -0700 | [diff] [blame^] | 60 | #if CONFIG_IS_ENABLED(SEPARATE_BSS) |
Simon Glass | 3c2dd537 | 2017-01-16 07:04:02 -0700 | [diff] [blame] | 61 | . = 0x120000; |
Simon Glass | 76baecf | 2021-01-24 10:06:06 -0700 | [diff] [blame^] | 62 | #endif |
Simon Glass | 3c2dd537 | 2017-01-16 07:04:02 -0700 | [diff] [blame] | 63 | .bss (OVERLAY) : { |
| 64 | __bss_start = .; |
| 65 | *(.bss*) |
| 66 | *(COM*) |
| 67 | . = ALIGN(4); |
| 68 | __bss_end = .; |
| 69 | } |
| 70 | __bss_size = __bss_end - __bss_start; |
| 71 | |
| 72 | /DISCARD/ : { *(.dynstr*) } |
| 73 | /DISCARD/ : { *(.dynamic*) } |
| 74 | /DISCARD/ : { *(.plt*) } |
| 75 | /DISCARD/ : { *(.interp*) } |
| 76 | /DISCARD/ : { *(.gnu*) } |
| 77 | |
Simon Glass | d68574a | 2019-04-25 21:58:53 -0600 | [diff] [blame] | 78 | #if defined(CONFIG_SPL_X86_16BIT_INIT) || defined(CONFIG_TPL_X86_16BIT_INIT) |
Simon Glass | 3c2dd537 | 2017-01-16 07:04:02 -0700 | [diff] [blame] | 79 | /* |
| 80 | * The following expressions place the 16-bit Real-Mode code and |
| 81 | * Reset Vector at the end of the Flash ROM |
| 82 | */ |
| 83 | . = START_16 - RESET_SEG_START; |
| 84 | .start16 : AT (START_16) { |
| 85 | KEEP(*(.start16)); |
| 86 | } |
| 87 | |
| 88 | . = RESET_VEC_LOC - RESET_SEG_START; |
| 89 | .resetvec : AT (RESET_VEC_LOC) { |
| 90 | KEEP(*(.resetvec)); |
| 91 | } |
| 92 | #endif |
| 93 | |
| 94 | } |