aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorOskar Schirmer <os@emlix.com>2009-05-28 17:34:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-05-29 11:40:02 -0400
commitc3dc5bec05a2ae03a72ef82e321d77fb549d951c (patch)
treefc3fa0f7a854dce91d0816cb757244bb62f57bf6 /arch
parentba9447198bdd945666a9bac5e556632a7acb235d (diff)
flat: fix data sections alignment
The flat loader uses an architecture's flat_stack_align() to align the stack but assumes word-alignment is enough for the data sections. However, on the Xtensa S6000 we have registers up to 128bit width which can be used from userspace and therefor need userspace stack and data-section alignment of at least this size. This patch drops flat_stack_align() and uses the same alignment that is required for slab caches, ARCH_SLAB_MINALIGN, or wordsize if it's not defined by the architecture. It also fixes m32r which was obviously kaput, aligning an uninitialized stack entry instead of the stack pointer. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Oskar Schirmer <os@emlix.com> Cc: David Howells <dhowells@redhat.com> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Bryan Wu <cooloney@kernel.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Paul Mundt <lethal@linux-sh.org> Cc: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Johannes Weiner <jw@emlix.com> Acked-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/include/asm/flat.h3
-rw-r--r--arch/blackfin/include/asm/flat.h1
-rw-r--r--arch/h8300/include/asm/flat.h1
-rw-r--r--arch/m32r/include/asm/flat.h1
-rw-r--r--arch/m68k/include/asm/flat.h1
-rw-r--r--arch/sh/include/asm/flat.h1
6 files changed, 0 insertions, 8 deletions
diff --git a/arch/arm/include/asm/flat.h b/arch/arm/include/asm/flat.h
index 1d77e51907f6..59426a4595c9 100644
--- a/arch/arm/include/asm/flat.h
+++ b/arch/arm/include/asm/flat.h
@@ -5,9 +5,6 @@
5#ifndef __ARM_FLAT_H__ 5#ifndef __ARM_FLAT_H__
6#define __ARM_FLAT_H__ 6#define __ARM_FLAT_H__
7 7
8/* An odd number of words will be pushed after this alignment, so
9 deliberately misalign the value. */
10#define flat_stack_align(sp) sp = (void *)(((unsigned long)(sp) - 4) | 4)
11#define flat_argvp_envp_on_stack() 1 8#define flat_argvp_envp_on_stack() 1
12#define flat_old_ram_flag(flags) (flags) 9#define flat_old_ram_flag(flags) (flags)
13#define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 10#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
diff --git a/arch/blackfin/include/asm/flat.h b/arch/blackfin/include/asm/flat.h
index e70074e05f4e..733a178d782d 100644
--- a/arch/blackfin/include/asm/flat.h
+++ b/arch/blackfin/include/asm/flat.h
@@ -10,7 +10,6 @@
10 10
11#include <asm/unaligned.h> 11#include <asm/unaligned.h>
12 12
13#define flat_stack_align(sp) /* nothing needed */
14#define flat_argvp_envp_on_stack() 0 13#define flat_argvp_envp_on_stack() 0
15#define flat_old_ram_flag(flags) (flags) 14#define flat_old_ram_flag(flags) (flags)
16 15
diff --git a/arch/h8300/include/asm/flat.h b/arch/h8300/include/asm/flat.h
index 2a873508a9a1..bd12b31b90e6 100644
--- a/arch/h8300/include/asm/flat.h
+++ b/arch/h8300/include/asm/flat.h
@@ -5,7 +5,6 @@
5#ifndef __H8300_FLAT_H__ 5#ifndef __H8300_FLAT_H__
6#define __H8300_FLAT_H__ 6#define __H8300_FLAT_H__
7 7
8#define flat_stack_align(sp) /* nothing needed */
9#define flat_argvp_envp_on_stack() 1 8#define flat_argvp_envp_on_stack() 1
10#define flat_old_ram_flag(flags) 1 9#define flat_old_ram_flag(flags) 1
11#define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 10#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
diff --git a/arch/m32r/include/asm/flat.h b/arch/m32r/include/asm/flat.h
index d851cf0c4aa5..5d711c4688fb 100644
--- a/arch/m32r/include/asm/flat.h
+++ b/arch/m32r/include/asm/flat.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_M32R_FLAT_H 12#ifndef __ASM_M32R_FLAT_H
13#define __ASM_M32R_FLAT_H 13#define __ASM_M32R_FLAT_H
14 14
15#define flat_stack_align(sp) (*sp += (*sp & 3 ? (4 - (*sp & 3)): 0))
16#define flat_argvp_envp_on_stack() 0 15#define flat_argvp_envp_on_stack() 0
17#define flat_old_ram_flag(flags) (flags) 16#define flat_old_ram_flag(flags) (flags)
18#define flat_set_persistent(relval, p) 0 17#define flat_set_persistent(relval, p) 0
diff --git a/arch/m68k/include/asm/flat.h b/arch/m68k/include/asm/flat.h
index 814b5174a8e0..a0e290793978 100644
--- a/arch/m68k/include/asm/flat.h
+++ b/arch/m68k/include/asm/flat.h
@@ -5,7 +5,6 @@
5#ifndef __M68KNOMMU_FLAT_H__ 5#ifndef __M68KNOMMU_FLAT_H__
6#define __M68KNOMMU_FLAT_H__ 6#define __M68KNOMMU_FLAT_H__
7 7
8#define flat_stack_align(sp) /* nothing needed */
9#define flat_argvp_envp_on_stack() 1 8#define flat_argvp_envp_on_stack() 1
10#define flat_old_ram_flag(flags) (flags) 9#define flat_old_ram_flag(flags) (flags)
11#define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 10#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
diff --git a/arch/sh/include/asm/flat.h b/arch/sh/include/asm/flat.h
index d3b2b4f109e3..5d84df5e27f6 100644
--- a/arch/sh/include/asm/flat.h
+++ b/arch/sh/include/asm/flat.h
@@ -12,7 +12,6 @@
12#ifndef __ASM_SH_FLAT_H 12#ifndef __ASM_SH_FLAT_H
13#define __ASM_SH_FLAT_H 13#define __ASM_SH_FLAT_H
14 14
15#define flat_stack_align(sp) /* nothing needed */
16#define flat_argvp_envp_on_stack() 0 15#define flat_argvp_envp_on_stack() 0
17#define flat_old_ram_flag(flags) (flags) 16#define flat_old_ram_flag(flags) (flags)
18#define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 17#define flat_reloc_valid(reloc, size) ((reloc) <= (size))