18c2c3df3SCatalin Marinas/* 28c2c3df3SCatalin Marinas * ld script to make ARM Linux kernel 38c2c3df3SCatalin Marinas * taken from the i386 version by Russell King 48c2c3df3SCatalin Marinas * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz> 58c2c3df3SCatalin Marinas */ 68c2c3df3SCatalin Marinas 78c2c3df3SCatalin Marinas#include <asm-generic/vmlinux.lds.h> 88c2c3df3SCatalin Marinas#include <asm/thread_info.h> 98c2c3df3SCatalin Marinas#include <asm/memory.h> 108c2c3df3SCatalin Marinas#include <asm/page.h> 118c2c3df3SCatalin Marinas 128c2c3df3SCatalin Marinas#define ARM_EXIT_KEEP(x) 138c2c3df3SCatalin Marinas#define ARM_EXIT_DISCARD(x) x 148c2c3df3SCatalin Marinas 158c2c3df3SCatalin MarinasOUTPUT_ARCH(aarch64) 168c2c3df3SCatalin MarinasENTRY(stext) 178c2c3df3SCatalin Marinas 188c2c3df3SCatalin Marinasjiffies = jiffies_64; 198c2c3df3SCatalin Marinas 202240bbb6SMarc Zyngier#define HYPERVISOR_TEXT \ 212240bbb6SMarc Zyngier /* \ 222240bbb6SMarc Zyngier * Force the alignment to be compatible with \ 232240bbb6SMarc Zyngier * the vectors requirements \ 242240bbb6SMarc Zyngier */ \ 252240bbb6SMarc Zyngier . = ALIGN(2048); \ 262240bbb6SMarc Zyngier VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \ 272240bbb6SMarc Zyngier *(.hyp.idmap.text) \ 282240bbb6SMarc Zyngier VMLINUX_SYMBOL(__hyp_idmap_text_end) = .; \ 292240bbb6SMarc Zyngier VMLINUX_SYMBOL(__hyp_text_start) = .; \ 302240bbb6SMarc Zyngier *(.hyp.text) \ 312240bbb6SMarc Zyngier VMLINUX_SYMBOL(__hyp_text_end) = .; 322240bbb6SMarc Zyngier 338c2c3df3SCatalin MarinasSECTIONS 348c2c3df3SCatalin Marinas{ 358c2c3df3SCatalin Marinas /* 368c2c3df3SCatalin Marinas * XXX: The linker does not define how output sections are 378c2c3df3SCatalin Marinas * assigned to input sections when there are multiple statements 388c2c3df3SCatalin Marinas * matching the same input section name. There is no documented 398c2c3df3SCatalin Marinas * order of matching. 408c2c3df3SCatalin Marinas */ 418c2c3df3SCatalin Marinas /DISCARD/ : { 428c2c3df3SCatalin Marinas ARM_EXIT_DISCARD(EXIT_TEXT) 438c2c3df3SCatalin Marinas ARM_EXIT_DISCARD(EXIT_DATA) 448c2c3df3SCatalin Marinas EXIT_CALL 458c2c3df3SCatalin Marinas *(.discard) 468c2c3df3SCatalin Marinas *(.discard.*) 478c2c3df3SCatalin Marinas } 488c2c3df3SCatalin Marinas 498c2c3df3SCatalin Marinas . = PAGE_OFFSET + TEXT_OFFSET; 508c2c3df3SCatalin Marinas 518c2c3df3SCatalin Marinas .head.text : { 528c2c3df3SCatalin Marinas _text = .; 538c2c3df3SCatalin Marinas HEAD_TEXT 548c2c3df3SCatalin Marinas } 558c2c3df3SCatalin Marinas .text : { /* Real text segment */ 568c2c3df3SCatalin Marinas _stext = .; /* Text and read-only data */ 578c2c3df3SCatalin Marinas *(.smp.pen.text) 588c2c3df3SCatalin Marinas __exception_text_start = .; 598c2c3df3SCatalin Marinas *(.exception.text) 608c2c3df3SCatalin Marinas __exception_text_end = .; 618c2c3df3SCatalin Marinas IRQENTRY_TEXT 628c2c3df3SCatalin Marinas TEXT_TEXT 638c2c3df3SCatalin Marinas SCHED_TEXT 648c2c3df3SCatalin Marinas LOCK_TEXT 652240bbb6SMarc Zyngier HYPERVISOR_TEXT 668c2c3df3SCatalin Marinas *(.fixup) 678c2c3df3SCatalin Marinas *(.gnu.warning) 688c2c3df3SCatalin Marinas . = ALIGN(16); 698c2c3df3SCatalin Marinas *(.got) /* Global offset table */ 708c2c3df3SCatalin Marinas } 718c2c3df3SCatalin Marinas 728c2c3df3SCatalin Marinas RO_DATA(PAGE_SIZE) 73adace895SWill Deacon EXCEPTION_TABLE(8) 74*c80b7ee8SMark Salter NOTES 758c2c3df3SCatalin Marinas _etext = .; /* End of text and rodata section */ 768c2c3df3SCatalin Marinas 778c2c3df3SCatalin Marinas . = ALIGN(PAGE_SIZE); 788c2c3df3SCatalin Marinas __init_begin = .; 798c2c3df3SCatalin Marinas 808c2c3df3SCatalin Marinas INIT_TEXT_SECTION(8) 818c2c3df3SCatalin Marinas .exit.text : { 828c2c3df3SCatalin Marinas ARM_EXIT_KEEP(EXIT_TEXT) 838c2c3df3SCatalin Marinas } 848c2c3df3SCatalin Marinas . = ALIGN(16); 858c2c3df3SCatalin Marinas .init.data : { 868c2c3df3SCatalin Marinas INIT_DATA 878c2c3df3SCatalin Marinas INIT_SETUP(16) 888c2c3df3SCatalin Marinas INIT_CALLS 898c2c3df3SCatalin Marinas CON_INITCALL 908c2c3df3SCatalin Marinas SECURITY_INITCALL 918c2c3df3SCatalin Marinas INIT_RAM_FS 928c2c3df3SCatalin Marinas } 938c2c3df3SCatalin Marinas .exit.data : { 948c2c3df3SCatalin Marinas ARM_EXIT_KEEP(EXIT_DATA) 958c2c3df3SCatalin Marinas } 968c2c3df3SCatalin Marinas 978c2c3df3SCatalin Marinas PERCPU_SECTION(64) 988c2c3df3SCatalin Marinas 998c2c3df3SCatalin Marinas __init_end = .; 1008c2c3df3SCatalin Marinas . = ALIGN(THREAD_SIZE); 1018c2c3df3SCatalin Marinas __data_loc = .; 1028c2c3df3SCatalin Marinas 1038c2c3df3SCatalin Marinas .data : AT(__data_loc) { 1048c2c3df3SCatalin Marinas _data = .; /* address in memory */ 1058c2c3df3SCatalin Marinas _sdata = .; 1068c2c3df3SCatalin Marinas 1078c2c3df3SCatalin Marinas /* 1088c2c3df3SCatalin Marinas * first, the init task union, aligned 1098c2c3df3SCatalin Marinas * to an 8192 byte boundary. 1108c2c3df3SCatalin Marinas */ 1118c2c3df3SCatalin Marinas INIT_TASK_DATA(THREAD_SIZE) 1128c2c3df3SCatalin Marinas NOSAVE_DATA 1138c2c3df3SCatalin Marinas CACHELINE_ALIGNED_DATA(64) 1148c2c3df3SCatalin Marinas READ_MOSTLY_DATA(64) 1158c2c3df3SCatalin Marinas 1168c2c3df3SCatalin Marinas /* 1178c2c3df3SCatalin Marinas * and the usual data section 1188c2c3df3SCatalin Marinas */ 1198c2c3df3SCatalin Marinas DATA_DATA 1208c2c3df3SCatalin Marinas CONSTRUCTORS 1218c2c3df3SCatalin Marinas 1228c2c3df3SCatalin Marinas _edata = .; 1238c2c3df3SCatalin Marinas } 1248c2c3df3SCatalin Marinas _edata_loc = __data_loc + SIZEOF(.data); 1258c2c3df3SCatalin Marinas 1268c2c3df3SCatalin Marinas BSS_SECTION(0, 0, 0) 1278c2c3df3SCatalin Marinas _end = .; 1288c2c3df3SCatalin Marinas 1298c2c3df3SCatalin Marinas STABS_DEBUG 1308c2c3df3SCatalin Marinas .comment 0 : { *(.comment) } 1318c2c3df3SCatalin Marinas} 1322240bbb6SMarc Zyngier 1332240bbb6SMarc Zyngier/* 1342240bbb6SMarc Zyngier * The HYP init code can't be more than a page long. 1352240bbb6SMarc Zyngier */ 1362240bbb6SMarc ZyngierASSERT(((__hyp_idmap_text_start + PAGE_SIZE) > __hyp_idmap_text_end), 1372240bbb6SMarc Zyngier "HYP init code too big") 138