diff options
author | David Howells <dhowells@redhat.com> | 2005-01-04 05:15:00 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-01-04 05:15:00 -0800 |
commit | 1fa5e01246a4f0ec32f9bdfc910d57e30bfc0260 (patch) | |
tree | 7e44a66f9c2a8cc6e6449c04af9fc10afabf7cf0 /init | |
parent | fc1d4be6b015e2c34847df3994d80f3eec44cc42 (diff) | |
download | history-1fa5e01246a4f0ec32f9bdfc910d57e30bfc0260.tar.gz |
[PATCH] GP-REL data support
The attached patch makes it possible to support gp-rel addressing for small
variables. Since the FR-V cpu's have fixed-length instructions and plenty of
general-purpose registers, one register is nominated as a base for the small
data area. This makes it possible to use single-insn accesses to access
global and static variables instead of having to use multiple instructions.
This, however, causes problems with small variables used to pinpoint the
beginning and end of sections. The compiler assumes it can use gp-rel
addressing for these, but the linker then complains because the displacement
is out of range.
By declaring certain variables as arrays or by forcing them into named
sections, the compiler is persuaded to access them as if they can be outside
the displacement range. Declaring the variables as "const void" type also
works.
Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'init')
-rw-r--r-- | init/initramfs.c | 6 | ||||
-rw-r--r-- | init/main.c | 16 | ||||
-rw-r--r-- | init/version.c | 2 |
3 files changed, 11 insertions, 13 deletions
diff --git a/init/initramfs.c b/init/initramfs.c index 6e939cca559bb6..722bb17241f230 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -460,15 +460,15 @@ char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only) return message; } -extern char __initramfs_start, __initramfs_end; +extern char __initramfs_start[], __initramfs_end[]; #ifdef CONFIG_BLK_DEV_INITRD #include <linux/initrd.h> #endif void __init populate_rootfs(void) { - char *err = unpack_to_rootfs(&__initramfs_start, - &__initramfs_end - &__initramfs_start, 0); + char *err = unpack_to_rootfs(__initramfs_start, + __initramfs_end - __initramfs_start, 0); if (err) panic(err); #ifdef CONFIG_BLK_DEV_INITRD diff --git a/init/main.c b/init/main.c index ecc39fafe51c21..1c650fd2cd366f 100644 --- a/init/main.c +++ b/init/main.c @@ -75,8 +75,6 @@ #error Sorry, your GCC is too old. It builds incorrect kernels. #endif -extern char *linux_banner; - static int init(void *); extern void init_IRQ(void); @@ -157,12 +155,13 @@ static char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, }; char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, }; static const char *panic_later, *panic_param; +extern struct obs_kernel_param __setup_start[], __setup_end[]; + static int __init obsolete_checksetup(char *line) { struct obs_kernel_param *p; - extern struct obs_kernel_param __setup_start, __setup_end; - p = &__setup_start; + p = __setup_start; do { int n = strlen(p->str); if (!strncmp(line, p->str, n)) { @@ -179,7 +178,7 @@ static int __init obsolete_checksetup(char *line) return 1; } p++; - } while (p < &__setup_end); + } while (p < __setup_end); return 0; } @@ -453,9 +452,8 @@ static void noinline rest_init(void) static int __init do_early_param(char *param, char *val) { struct obs_kernel_param *p; - extern struct obs_kernel_param __setup_start, __setup_end; - for (p = &__setup_start; p < &__setup_end; p++) { + for (p = __setup_start; p < __setup_end; p++) { if (p->early && strcmp(param, p->str) == 0) { if (p->setup_func(val) != 0) printk(KERN_WARNING @@ -592,14 +590,14 @@ __setup("initcall_debug", initcall_debug_setup); struct task_struct *child_reaper = &init_task; -extern initcall_t __initcall_start, __initcall_end; +extern initcall_t __initcall_start[], __initcall_end[]; static void __init do_initcalls(void) { initcall_t *call; int count = preempt_count(); - for (call = &__initcall_start; call < &__initcall_end; call++) { + for (call = __initcall_start; call < __initcall_end; call++) { char *msg; if (initcall_debug) { diff --git a/init/version.c b/init/version.c index d8878ae6cadc34..3ddc3ceec2fe70 100644 --- a/init/version.c +++ b/init/version.c @@ -28,6 +28,6 @@ struct new_utsname system_utsname = { EXPORT_SYMBOL(system_utsname); -const char *linux_banner = +const char linux_banner[] = "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n"; |