Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 1 | #include <asm-generic/vmlinux.lds.h> |
| 2 | #include <asm/page.h> |
| 3 | #include <asm/cache.h> |
| 4 | #include <asm/thread_info.h> |
| 5 | #include <hv/hypervisor.h> |
| 6 | |
| 7 | /* Text loads starting from the supervisor interrupt vector address. */ |
Chris Metcalf | acbde1d | 2013-09-03 14:41:36 -0400 | [diff] [blame] | 8 | #define TEXT_OFFSET MEM_SV_START |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 9 | |
| 10 | OUTPUT_ARCH(tile) |
| 11 | ENTRY(_start) |
| 12 | jiffies = jiffies_64; |
| 13 | |
| 14 | PHDRS |
| 15 | { |
Chris Metcalf | acbde1d | 2013-09-03 14:41:36 -0400 | [diff] [blame] | 16 | intrpt PT_LOAD ; |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 17 | text PT_LOAD ; |
| 18 | data PT_LOAD ; |
| 19 | } |
| 20 | SECTIONS |
| 21 | { |
| 22 | /* Text is loaded with a different VA than data; start with text. */ |
| 23 | #undef LOAD_OFFSET |
| 24 | #define LOAD_OFFSET TEXT_OFFSET |
| 25 | |
| 26 | /* Interrupt vectors */ |
Chris Metcalf | acbde1d | 2013-09-03 14:41:36 -0400 | [diff] [blame] | 27 | .intrpt (LOAD_OFFSET) : AT ( 0 ) /* put at the start of physical memory */ |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 28 | { |
| 29 | _text = .; |
Chris Metcalf | acbde1d | 2013-09-03 14:41:36 -0400 | [diff] [blame] | 30 | *(.intrpt) |
| 31 | } :intrpt =0 |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 32 | |
| 33 | /* Hypervisor call vectors */ |
Chris Metcalf | 9ae0983 | 2013-08-07 16:03:08 -0400 | [diff] [blame] | 34 | . = ALIGN(0x10000); |
| 35 | .hvglue : AT (ADDR(.hvglue) - LOAD_OFFSET) { |
| 36 | *(.hvglue) |
| 37 | } :NONE |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 38 | |
| 39 | /* Now the real code */ |
| 40 | . = ALIGN(0x20000); |
Jiang Liu | 40a3b8d | 2013-07-03 15:03:39 -0700 | [diff] [blame] | 41 | _stext = .; |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 42 | .text : AT (ADDR(.text) - LOAD_OFFSET) { |
Chris Metcalf | 0707ad3 | 2010-06-25 17:04:17 -0400 | [diff] [blame] | 43 | HEAD_TEXT |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 44 | SCHED_TEXT |
| 45 | LOCK_TEXT |
Tony Lu | 3fa17c3 | 2013-08-09 15:08:57 -0400 | [diff] [blame] | 46 | KPROBES_TEXT |
Tony Lu | a61fd5e | 2013-08-09 13:26:09 -0400 | [diff] [blame] | 47 | IRQENTRY_TEXT |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 48 | __fix_text_end = .; /* tile-cpack won't rearrange before this */ |
Chris Metcalf | e56059f | 2013-08-09 16:50:36 -0400 | [diff] [blame] | 49 | ALIGN_FUNCTION(); |
| 50 | *(.hottext*) |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 51 | TEXT_TEXT |
| 52 | *(.text.*) |
| 53 | *(.coldtext*) |
| 54 | *(.fixup) |
| 55 | *(.gnu.warning) |
Chris Metcalf | 0707ad3 | 2010-06-25 17:04:17 -0400 | [diff] [blame] | 56 | } :text =0 |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 57 | _etext = .; |
| 58 | |
| 59 | /* "Init" is divided into two areas with very different virtual addresses. */ |
| 60 | INIT_TEXT_SECTION(PAGE_SIZE) |
| 61 | |
| 62 | /* Now we skip back to PAGE_OFFSET for the data. */ |
| 63 | . = (. - TEXT_OFFSET + PAGE_OFFSET); |
| 64 | #undef LOAD_OFFSET |
| 65 | #define LOAD_OFFSET PAGE_OFFSET |
| 66 | |
| 67 | . = ALIGN(PAGE_SIZE); |
Jiang Liu | 40a3b8d | 2013-07-03 15:03:39 -0700 | [diff] [blame] | 68 | __init_begin = .; |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 69 | VMLINUX_SYMBOL(_sinitdata) = .; |
Chris Metcalf | 2cb8240 | 2011-02-27 18:52:24 -0500 | [diff] [blame] | 70 | INIT_DATA_SECTION(16) :data =0 |
Tejun Heo | 0415b00d1 | 2011-03-24 18:50:09 +0100 | [diff] [blame] | 71 | PERCPU_SECTION(L2_CACHE_BYTES) |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 72 | . = ALIGN(PAGE_SIZE); |
| 73 | VMLINUX_SYMBOL(_einitdata) = .; |
Jiang Liu | 40a3b8d | 2013-07-03 15:03:39 -0700 | [diff] [blame] | 74 | __init_end = .; |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 75 | |
| 76 | _sdata = .; /* Start of data section */ |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 77 | RO_DATA_SECTION(PAGE_SIZE) |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 78 | RW_DATA_SECTION(L2_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) |
Chris Metcalf | 867e359 | 2010-05-28 23:09:12 -0400 | [diff] [blame] | 79 | _edata = .; |
| 80 | |
| 81 | EXCEPTION_TABLE(L2_CACHE_BYTES) |
| 82 | NOTES |
| 83 | |
| 84 | |
| 85 | BSS_SECTION(8, PAGE_SIZE, 1) |
| 86 | _end = . ; |
| 87 | |
| 88 | STABS_DEBUG |
| 89 | DWARF_DEBUG |
| 90 | |
| 91 | DISCARDS |
| 92 | } |