Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 as |
| 6 | * published by the Free Software Foundation. |
| 7 | */ |
| 8 | |
| 9 | #include <asm-generic/vmlinux.lds.h> |
| 10 | #include <asm/cache.h> |
| 11 | #include <asm/page.h> |
| 12 | #include <asm/thread_info.h> |
| 13 | #include <plat/memmap.h> |
| 14 | |
| 15 | OUTPUT_ARCH(arc) |
| 16 | ENTRY(_stext) |
| 17 | |
| 18 | #ifdef CONFIG_CPU_BIG_ENDIAN |
| 19 | jiffies = jiffies_64 + 4; |
| 20 | #else |
| 21 | jiffies = jiffies_64; |
| 22 | #endif |
| 23 | |
| 24 | SECTIONS |
| 25 | { |
| 26 | . = CONFIG_LINUX_LINK_BASE; |
| 27 | |
| 28 | _int_vec_base_lds = .; |
| 29 | .vector : { |
| 30 | *(.vector) |
| 31 | . = ALIGN(PAGE_SIZE); |
| 32 | } |
| 33 | |
| 34 | /* |
| 35 | * The reason for having a seperate subsection .init.ramfs is to |
| 36 | * prevent objump from including it in kernel dumps |
| 37 | * |
| 38 | * Reason for having .init.ramfs above .init is to make sure that the |
| 39 | * binary blob is tucked away to one side, reducing the displacement |
| 40 | * between .init.text and .text, avoiding any possible relocation |
| 41 | * errors because of calls from .init.text to .text |
| 42 | * Yes such calls do exist. e.g. |
| 43 | * decompress_inflate.c:gunzip( ) -> zlib_inflate_workspace( ) |
| 44 | */ |
| 45 | |
| 46 | __init_begin = .; |
| 47 | |
| 48 | .init.ramfs : { INIT_RAM_FS } |
| 49 | |
| 50 | . = ALIGN(PAGE_SIZE); |
| 51 | _stext = .; |
| 52 | |
| 53 | HEAD_TEXT_SECTION |
| 54 | INIT_TEXT_SECTION(L1_CACHE_BYTES) |
| 55 | |
| 56 | /* INIT_DATA_SECTION open-coded: special INIT_RAM_FS handling */ |
| 57 | .init.data : { |
| 58 | INIT_DATA |
| 59 | INIT_SETUP(L1_CACHE_BYTES) |
| 60 | INIT_CALLS |
| 61 | CON_INITCALL |
| 62 | SECURITY_INITCALL |
| 63 | } |
| 64 | |
| 65 | PERCPU_SECTION(L1_CACHE_BYTES) |
| 66 | |
| 67 | /* |
| 68 | * .exit.text is discard at runtime, not link time, to deal with |
| 69 | * references from .debug_frame |
| 70 | * It will be init freed, being inside [__init_start : __init_end] |
| 71 | */ |
| 72 | .exit.text : { EXIT_TEXT } |
| 73 | .exit.data : { EXIT_DATA } |
| 74 | |
| 75 | . = ALIGN(PAGE_SIZE); |
| 76 | __init_end = .; |
| 77 | |
| 78 | .text : { |
| 79 | _text = .; |
| 80 | TEXT_TEXT |
| 81 | SCHED_TEXT |
| 82 | LOCK_TEXT |
| 83 | KPROBES_TEXT |
| 84 | *(.fixup) |
| 85 | *(.gnu.warning) |
| 86 | } |
| 87 | EXCEPTION_TABLE(L1_CACHE_BYTES) |
| 88 | _etext = .; |
| 89 | |
| 90 | _sdata = .; |
| 91 | RO_DATA_SECTION(PAGE_SIZE) |
| 92 | |
| 93 | /* |
| 94 | * 1. this is .data essentially |
| 95 | * 2. THREAD_SIZE for init.task, must be kernel-stk sz aligned |
| 96 | */ |
| 97 | RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) |
| 98 | |
| 99 | _edata = .; |
| 100 | |
| 101 | BSS_SECTION(0, 0, 0) |
| 102 | |
Vineet Gupta | 854a0d9 | 2013-01-22 17:03:19 +0530 | [diff] [blame^] | 103 | #ifdef CONFIG_ARC_DW2_UNWIND |
| 104 | . = ALIGN(PAGE_SIZE); |
| 105 | .debug_frame : { |
| 106 | __start_unwind = .; |
| 107 | *(.debug_frame) |
| 108 | __end_unwind = .; |
| 109 | } |
| 110 | #else |
| 111 | /DISCARD/ : { *(.debug_frame) } |
| 112 | #endif |
| 113 | |
Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 114 | NOTES |
| 115 | |
| 116 | . = ALIGN(PAGE_SIZE); |
| 117 | _end = . ; |
| 118 | |
| 119 | STABS_DEBUG |
Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 120 | DISCARDS |
| 121 | |
| 122 | .arcextmap 0 : { |
| 123 | *(.gnu.linkonce.arcextmap.*) |
| 124 | *(.arcextmap.*) |
| 125 | } |
Vineet Gupta | 854a0d9 | 2013-01-22 17:03:19 +0530 | [diff] [blame^] | 126 | |
| 127 | /* open-coded because we need .debug_frame seperately for unwinding */ |
| 128 | .debug_aranges 0 : { *(.debug_aranges) } |
| 129 | .debug_pubnames 0 : { *(.debug_pubnames) } |
| 130 | .debug_info 0 : { *(.debug_info) } |
| 131 | .debug_abbrev 0 : { *(.debug_abbrev) } |
| 132 | .debug_line 0 : { *(.debug_line) } |
| 133 | .debug_str 0 : { *(.debug_str) } |
| 134 | .debug_loc 0 : { *(.debug_loc) } |
| 135 | .debug_macinfo 0 : { *(.debug_macinfo) } |
| 136 | |
Vineet Gupta | cfdbc2e | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 137 | } |