diff options
| -rw-r--r-- | arch/ia64/include/asm/elf.h | 15 | ||||
| -rw-r--r-- | arch/ia64/include/asm/sections.h | 13 | ||||
| -rw-r--r-- | arch/ia64/kernel/module.c | 21 |
3 files changed, 27 insertions, 22 deletions
diff --git a/arch/ia64/include/asm/elf.h b/arch/ia64/include/asm/elf.h index 5e0c1a6bce8d..2acb6b6543c9 100644 --- a/arch/ia64/include/asm/elf.h +++ b/arch/ia64/include/asm/elf.h | |||
| @@ -266,4 +266,19 @@ do { \ | |||
| 266 | } \ | 266 | } \ |
| 267 | } while (0) | 267 | } while (0) |
| 268 | 268 | ||
| 269 | /* | ||
| 270 | * format for entries in the Global Offset Table | ||
| 271 | */ | ||
| 272 | struct got_entry { | ||
| 273 | uint64_t val; | ||
| 274 | }; | ||
| 275 | |||
| 276 | /* | ||
| 277 | * Layout of the Function Descriptor | ||
| 278 | */ | ||
| 279 | struct fdesc { | ||
| 280 | uint64_t ip; | ||
| 281 | uint64_t gp; | ||
| 282 | }; | ||
| 283 | |||
| 269 | #endif /* _ASM_IA64_ELF_H */ | 284 | #endif /* _ASM_IA64_ELF_H */ |
diff --git a/arch/ia64/include/asm/sections.h b/arch/ia64/include/asm/sections.h index a7acad2bc2f0..f66799891036 100644 --- a/arch/ia64/include/asm/sections.h +++ b/arch/ia64/include/asm/sections.h | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | * David Mosberger-Tang <davidm@hpl.hp.com> | 6 | * David Mosberger-Tang <davidm@hpl.hp.com> |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/elf.h> | ||
| 10 | #include <linux/uaccess.h> | ||
| 9 | #include <asm-generic/sections.h> | 11 | #include <asm-generic/sections.h> |
| 10 | 12 | ||
| 11 | extern char __per_cpu_start[], __per_cpu_end[], __phys_per_cpu_start[]; | 13 | extern char __per_cpu_start[], __per_cpu_end[], __phys_per_cpu_start[]; |
| @@ -22,7 +24,16 @@ extern char __start_unwind[], __end_unwind[]; | |||
| 22 | extern char __start_ivt_text[], __end_ivt_text[]; | 24 | extern char __start_ivt_text[], __end_ivt_text[]; |
| 23 | 25 | ||
| 24 | #undef dereference_function_descriptor | 26 | #undef dereference_function_descriptor |
| 25 | void *dereference_function_descriptor(void *); | 27 | static inline void *dereference_function_descriptor(void *ptr) |
| 28 | { | ||
| 29 | struct fdesc *desc = ptr; | ||
| 30 | void *p; | ||
| 31 | |||
| 32 | if (!probe_kernel_address(&desc->ip, p)) | ||
| 33 | ptr = p; | ||
| 34 | return ptr; | ||
| 35 | } | ||
| 36 | |||
| 26 | 37 | ||
| 27 | #endif /* _ASM_IA64_SECTIONS_H */ | 38 | #endif /* _ASM_IA64_SECTIONS_H */ |
| 28 | 39 | ||
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c index 545626f66a4c..aaa7d901521f 100644 --- a/arch/ia64/kernel/module.c +++ b/arch/ia64/kernel/module.c | |||
| @@ -31,11 +31,9 @@ | |||
| 31 | #include <linux/elf.h> | 31 | #include <linux/elf.h> |
| 32 | #include <linux/moduleloader.h> | 32 | #include <linux/moduleloader.h> |
| 33 | #include <linux/string.h> | 33 | #include <linux/string.h> |
| 34 | #include <linux/uaccess.h> | ||
| 35 | #include <linux/vmalloc.h> | 34 | #include <linux/vmalloc.h> |
| 36 | 35 | ||
| 37 | #include <asm/patch.h> | 36 | #include <asm/patch.h> |
| 38 | #include <asm/sections.h> | ||
| 39 | #include <asm/unaligned.h> | 37 | #include <asm/unaligned.h> |
| 40 | 38 | ||
| 41 | #define ARCH_MODULE_DEBUG 0 | 39 | #define ARCH_MODULE_DEBUG 0 |
| @@ -137,15 +135,6 @@ static const char *reloc_name[256] = { | |||
| 137 | 135 | ||
| 138 | #undef N | 136 | #undef N |
| 139 | 137 | ||
| 140 | struct got_entry { | ||
| 141 | uint64_t val; | ||
| 142 | }; | ||
| 143 | |||
| 144 | struct fdesc { | ||
| 145 | uint64_t ip; | ||
| 146 | uint64_t gp; | ||
| 147 | }; | ||
| 148 | |||
| 149 | /* Opaque struct for insns, to protect against derefs. */ | 138 | /* Opaque struct for insns, to protect against derefs. */ |
| 150 | struct insn; | 139 | struct insn; |
| 151 | 140 | ||
| @@ -943,13 +932,3 @@ module_arch_cleanup (struct module *mod) | |||
| 943 | if (mod->arch.core_unw_table) | 932 | if (mod->arch.core_unw_table) |
| 944 | unw_remove_unwind_table(mod->arch.core_unw_table); | 933 | unw_remove_unwind_table(mod->arch.core_unw_table); |
| 945 | } | 934 | } |
| 946 | |||
| 947 | void *dereference_function_descriptor(void *ptr) | ||
| 948 | { | ||
| 949 | struct fdesc *desc = ptr; | ||
| 950 | void *p; | ||
| 951 | |||
| 952 | if (!probe_kernel_address(&desc->ip, p)) | ||
| 953 | ptr = p; | ||
| 954 | return ptr; | ||
| 955 | } | ||
