Commit e56059f2d3b8a053c965a51587a4a3328ac00a47
1 parent
c0f0601060
Exists in
smarc-imx_3.14.28_1.0.0_ga
and in
1 other branch
tile: group .hottext* sections properly in vmlinux.lds
With this change such sections are grouped with regular text in the vmlinux image; this change puts them at the front, which is where the standard Linux includes .text.hot*. This change should fix a recently-observed bug where a bunch of symbols were being omitted from the /proc/kallsyms output because they fell between _etext and _sinittext. Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Showing 1 changed file with 2 additions and 0 deletions Inline Diff
arch/tile/kernel/vmlinux.lds.S
1 | #include <asm-generic/vmlinux.lds.h> | 1 | #include <asm-generic/vmlinux.lds.h> |
2 | #include <asm/page.h> | 2 | #include <asm/page.h> |
3 | #include <asm/cache.h> | 3 | #include <asm/cache.h> |
4 | #include <asm/thread_info.h> | 4 | #include <asm/thread_info.h> |
5 | #include <hv/hypervisor.h> | 5 | #include <hv/hypervisor.h> |
6 | 6 | ||
7 | /* Text loads starting from the supervisor interrupt vector address. */ | 7 | /* Text loads starting from the supervisor interrupt vector address. */ |
8 | #define TEXT_OFFSET MEM_SV_INTRPT | 8 | #define TEXT_OFFSET MEM_SV_INTRPT |
9 | 9 | ||
10 | OUTPUT_ARCH(tile) | 10 | OUTPUT_ARCH(tile) |
11 | ENTRY(_start) | 11 | ENTRY(_start) |
12 | jiffies = jiffies_64; | 12 | jiffies = jiffies_64; |
13 | 13 | ||
14 | PHDRS | 14 | PHDRS |
15 | { | 15 | { |
16 | intrpt1 PT_LOAD ; | 16 | intrpt1 PT_LOAD ; |
17 | text PT_LOAD ; | 17 | text PT_LOAD ; |
18 | data PT_LOAD ; | 18 | data PT_LOAD ; |
19 | } | 19 | } |
20 | SECTIONS | 20 | SECTIONS |
21 | { | 21 | { |
22 | /* Text is loaded with a different VA than data; start with text. */ | 22 | /* Text is loaded with a different VA than data; start with text. */ |
23 | #undef LOAD_OFFSET | 23 | #undef LOAD_OFFSET |
24 | #define LOAD_OFFSET TEXT_OFFSET | 24 | #define LOAD_OFFSET TEXT_OFFSET |
25 | 25 | ||
26 | /* Interrupt vectors */ | 26 | /* Interrupt vectors */ |
27 | .intrpt1 (LOAD_OFFSET) : AT ( 0 ) /* put at the start of physical memory */ | 27 | .intrpt1 (LOAD_OFFSET) : AT ( 0 ) /* put at the start of physical memory */ |
28 | { | 28 | { |
29 | _text = .; | 29 | _text = .; |
30 | *(.intrpt1) | 30 | *(.intrpt1) |
31 | } :intrpt1 =0 | 31 | } :intrpt1 =0 |
32 | 32 | ||
33 | /* Hypervisor call vectors */ | 33 | /* Hypervisor call vectors */ |
34 | . = ALIGN(0x10000); | 34 | . = ALIGN(0x10000); |
35 | .hvglue : AT (ADDR(.hvglue) - LOAD_OFFSET) { | 35 | .hvglue : AT (ADDR(.hvglue) - LOAD_OFFSET) { |
36 | *(.hvglue) | 36 | *(.hvglue) |
37 | } :NONE | 37 | } :NONE |
38 | 38 | ||
39 | /* Now the real code */ | 39 | /* Now the real code */ |
40 | . = ALIGN(0x20000); | 40 | . = ALIGN(0x20000); |
41 | _stext = .; | 41 | _stext = .; |
42 | .text : AT (ADDR(.text) - LOAD_OFFSET) { | 42 | .text : AT (ADDR(.text) - LOAD_OFFSET) { |
43 | HEAD_TEXT | 43 | HEAD_TEXT |
44 | SCHED_TEXT | 44 | SCHED_TEXT |
45 | LOCK_TEXT | 45 | LOCK_TEXT |
46 | KPROBES_TEXT | 46 | KPROBES_TEXT |
47 | IRQENTRY_TEXT | 47 | IRQENTRY_TEXT |
48 | __fix_text_end = .; /* tile-cpack won't rearrange before this */ | 48 | __fix_text_end = .; /* tile-cpack won't rearrange before this */ |
49 | ALIGN_FUNCTION(); | ||
50 | *(.hottext*) | ||
49 | TEXT_TEXT | 51 | TEXT_TEXT |
50 | *(.text.*) | 52 | *(.text.*) |
51 | *(.coldtext*) | 53 | *(.coldtext*) |
52 | *(.fixup) | 54 | *(.fixup) |
53 | *(.gnu.warning) | 55 | *(.gnu.warning) |
54 | } :text =0 | 56 | } :text =0 |
55 | _etext = .; | 57 | _etext = .; |
56 | 58 | ||
57 | /* "Init" is divided into two areas with very different virtual addresses. */ | 59 | /* "Init" is divided into two areas with very different virtual addresses. */ |
58 | INIT_TEXT_SECTION(PAGE_SIZE) | 60 | INIT_TEXT_SECTION(PAGE_SIZE) |
59 | 61 | ||
60 | /* Now we skip back to PAGE_OFFSET for the data. */ | 62 | /* Now we skip back to PAGE_OFFSET for the data. */ |
61 | . = (. - TEXT_OFFSET + PAGE_OFFSET); | 63 | . = (. - TEXT_OFFSET + PAGE_OFFSET); |
62 | #undef LOAD_OFFSET | 64 | #undef LOAD_OFFSET |
63 | #define LOAD_OFFSET PAGE_OFFSET | 65 | #define LOAD_OFFSET PAGE_OFFSET |
64 | 66 | ||
65 | . = ALIGN(PAGE_SIZE); | 67 | . = ALIGN(PAGE_SIZE); |
66 | __init_begin = .; | 68 | __init_begin = .; |
67 | VMLINUX_SYMBOL(_sinitdata) = .; | 69 | VMLINUX_SYMBOL(_sinitdata) = .; |
68 | INIT_DATA_SECTION(16) :data =0 | 70 | INIT_DATA_SECTION(16) :data =0 |
69 | PERCPU_SECTION(L2_CACHE_BYTES) | 71 | PERCPU_SECTION(L2_CACHE_BYTES) |
70 | . = ALIGN(PAGE_SIZE); | 72 | . = ALIGN(PAGE_SIZE); |
71 | VMLINUX_SYMBOL(_einitdata) = .; | 73 | VMLINUX_SYMBOL(_einitdata) = .; |
72 | __init_end = .; | 74 | __init_end = .; |
73 | 75 | ||
74 | _sdata = .; /* Start of data section */ | 76 | _sdata = .; /* Start of data section */ |
75 | 77 | ||
76 | RO_DATA_SECTION(PAGE_SIZE) | 78 | RO_DATA_SECTION(PAGE_SIZE) |
77 | 79 | ||
78 | /* initially writeable, then read-only */ | 80 | /* initially writeable, then read-only */ |
79 | . = ALIGN(PAGE_SIZE); | 81 | . = ALIGN(PAGE_SIZE); |
80 | __w1data_begin = .; | 82 | __w1data_begin = .; |
81 | .w1data : AT(ADDR(.w1data) - LOAD_OFFSET) { | 83 | .w1data : AT(ADDR(.w1data) - LOAD_OFFSET) { |
82 | VMLINUX_SYMBOL(__w1data_begin) = .; | 84 | VMLINUX_SYMBOL(__w1data_begin) = .; |
83 | *(.w1data) | 85 | *(.w1data) |
84 | VMLINUX_SYMBOL(__w1data_end) = .; | 86 | VMLINUX_SYMBOL(__w1data_end) = .; |
85 | } | 87 | } |
86 | 88 | ||
87 | RW_DATA_SECTION(L2_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) | 89 | RW_DATA_SECTION(L2_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) |
88 | 90 | ||
89 | _edata = .; | 91 | _edata = .; |
90 | 92 | ||
91 | EXCEPTION_TABLE(L2_CACHE_BYTES) | 93 | EXCEPTION_TABLE(L2_CACHE_BYTES) |
92 | NOTES | 94 | NOTES |
93 | 95 | ||
94 | 96 | ||
95 | BSS_SECTION(8, PAGE_SIZE, 1) | 97 | BSS_SECTION(8, PAGE_SIZE, 1) |
96 | _end = . ; | 98 | _end = . ; |
97 | 99 | ||
98 | STABS_DEBUG | 100 | STABS_DEBUG |
99 | DWARF_DEBUG | 101 | DWARF_DEBUG |
100 | 102 | ||
101 | DISCARDS | 103 | DISCARDS |
102 | } | 104 | } |
103 | 105 |