Commit 386d9a7e authored by Magnus Damm's avatar Magnus Damm Committed by Linus Torvalds

[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: default avatarMagnus 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: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 651971cb
...@@ -330,8 +330,6 @@ struct old_linux32_dirent { ...@@ -330,8 +330,6 @@ struct old_linux32_dirent {
void ia64_elf32_init(struct pt_regs *regs); void ia64_elf32_init(struct pt_regs *regs);
#define ELF_PLAT_INIT(_r, load_addr) ia64_elf32_init(_r) #define ELF_PLAT_INIT(_r, load_addr) ia64_elf32_init(_r)
#define elf_addr_t u32
/* This macro yields a bitmask that programs can use to figure out /* This macro yields a bitmask that programs can use to figure out
what instruction set this CPU supports. */ what instruction set this CPU supports. */
#define ELF_HWCAP 0 #define ELF_HWCAP 0
......
...@@ -90,7 +90,6 @@ struct elf_prpsinfo32 ...@@ -90,7 +90,6 @@ struct elf_prpsinfo32
char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */ char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
}; };
#define elf_addr_t u32
#define elf_caddr_t u32 #define elf_caddr_t u32
#define init_elf_binfmt init_elfn32_binfmt #define init_elf_binfmt init_elfn32_binfmt
......
...@@ -92,7 +92,6 @@ struct elf_prpsinfo32 ...@@ -92,7 +92,6 @@ struct elf_prpsinfo32
char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */ char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
}; };
#define elf_addr_t u32
#define elf_caddr_t u32 #define elf_caddr_t u32
#define init_elf_binfmt init_elf32_binfmt #define init_elf_binfmt init_elf32_binfmt
......
...@@ -52,10 +52,6 @@ static struct linux_binfmt irix_format = { ...@@ -52,10 +52,6 @@ static struct linux_binfmt irix_format = {
irix_core_dump, PAGE_SIZE irix_core_dump, PAGE_SIZE
}; };
#ifndef elf_addr_t
#define elf_addr_t unsigned long
#endif
#ifdef DEBUG #ifdef DEBUG
/* Debugging routines. */ /* Debugging routines. */
static char *get_elf_p_type(Elf32_Word p_type) static char *get_elf_p_type(Elf32_Word p_type)
......
...@@ -75,7 +75,6 @@ struct elf_prpsinfo32 ...@@ -75,7 +75,6 @@ struct elf_prpsinfo32
char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */ char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
}; };
#define elf_addr_t unsigned int
#define init_elf_binfmt init_elf32_binfmt #define init_elf_binfmt init_elf32_binfmt
#define ELF_PLATFORM ("PARISC32\0") #define ELF_PLATFORM ("PARISC32\0")
......
...@@ -176,7 +176,6 @@ struct elf_prpsinfo32 ...@@ -176,7 +176,6 @@ struct elf_prpsinfo32
#include <linux/highuid.h> #include <linux/highuid.h>
#define elf_addr_t u32
/* /*
#define init_elf_binfmt init_elf32_binfmt #define init_elf_binfmt init_elf32_binfmt
*/ */
......
...@@ -141,7 +141,6 @@ cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value) ...@@ -141,7 +141,6 @@ cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value)
value->tv_sec = jiffies / HZ; value->tv_sec = jiffies / HZ;
} }
#define elf_addr_t u32
#undef start_thread #undef start_thread
#define start_thread start_thread32 #define start_thread start_thread32
#define init_elf_binfmt init_elf32_binfmt #define init_elf_binfmt init_elf32_binfmt
......
...@@ -305,8 +305,6 @@ MODULE_AUTHOR("Eric Youngdale, Andi Kleen"); ...@@ -305,8 +305,6 @@ MODULE_AUTHOR("Eric Youngdale, Andi Kleen");
#undef MODULE_DESCRIPTION #undef MODULE_DESCRIPTION
#undef MODULE_AUTHOR #undef MODULE_AUTHOR
#define elf_addr_t __u32
static void elf32_init(struct pt_regs *); static void elf32_init(struct pt_regs *);
#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
......
...@@ -47,10 +47,6 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs); ...@@ -47,10 +47,6 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs);
static int load_elf_library(struct file *); static int load_elf_library(struct file *);
static unsigned long elf_map (struct file *, unsigned long, struct elf_phdr *, int, int); static unsigned long elf_map (struct file *, unsigned long, struct elf_phdr *, int, int);
#ifndef elf_addr_t
#define elf_addr_t unsigned long
#endif
/* /*
* If we don't support core dumping, then supply a NULL so we * If we don't support core dumping, then supply a NULL so we
* don't even try. * don't even try.
......
...@@ -40,9 +40,6 @@ ...@@ -40,9 +40,6 @@
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
typedef char *elf_caddr_t; typedef char *elf_caddr_t;
#ifndef elf_addr_t
#define elf_addr_t unsigned long
#endif
#if 0 #if 0
#define kdebug(fmt, ...) printk("FDPIC "fmt"\n" ,##__VA_ARGS__ ) #define kdebug(fmt, ...) printk("FDPIC "fmt"\n" ,##__VA_ARGS__ )
......
...@@ -124,12 +124,10 @@ typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG]; ...@@ -124,12 +124,10 @@ typedef elf_greg_t32 elf_gregset_t32[ELF_NGREG];
# define ELF_DATA ELFDATA2MSB # define ELF_DATA ELFDATA2MSB
typedef elf_greg_t64 elf_greg_t; typedef elf_greg_t64 elf_greg_t;
typedef elf_gregset_t64 elf_gregset_t; typedef elf_gregset_t64 elf_gregset_t;
# define elf_addr_t unsigned long
#else #else
/* Assumption: ELF_ARCH == EM_PPC and ELF_CLASS == ELFCLASS32 */ /* Assumption: ELF_ARCH == EM_PPC and ELF_CLASS == ELFCLASS32 */
typedef elf_greg_t32 elf_greg_t; typedef elf_greg_t32 elf_greg_t;
typedef elf_gregset_t32 elf_gregset_t; typedef elf_gregset_t32 elf_gregset_t;
# define elf_addr_t __u32
#endif /* ELF_ARCH */ #endif /* ELF_ARCH */
/* Floating point registers */ /* Floating point registers */
......
...@@ -358,6 +358,7 @@ extern Elf32_Dyn _DYNAMIC []; ...@@ -358,6 +358,7 @@ extern Elf32_Dyn _DYNAMIC [];
#define elfhdr elf32_hdr #define elfhdr elf32_hdr
#define elf_phdr elf32_phdr #define elf_phdr elf32_phdr
#define elf_note elf32_note #define elf_note elf32_note
#define elf_addr_t Elf32_Off
#else #else
...@@ -365,6 +366,7 @@ extern Elf64_Dyn _DYNAMIC []; ...@@ -365,6 +366,7 @@ extern Elf64_Dyn _DYNAMIC [];
#define elfhdr elf64_hdr #define elfhdr elf64_hdr
#define elf_phdr elf64_phdr #define elf_phdr elf64_phdr
#define elf_note elf64_note #define elf_note elf64_note
#define elf_addr_t Elf64_Off
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment