[patch 2/2] x86: lds - Use THREAD_SIZE instead of numeric constant

Cyrill Gorcunov
2008-02-17T15:20:44Z

[-- Attachment #1: x86-thread-size --]
[-- Type: text/plain, Size: 1331 bytes --]

Though we use PDA for regular task stack but that
is not acceptable for init_task wich is special
one. We still have to allocate init_task's stack
in that manner.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---

Ingo, Peter, I can be wrong but take a look please
to x86/lgest/i386_head.S:41

/* Set up the initial stack so we can run C code. */
movl $(init_thread_union+THREAD_SIZE),%esp

if we just eliminate this string from lds scripts - I bet
we get bad situation here. Xen has a similar trick.
And even head_32.S and head_64.S both have

32bits
======
ENTRY(stack_start)
.long init_thread_union+THREAD_SIZE

64bits
======
ENTRY(init_rsp)
.quad init_thread_union+THREAD_SIZE-8

So if we just remove that string from lds file - we will
be screwed up I think ;)

Index: linux-2.6.git/arch/x86/kernel/vmlinux_64.lds.S
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/vmlinux_64.lds.S 2008-02-17 13:56:54.000000000 +0300
+++ linux-2.6.git/arch/x86/kernel/vmlinux_64.lds.S 2008-02-17 14:10:21.000000000 +0300
@@ -129,7 +129,7 @@ SECTIONS
#undef VVIRT_OFFSET
#undef VVIRT

- . = ALIGN(8192); /* init_task */
+ . = ALIGN(THREAD_SIZE); /* init_task */
.data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
*(.data.init_task)
}:data.init

--