Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Simon Glass | 9bce37c | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2011 The Chromium OS Authors. |
Simon Glass | 9bce37c | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | /* Taken from Linux kernel, commit f56c3196 */ |
| 7 | |
| 8 | #ifndef _ASM_GENERIC_SECTIONS_H_ |
| 9 | #define _ASM_GENERIC_SECTIONS_H_ |
| 10 | |
| 11 | /* References to section boundaries */ |
| 12 | |
| 13 | extern char _text[], _stext[], _etext[]; |
| 14 | extern char _data[], _sdata[], _edata[]; |
| 15 | extern char __bss_start[], __bss_stop[]; |
| 16 | extern char __init_begin[], __init_end[]; |
| 17 | extern char _sinittext[], _einittext[]; |
Simon Glass | 62cf912 | 2013-04-26 02:53:43 +0000 | [diff] [blame] | 18 | extern char _end[], _init[]; |
Simon Glass | 9bce37c | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 19 | extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[]; |
| 20 | extern char __kprobes_text_start[], __kprobes_text_end[]; |
| 21 | extern char __entry_text_start[], __entry_text_end[]; |
| 22 | extern char __initdata_begin[], __initdata_end[]; |
| 23 | extern char __start_rodata[], __end_rodata[]; |
Heinrich Schuchardt | 7804ae9 | 2017-09-05 03:19:37 +0200 | [diff] [blame] | 24 | extern char __efi_helloworld_begin[]; |
| 25 | extern char __efi_helloworld_end[]; |
Simon Glass | 9bce37c | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 26 | |
| 27 | /* Start and end of .ctors section - used for constructor calls. */ |
| 28 | extern char __ctors_start[], __ctors_end[]; |
| 29 | |
| 30 | /* function descriptor handling (if any). Override |
| 31 | * in asm/sections.h */ |
| 32 | #ifndef dereference_function_descriptor |
| 33 | #define dereference_function_descriptor(p) (p) |
| 34 | #endif |
| 35 | |
| 36 | /* random extra sections (if any). Override |
| 37 | * in asm/sections.h */ |
| 38 | #ifndef arch_is_kernel_text |
| 39 | static inline int arch_is_kernel_text(unsigned long addr) |
| 40 | { |
| 41 | return 0; |
| 42 | } |
| 43 | #endif |
| 44 | |
| 45 | #ifndef arch_is_kernel_data |
| 46 | static inline int arch_is_kernel_data(unsigned long addr) |
| 47 | { |
| 48 | return 0; |
| 49 | } |
| 50 | #endif |
| 51 | |
| 52 | /* U-Boot-specific things begin here */ |
| 53 | |
| 54 | /* Start of U-Boot text region */ |
| 55 | extern char __text_start[]; |
| 56 | |
| 57 | /* This marks the end of the text region which must be relocated */ |
| 58 | extern char __image_copy_end[]; |
| 59 | |
| 60 | /* |
| 61 | * This is the U-Boot entry point - prior to relocation it should be same |
| 62 | * as __text_start |
| 63 | */ |
| 64 | extern void _start(void); |
| 65 | |
| 66 | /* |
Albert ARIBAUD | 6e29472 | 2014-02-22 17:53:43 +0100 | [diff] [blame] | 67 | * ARM defines its symbols as char[]. Other arches define them as ulongs. |
Simon Glass | 9bce37c | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 68 | */ |
| 69 | #ifdef CONFIG_ARM |
Simon Glass | 9bce37c | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 70 | |
Albert ARIBAUD | 6e29472 | 2014-02-22 17:53:43 +0100 | [diff] [blame] | 71 | extern char __bss_start[]; |
| 72 | extern char __bss_end[]; |
| 73 | extern char __image_copy_start[]; |
| 74 | extern char __image_copy_end[]; |
Simon Glass | 77ec34e | 2015-10-17 19:41:19 -0600 | [diff] [blame] | 75 | extern char _image_binary_end[]; |
Albert ARIBAUD | 6e29472 | 2014-02-22 17:53:43 +0100 | [diff] [blame] | 76 | extern char __rel_dyn_start[]; |
| 77 | extern char __rel_dyn_end[]; |
Simon Glass | 9bce37c | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 78 | |
| 79 | #else /* don't use offsets: */ |
| 80 | |
| 81 | /* Exports from the Linker Script */ |
| 82 | extern ulong __data_end; |
| 83 | extern ulong __rel_dyn_start; |
| 84 | extern ulong __rel_dyn_end; |
| 85 | extern ulong __bss_end; |
Simon Glass | b30c97f | 2016-09-25 21:33:05 -0600 | [diff] [blame] | 86 | extern ulong _image_binary_end; |
Simon Glass | 9bce37c | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 87 | |
| 88 | extern ulong _TEXT_BASE; /* code start */ |
| 89 | |
| 90 | #endif |
| 91 | |
| 92 | #endif /* _ASM_GENERIC_SECTIONS_H_ */ |