Catalin Marinas | 8c2c3df | 2012-04-20 14:45:54 +0100 | [diff] [blame] | 1 | /* |
| 2 | * ld script to make ARM Linux kernel |
| 3 | * taken from the i386 version by Russell King |
| 4 | * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz> |
| 5 | */ |
| 6 | |
| 7 | #include <asm-generic/vmlinux.lds.h> |
| 8 | #include <asm/thread_info.h> |
| 9 | #include <asm/memory.h> |
| 10 | #include <asm/page.h> |
| 11 | |
| 12 | #define ARM_EXIT_KEEP(x) |
| 13 | #define ARM_EXIT_DISCARD(x) x |
| 14 | |
| 15 | OUTPUT_ARCH(aarch64) |
| 16 | ENTRY(stext) |
| 17 | |
| 18 | jiffies = jiffies_64; |
| 19 | |
| 20 | SECTIONS |
| 21 | { |
| 22 | /* |
| 23 | * XXX: The linker does not define how output sections are |
| 24 | * assigned to input sections when there are multiple statements |
| 25 | * matching the same input section name. There is no documented |
| 26 | * order of matching. |
| 27 | */ |
| 28 | /DISCARD/ : { |
| 29 | ARM_EXIT_DISCARD(EXIT_TEXT) |
| 30 | ARM_EXIT_DISCARD(EXIT_DATA) |
| 31 | EXIT_CALL |
| 32 | *(.discard) |
| 33 | *(.discard.*) |
| 34 | } |
| 35 | |
| 36 | . = PAGE_OFFSET + TEXT_OFFSET; |
| 37 | |
| 38 | .head.text : { |
| 39 | _text = .; |
| 40 | HEAD_TEXT |
| 41 | } |
| 42 | .text : { /* Real text segment */ |
| 43 | _stext = .; /* Text and read-only data */ |
| 44 | *(.smp.pen.text) |
| 45 | __exception_text_start = .; |
| 46 | *(.exception.text) |
| 47 | __exception_text_end = .; |
| 48 | IRQENTRY_TEXT |
| 49 | TEXT_TEXT |
| 50 | SCHED_TEXT |
| 51 | LOCK_TEXT |
| 52 | *(.fixup) |
| 53 | *(.gnu.warning) |
| 54 | . = ALIGN(16); |
| 55 | *(.got) /* Global offset table */ |
| 56 | } |
| 57 | |
| 58 | RO_DATA(PAGE_SIZE) |
Will Deacon | adace89 | 2013-05-08 17:29:24 +0100 | [diff] [blame^] | 59 | EXCEPTION_TABLE(8) |
Catalin Marinas | 8c2c3df | 2012-04-20 14:45:54 +0100 | [diff] [blame] | 60 | _etext = .; /* End of text and rodata section */ |
| 61 | |
| 62 | . = ALIGN(PAGE_SIZE); |
| 63 | __init_begin = .; |
| 64 | |
| 65 | INIT_TEXT_SECTION(8) |
| 66 | .exit.text : { |
| 67 | ARM_EXIT_KEEP(EXIT_TEXT) |
| 68 | } |
| 69 | . = ALIGN(16); |
| 70 | .init.data : { |
| 71 | INIT_DATA |
| 72 | INIT_SETUP(16) |
| 73 | INIT_CALLS |
| 74 | CON_INITCALL |
| 75 | SECURITY_INITCALL |
| 76 | INIT_RAM_FS |
| 77 | } |
| 78 | .exit.data : { |
| 79 | ARM_EXIT_KEEP(EXIT_DATA) |
| 80 | } |
| 81 | |
| 82 | PERCPU_SECTION(64) |
| 83 | |
| 84 | __init_end = .; |
| 85 | . = ALIGN(THREAD_SIZE); |
| 86 | __data_loc = .; |
| 87 | |
| 88 | .data : AT(__data_loc) { |
| 89 | _data = .; /* address in memory */ |
| 90 | _sdata = .; |
| 91 | |
| 92 | /* |
| 93 | * first, the init task union, aligned |
| 94 | * to an 8192 byte boundary. |
| 95 | */ |
| 96 | INIT_TASK_DATA(THREAD_SIZE) |
| 97 | NOSAVE_DATA |
| 98 | CACHELINE_ALIGNED_DATA(64) |
| 99 | READ_MOSTLY_DATA(64) |
| 100 | |
| 101 | /* |
Catalin Marinas | 8c2c3df | 2012-04-20 14:45:54 +0100 | [diff] [blame] | 102 | * and the usual data section |
| 103 | */ |
| 104 | DATA_DATA |
| 105 | CONSTRUCTORS |
| 106 | |
| 107 | _edata = .; |
| 108 | } |
| 109 | _edata_loc = __data_loc + SIZEOF(.data); |
| 110 | |
| 111 | NOTES |
| 112 | |
| 113 | BSS_SECTION(0, 0, 0) |
| 114 | _end = .; |
| 115 | |
| 116 | STABS_DEBUG |
| 117 | .comment 0 : { *(.comment) } |
| 118 | } |