1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * ld script for the c6x kernel 4 * 5 * Copyright (C) 2010, 2011 Texas Instruments Incorporated 6 * Mark Salter <msalter@redhat.com> 7 */ 8#include <asm-generic/vmlinux.lds.h> 9#include <asm/thread_info.h> 10#include <asm/page.h> 11 12ENTRY(_c_int00) 13 14#if defined(CONFIG_CPU_BIG_ENDIAN) 15jiffies = jiffies_64 + 4; 16#else 17jiffies = jiffies_64; 18#endif 19 20#define READONLY_SEGMENT_START \ 21 . = PAGE_OFFSET; 22#define READWRITE_SEGMENT_START \ 23 . = ALIGN(128); \ 24 _data_lma = .; 25 26SECTIONS 27{ 28 /* 29 * Start kernel read only segment 30 */ 31 READONLY_SEGMENT_START 32 33 .vectors : 34 { 35 _vectors_start = .; 36 *(.vectors) 37 . = ALIGN(0x400); 38 _vectors_end = .; 39 } 40 41 /* 42 * This section contains data which may be shared with other 43 * cores. It needs to be a fixed offset from PAGE_OFFSET 44 * regardless of kernel configuration. 45 */ 46 .virtio_ipc_dev : 47 { 48 *(.virtio_ipc_dev) 49 } 50 51 . = ALIGN(PAGE_SIZE); 52 __init_begin = .; 53 .init : 54 { 55 _sinittext = .; 56 HEAD_TEXT 57 INIT_TEXT 58 _einittext = .; 59 } 60 61 INIT_DATA_SECTION(16) 62 63 PERCPU_SECTION(128) 64 65 . = ALIGN(PAGE_SIZE); 66 __init_end = .; 67 68 .text : 69 { 70 _text = .; 71 _stext = .; 72 TEXT_TEXT 73 SCHED_TEXT 74 CPUIDLE_TEXT 75 LOCK_TEXT 76 IRQENTRY_TEXT 77 SOFTIRQENTRY_TEXT 78 KPROBES_TEXT 79 *(.fixup) 80 *(.gnu.warning) 81 } 82 83 EXCEPTION_TABLE(16) 84 NOTES 85 86 RO_DATA_SECTION(PAGE_SIZE) 87 .const : 88 { 89 *(.const .const.* .gnu.linkonce.r.*) 90 *(.switch) 91 } 92 93 . = ALIGN (8) ; 94 __fdt_blob : AT(ADDR(__fdt_blob) - LOAD_OFFSET) 95 { 96 _fdt_start = . ; /* place for fdt blob */ 97 *(__fdt_blob) ; /* Any link-placed DTB */ 98 BYTE(0); /* section always has contents */ 99 . = _fdt_start + 0x4000; /* Pad up to 16kbyte */ 100 _fdt_end = . ; 101 } 102 103 _etext = .; 104 105 /* 106 * Start kernel read-write segment. 107 */ 108 READWRITE_SEGMENT_START 109 _sdata = .; 110 111 .fardata : AT(ADDR(.fardata) - LOAD_OFFSET) 112 { 113 INIT_TASK_DATA(THREAD_SIZE) 114 NOSAVE_DATA 115 PAGE_ALIGNED_DATA(PAGE_SIZE) 116 CACHELINE_ALIGNED_DATA(128) 117 READ_MOSTLY_DATA(128) 118 DATA_DATA 119 CONSTRUCTORS 120 *(.data1) 121 *(.fardata .fardata.*) 122 *(.data.debug_bpt) 123 } 124 125 .neardata ALIGN(8) : AT(ADDR(.neardata) - LOAD_OFFSET) 126 { 127 *(.neardata2 .neardata2.* .gnu.linkonce.s2.*) 128 *(.neardata .neardata.* .gnu.linkonce.s.*) 129 . = ALIGN(8); 130 } 131 132 BUG_TABLE 133 134 _edata = .; 135 136 __bss_start = .; 137 SBSS(8) 138 BSS(8) 139 .far : 140 { 141 . = ALIGN(8); 142 *(.dynfar) 143 *(.far .far.* .gnu.linkonce.b.*) 144 . = ALIGN(8); 145 } 146 __bss_stop = .; 147 148 _end = .; 149 150 DWARF_DEBUG 151 152 /DISCARD/ : 153 { 154 EXIT_TEXT 155 EXIT_DATA 156 EXIT_CALL 157 *(.discard) 158 *(.discard.*) 159 *(.interp) 160 } 161} 162