1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Override linker script for fastboot-readable images
4 *
5 * (C) Copyright 2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
6 *
7 * Based on arch/arm/cpu/armv8/u-boot.lds (Just add header)
8 */
9
10OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64")
11OUTPUT_ARCH(aarch64)
12ENTRY(_arm64_header)
13SECTIONS
14{
15	. = 0x00000000;
16
17	. = ALIGN(8);
18	.text :
19	{
20		*(.__image_copy_start)
21		board/qualcomm/dragonboard410c/head.o (.text*)
22		CPUDIR/start.o (.text*)
23	}
24
25	/* This needs to come before *(.text*) */
26	.efi_runtime : {
27                __efi_runtime_start = .;
28		*(.text.efi_runtime*)
29		*(.rodata.efi_runtime*)
30		*(.data.efi_runtime*)
31                __efi_runtime_stop = .;
32	}
33
34	.text_rest :
35	{
36		*(.text*)
37	}
38
39	. = ALIGN(8);
40	.rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
41
42	. = ALIGN(8);
43	.data : {
44		*(.data*)
45	}
46
47	. = ALIGN(8);
48
49	. = .;
50
51	. = ALIGN(8);
52	.u_boot_list : {
53		KEEP(*(SORT(.u_boot_list*)));
54	}
55
56	. = ALIGN(8);
57
58	.efi_runtime : {
59                __efi_runtime_start = .;
60		*(efi_runtime_text)
61		*(efi_runtime_data)
62                __efi_runtime_stop = .;
63	}
64
65	.efi_runtime_rel : {
66                __efi_runtime_rel_start = .;
67		*(.rel*.efi_runtime)
68		*(.rel*.efi_runtime.*)
69                __efi_runtime_rel_stop = .;
70	}
71
72	. = ALIGN(8);
73
74	.image_copy_end :
75	{
76		*(.__image_copy_end)
77	}
78
79	. = ALIGN(8);
80
81	.rel_dyn_start :
82	{
83		*(.__rel_dyn_start)
84	}
85
86	.rela.dyn : {
87		*(.rela*)
88	}
89
90	.rel_dyn_end :
91	{
92		*(.__rel_dyn_end)
93	}
94
95	_end = .;
96
97	. = ALIGN(8);
98
99	.bss_start : {
100		KEEP(*(.__bss_start));
101	}
102
103	.bss : {
104		*(.bss*)
105		 . = ALIGN(8);
106	}
107
108	.bss_end : {
109		KEEP(*(.__bss_end));
110	}
111
112	/DISCARD/ : { *(.dynsym) }
113	/DISCARD/ : { *(.dynstr*) }
114	/DISCARD/ : { *(.dynamic*) }
115	/DISCARD/ : { *(.plt*) }
116	/DISCARD/ : { *(.interp*) }
117	/DISCARD/ : { *(.gnu*) }
118}
119