aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/vmlinux.lds.h
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@in.ibm.com>2006-12-06 20:14:03 -0500
committerAndi Kleen <andi@basil.nowhere.org>2006-12-06 20:14:03 -0500
commit6569580de7ae367def89b7671029cb97c1965574 (patch)
treee20a70b2b3bb71c3197446bc4265a2f458ddee03 /include/asm-generic/vmlinux.lds.h
parent67fd44fea274a5033ceb90284683bc44df61df54 (diff)
[PATCH] i386: Distinguish absolute symbols
Ld knows about 2 kinds of symbols, absolute and section relative. Section relative symbols symbols change value when a section is moved and absolute symbols do not. Currently in the linker script we have several labels marking the beginning and ending of sections that are outside of sections, making them absolute symbols. Having a mixture of absolute and section relative symbols refereing to the same data is currently harmless but it is confusing. This must be done carefully as newer revs of ld do not place symbols that appear in sections without data and instead ld makes those symbols global :( My ultimate goal is to build a relocatable kernel. The safest and least intrusive technique is to generate relocation entries so the kernel can be relocated at load time. The only penalty would be an increase in the size of the kernel binary. The problem is that if absolute and relocatable symbols are not properly specified absolute symbols will be relocated or section relative symbols won't be, which is fatal. The practical motivation is that when generating kernels that will run from a reserved area for analyzing what caused a kernel panic, it is simpler if you don't need to hard code the physical memory location they will run at, especially for the distributions. [AK: and merged:] o Also put a message so that in future people can be aware of it and avoid introducing absolute symbols. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'include/asm-generic/vmlinux.lds.h')
-rw-r--r--include/asm-generic/vmlinux.lds.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index e60d6f21fa62..9f4747780dac 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -11,8 +11,8 @@
11 11
12#define RODATA \ 12#define RODATA \
13 . = ALIGN(4096); \ 13 . = ALIGN(4096); \
14 __start_rodata = .; \
15 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ 14 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
15 VMLINUX_SYMBOL(__start_rodata) = .; \
16 *(.rodata) *(.rodata.*) \ 16 *(.rodata) *(.rodata.*) \
17 *(__vermagic) /* Kernel version magic */ \ 17 *(__vermagic) /* Kernel version magic */ \
18 } \ 18 } \
@@ -119,17 +119,17 @@
119 *(__ksymtab_strings) \ 119 *(__ksymtab_strings) \
120 } \ 120 } \
121 \ 121 \
122 /* Unwind data binary search table */ \
123 EH_FRAME_HDR \
124 \
122 /* Built-in module parameters. */ \ 125 /* Built-in module parameters. */ \
123 __param : AT(ADDR(__param) - LOAD_OFFSET) { \ 126 __param : AT(ADDR(__param) - LOAD_OFFSET) { \
124 VMLINUX_SYMBOL(__start___param) = .; \ 127 VMLINUX_SYMBOL(__start___param) = .; \
125 *(__param) \ 128 *(__param) \
126 VMLINUX_SYMBOL(__stop___param) = .; \ 129 VMLINUX_SYMBOL(__stop___param) = .; \
130 VMLINUX_SYMBOL(__end_rodata) = .; \
127 } \ 131 } \
128 \ 132 \
129 /* Unwind data binary search table */ \
130 EH_FRAME_HDR \
131 \
132 __end_rodata = .; \
133 . = ALIGN(4096); 133 . = ALIGN(4096);
134 134
135#define SECURITY_INIT \ 135#define SECURITY_INIT \