aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/kernel/module.c')
-rw-r--r--arch/parisc/kernel/module.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c
index f50b982b0834..fdacdd4341c9 100644
--- a/arch/parisc/kernel/module.c
+++ b/arch/parisc/kernel/module.c
@@ -46,6 +46,7 @@
46#include <linux/fs.h> 46#include <linux/fs.h>
47#include <linux/string.h> 47#include <linux/string.h>
48#include <linux/kernel.h> 48#include <linux/kernel.h>
49#include <linux/bug.h>
49 50
50#include <asm/unwind.h> 51#include <asm/unwind.h>
51 52
@@ -96,7 +97,7 @@ static inline int in_local_section(struct module *me, void *loc, void *dot)
96} 97}
97 98
98 99
99#ifndef __LP64__ 100#ifndef CONFIG_64BIT
100struct got_entry { 101struct got_entry {
101 Elf32_Addr addr; 102 Elf32_Addr addr;
102}; 103};
@@ -176,7 +177,7 @@ void *module_alloc(unsigned long size)
176 return vmalloc(size); 177 return vmalloc(size);
177} 178}
178 179
179#ifndef __LP64__ 180#ifndef CONFIG_64BIT
180static inline unsigned long count_gots(const Elf_Rela *rela, unsigned long n) 181static inline unsigned long count_gots(const Elf_Rela *rela, unsigned long n)
181{ 182{
182 return 0; 183 return 0;
@@ -319,7 +320,7 @@ int module_frob_arch_sections(CONST Elf_Ehdr *hdr,
319 return 0; 320 return 0;
320} 321}
321 322
322#ifdef __LP64__ 323#ifdef CONFIG_64BIT
323static Elf64_Word get_got(struct module *me, unsigned long value, long addend) 324static Elf64_Word get_got(struct module *me, unsigned long value, long addend)
324{ 325{
325 unsigned int i; 326 unsigned int i;
@@ -342,9 +343,9 @@ static Elf64_Word get_got(struct module *me, unsigned long value, long addend)
342 value); 343 value);
343 return i * sizeof(struct got_entry); 344 return i * sizeof(struct got_entry);
344} 345}
345#endif /* __LP64__ */ 346#endif /* CONFIG_64BIT */
346 347
347#ifdef __LP64__ 348#ifdef CONFIG_64BIT
348static Elf_Addr get_fdesc(struct module *me, unsigned long value) 349static Elf_Addr get_fdesc(struct module *me, unsigned long value)
349{ 350{
350 Elf_Fdesc *fdesc = me->module_core + me->arch.fdesc_offset; 351 Elf_Fdesc *fdesc = me->module_core + me->arch.fdesc_offset;
@@ -368,7 +369,7 @@ static Elf_Addr get_fdesc(struct module *me, unsigned long value)
368 fdesc->gp = (Elf_Addr)me->module_core + me->arch.got_offset; 369 fdesc->gp = (Elf_Addr)me->module_core + me->arch.got_offset;
369 return (Elf_Addr)fdesc; 370 return (Elf_Addr)fdesc;
370} 371}
371#endif /* __LP64__ */ 372#endif /* CONFIG_64BIT */
372 373
373enum elf_stub_type { 374enum elf_stub_type {
374 ELF_STUB_GOT, 375 ELF_STUB_GOT,
@@ -394,7 +395,7 @@ static Elf_Addr get_stub(struct module *me, unsigned long value, long addend,
394 i * sizeof(struct stub_entry); 395 i * sizeof(struct stub_entry);
395 } 396 }
396 397
397#ifndef __LP64__ 398#ifndef CONFIG_64BIT
398/* for 32-bit the stub looks like this: 399/* for 32-bit the stub looks like this:
399 * ldil L'XXX,%r1 400 * ldil L'XXX,%r1
400 * be,n R'XXX(%sr4,%r1) 401 * be,n R'XXX(%sr4,%r1)
@@ -472,7 +473,7 @@ int apply_relocate(Elf_Shdr *sechdrs,
472 return -ENOEXEC; 473 return -ENOEXEC;
473} 474}
474 475
475#ifndef __LP64__ 476#ifndef CONFIG_64BIT
476int apply_relocate_add(Elf_Shdr *sechdrs, 477int apply_relocate_add(Elf_Shdr *sechdrs,
477 const char *strtab, 478 const char *strtab,
478 unsigned int symindex, 479 unsigned int symindex,
@@ -822,7 +823,8 @@ int module_finalize(const Elf_Ehdr *hdr,
822 me->name, strtab, symhdr); 823 me->name, strtab, symhdr);
823 824
824 if(me->arch.got_count > MAX_GOTS) { 825 if(me->arch.got_count > MAX_GOTS) {
825 printk(KERN_ERR "%s: Global Offset Table overflow (used %ld, allowed %d\n", me->name, me->arch.got_count, MAX_GOTS); 826 printk(KERN_ERR "%s: Global Offset Table overflow (used %ld, allowed %d)\n",
827 me->name, me->arch.got_count, MAX_GOTS);
826 return -EINVAL; 828 return -EINVAL;
827 } 829 }
828 830
@@ -850,10 +852,11 @@ int module_finalize(const Elf_Ehdr *hdr,
850 nsyms = newptr - (Elf_Sym *)symhdr->sh_addr; 852 nsyms = newptr - (Elf_Sym *)symhdr->sh_addr;
851 DEBUGP("NEW num_symtab %lu\n", nsyms); 853 DEBUGP("NEW num_symtab %lu\n", nsyms);
852 symhdr->sh_size = nsyms * sizeof(Elf_Sym); 854 symhdr->sh_size = nsyms * sizeof(Elf_Sym);
853 return 0; 855 return module_bug_finalize(hdr, sechdrs, me);
854} 856}
855 857
856void module_arch_cleanup(struct module *mod) 858void module_arch_cleanup(struct module *mod)
857{ 859{
858 deregister_unwind_table(mod); 860 deregister_unwind_table(mod);
861 module_bug_cleanup(mod);
859} 862}