aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMagnus Damm <magnus@valinux.co.jp>2006-12-06 23:37:53 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:38 -0500
commit386d9a7edd9f3492c99124b0a659e9ed7abb30f9 (patch)
tree6b7f05e1b023f12b113845c23af9a3ba263fef99
parent651971cb7242e8f6d7ebd153e69bd271cb731223 (diff)
[PATCH] elf: Always define elf_addr_t in linux/elf.h
Define elf_addr_t in linux/elf.h. The size of the type is determined using ELF_CLASS. This allows us to remove the defines that today are spread all over .c and .h files. Signed-off-by: Magnus Damm <magnus@valinux.co.jp> Cc: Daniel Jacobowitz <drow@false.org> Cc: Roland McGrath <roland@redhat.com> Cc: Jakub Jelinek <jakub@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/ia64/ia32/ia32priv.h2
-rw-r--r--arch/mips/kernel/binfmt_elfn32.c1
-rw-r--r--arch/mips/kernel/binfmt_elfo32.c1
-rw-r--r--arch/mips/kernel/irixelf.c4
-rw-r--r--arch/parisc/kernel/binfmt_elf32.c1
-rw-r--r--arch/s390/kernel/binfmt_elf32.c1
-rw-r--r--arch/sparc64/kernel/binfmt_elf32.c1
-rw-r--r--arch/x86_64/ia32/ia32_binfmt.c2
-rw-r--r--fs/binfmt_elf.c4
-rw-r--r--fs/binfmt_elf_fdpic.c3
-rw-r--r--include/asm-powerpc/elf.h2
-rw-r--r--include/linux/elf.h2
12 files changed, 2 insertions, 22 deletions
diff --git a/arch/ia64/ia32/ia32priv.h b/arch/ia64/ia32/ia32priv.h
index 703a67c934f8..cfa0bc0026b5 100644
--- a/arch/ia64/ia32/ia32priv.h
+++ b/arch/ia64/ia32/ia32priv.h
@@ -330,8 +330,6 @@ struct old_linux32_dirent {
330void ia64_elf32_init(struct pt_regs *regs); 330void ia64_elf32_init(struct pt_regs *regs);
331#define ELF_PLAT_INIT(_r, load_addr) ia64_elf32_init(_r) 331#define ELF_PLAT_INIT(_r, load_addr) ia64_elf32_init(_r)
332 332
333#define elf_addr_t u32
334
335/* This macro yields a bitmask that programs can use to figure out 333/* This macro yields a bitmask that programs can use to figure out
336 what instruction set this CPU supports. */ 334 what instruction set this CPU supports. */
337#define ELF_HWCAP 0 335#define ELF_HWCAP 0
diff --git a/arch/mips/kernel/binfmt_elfn32.c b/arch/mips/kernel/binfmt_elfn32.c
index 4a9f1ecefaf2..9b34238d41c0 100644
--- a/arch/mips/kernel/binfmt_elfn32.c
+++ b/arch/mips/kernel/binfmt_elfn32.c
@@ -90,7 +90,6 @@ struct elf_prpsinfo32
90 char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */ 90 char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
91}; 91};
92 92
93#define elf_addr_t u32
94#define elf_caddr_t u32 93#define elf_caddr_t u32
95#define init_elf_binfmt init_elfn32_binfmt 94#define init_elf_binfmt init_elfn32_binfmt
96 95
diff --git a/arch/mips/kernel/binfmt_elfo32.c b/arch/mips/kernel/binfmt_elfo32.c
index e31813779895..993f7ec70f35 100644
--- a/arch/mips/kernel/binfmt_elfo32.c
+++ b/arch/mips/kernel/binfmt_elfo32.c
@@ -92,7 +92,6 @@ struct elf_prpsinfo32
92 char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */ 92 char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
93}; 93};
94 94
95#define elf_addr_t u32
96#define elf_caddr_t u32 95#define elf_caddr_t u32
97#define init_elf_binfmt init_elf32_binfmt 96#define init_elf_binfmt init_elf32_binfmt
98 97
diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c
index ab12c8f01518..a82fae221ce4 100644
--- a/arch/mips/kernel/irixelf.c
+++ b/arch/mips/kernel/irixelf.c
@@ -52,10 +52,6 @@ static struct linux_binfmt irix_format = {
52 irix_core_dump, PAGE_SIZE 52 irix_core_dump, PAGE_SIZE
53}; 53};
54 54
55#ifndef elf_addr_t
56#define elf_addr_t unsigned long
57#endif
58
59#ifdef DEBUG 55#ifdef DEBUG
60/* Debugging routines. */ 56/* Debugging routines. */
61static char *get_elf_p_type(Elf32_Word p_type) 57static char *get_elf_p_type(Elf32_Word p_type)
diff --git a/arch/parisc/kernel/binfmt_elf32.c b/arch/parisc/kernel/binfmt_elf32.c
index 1e64e7b88110..ecb10a4f63c6 100644
--- a/arch/parisc/kernel/binfmt_elf32.c
+++ b/arch/parisc/kernel/binfmt_elf32.c
@@ -75,7 +75,6 @@ struct elf_prpsinfo32
75 char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */ 75 char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
76}; 76};
77 77
78#define elf_addr_t unsigned int
79#define init_elf_binfmt init_elf32_binfmt 78#define init_elf_binfmt init_elf32_binfmt
80 79
81#define ELF_PLATFORM ("PARISC32\0") 80#define ELF_PLATFORM ("PARISC32\0")
diff --git a/arch/s390/kernel/binfmt_elf32.c b/arch/s390/kernel/binfmt_elf32.c
index 9565a2dcfadc..5c46054195cb 100644
--- a/arch/s390/kernel/binfmt_elf32.c
+++ b/arch/s390/kernel/binfmt_elf32.c
@@ -176,7 +176,6 @@ struct elf_prpsinfo32
176 176
177#include <linux/highuid.h> 177#include <linux/highuid.h>
178 178
179#define elf_addr_t u32
180/* 179/*
181#define init_elf_binfmt init_elf32_binfmt 180#define init_elf_binfmt init_elf32_binfmt
182*/ 181*/
diff --git a/arch/sparc64/kernel/binfmt_elf32.c b/arch/sparc64/kernel/binfmt_elf32.c
index a98f3ae175a3..9ad84ff10a17 100644
--- a/arch/sparc64/kernel/binfmt_elf32.c
+++ b/arch/sparc64/kernel/binfmt_elf32.c
@@ -141,7 +141,6 @@ cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value)
141 value->tv_sec = jiffies / HZ; 141 value->tv_sec = jiffies / HZ;
142} 142}
143 143
144#define elf_addr_t u32
145#undef start_thread 144#undef start_thread
146#define start_thread start_thread32 145#define start_thread start_thread32
147#define init_elf_binfmt init_elf32_binfmt 146#define init_elf_binfmt init_elf32_binfmt
diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c
index 932a62ad6c83..543ef4f405e9 100644
--- a/arch/x86_64/ia32/ia32_binfmt.c
+++ b/arch/x86_64/ia32/ia32_binfmt.c
@@ -305,8 +305,6 @@ MODULE_AUTHOR("Eric Youngdale, Andi Kleen");
305#undef MODULE_DESCRIPTION 305#undef MODULE_DESCRIPTION
306#undef MODULE_AUTHOR 306#undef MODULE_AUTHOR
307 307
308#define elf_addr_t __u32
309
310static void elf32_init(struct pt_regs *); 308static void elf32_init(struct pt_regs *);
311 309
312#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 310#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 68e20d5bfe1b..14ea630a857c 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -47,10 +47,6 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs);
47static int load_elf_library(struct file *); 47static int load_elf_library(struct file *);
48static unsigned long elf_map (struct file *, unsigned long, struct elf_phdr *, int, int); 48static unsigned long elf_map (struct file *, unsigned long, struct elf_phdr *, int, int);
49 49
50#ifndef elf_addr_t
51#define elf_addr_t unsigned long
52#endif
53
54/* 50/*
55 * If we don't support core dumping, then supply a NULL so we 51 * If we don't support core dumping, then supply a NULL so we
56 * don't even try. 52 * don't even try.
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index f86d5c9ce5eb..ed9a61c6beb3 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -40,9 +40,6 @@
40#include <asm/pgalloc.h> 40#include <asm/pgalloc.h>
41 41
42typedef char *elf_caddr_t; 42typedef char *elf_caddr_t;
43#ifndef elf_addr_t
44#define elf_addr_t unsigned long
45#endif
46 43
47#if 0 44#if 0
48#define kdebug(fmt, ...) printk("FDPIC "fmt"\n" ,##__VA_ARGS__ ) 45#define kdebug(fmt, ...) printk("FDPIC "fmt"\n" ,##__VA_ARGS__ )
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h
index b5436642a109..d36426c01b6b 100644
--- a/include/asm-powerpc/elf.h
+++ b/include/asm-powerpc/elf.h
@@ -124,12 +124,10 @@ typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG];
124# define ELF_DATA ELFDATA2MSB 124# define ELF_DATA ELFDATA2MSB
125 typedef elf_greg_t64 elf_greg_t; 125 typedef elf_greg_t64 elf_greg_t;
126 typedef elf_gregset_t64 elf_gregset_t; 126 typedef elf_gregset_t64 elf_gregset_t;
127# define elf_addr_t unsigned long
128#else 127#else
129 /* Assumption: ELF_ARCH == EM_PPC and ELF_CLASS == ELFCLASS32 */ 128 /* Assumption: ELF_ARCH == EM_PPC and ELF_CLASS == ELFCLASS32 */
130 typedef elf_greg_t32 elf_greg_t; 129 typedef elf_greg_t32 elf_greg_t;
131 typedef elf_gregset_t32 elf_gregset_t; 130 typedef elf_gregset_t32 elf_gregset_t;
132# define elf_addr_t __u32
133#endif /* ELF_ARCH */ 131#endif /* ELF_ARCH */
134 132
135/* Floating point registers */ 133/* Floating point registers */
diff --git a/include/linux/elf.h b/include/linux/elf.h
index 743d5c8e6d36..b403516d5c3d 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -358,6 +358,7 @@ extern Elf32_Dyn _DYNAMIC [];
358#define elfhdr elf32_hdr 358#define elfhdr elf32_hdr
359#define elf_phdr elf32_phdr 359#define elf_phdr elf32_phdr
360#define elf_note elf32_note 360#define elf_note elf32_note
361#define elf_addr_t Elf32_Off
361 362
362#else 363#else
363 364
@@ -365,6 +366,7 @@ extern Elf64_Dyn _DYNAMIC [];
365#define elfhdr elf64_hdr 366#define elfhdr elf64_hdr
366#define elf_phdr elf64_phdr 367#define elf_phdr elf64_phdr
367#define elf_note elf64_note 368#define elf_note elf64_note
369#define elf_addr_t Elf64_Off
368 370
369#endif 371#endif
370 372