diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-09-21 17:31:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-09-21 17:31:50 -0400 |
commit | 6219844e72ecc7a7c9efed8b4e41a6c6064a4967 (patch) | |
tree | 85ed65fe25c5fadac31c260eb843ee3540a1e006 | |
parent | 9d10890792a96ed796a44565924327aa276fa468 (diff) | |
parent | a9e8d1a6b87167116e5779378f1d25ffed2e833b (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Pull sparc updates from David Miller:
1) Debugging builds on 32-bit sparc need to handle the R_SPARC_DISP32
relocation, not just 64-bit sparc. From Andreas Larsson.
2) Wei Yongjun noticed that module_alloc() on sparc can return an
error pointer, but that's not allowed. module_alloc() should
return only a valid pointer, or NULL.
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
sparc: fix the return value of module_alloc()
sparc32: Enable the relocation target R_SPARC_DISP32 for sparc32
-rw-r--r-- | arch/sparc/kernel/module.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c index 15e0a1693976..f1ddc0d23679 100644 --- a/arch/sparc/kernel/module.c +++ b/arch/sparc/kernel/module.c | |||
@@ -48,9 +48,7 @@ void *module_alloc(unsigned long size) | |||
48 | return NULL; | 48 | return NULL; |
49 | 49 | ||
50 | ret = module_map(size); | 50 | ret = module_map(size); |
51 | if (!ret) | 51 | if (ret) |
52 | ret = ERR_PTR(-ENOMEM); | ||
53 | else | ||
54 | memset(ret, 0, size); | 52 | memset(ret, 0, size); |
55 | 53 | ||
56 | return ret; | 54 | return ret; |
@@ -116,6 +114,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs, | |||
116 | v = sym->st_value + rel[i].r_addend; | 114 | v = sym->st_value + rel[i].r_addend; |
117 | 115 | ||
118 | switch (ELF_R_TYPE(rel[i].r_info) & 0xff) { | 116 | switch (ELF_R_TYPE(rel[i].r_info) & 0xff) { |
117 | case R_SPARC_DISP32: | ||
118 | v -= (Elf_Addr) location; | ||
119 | *loc32 = v; | ||
120 | break; | ||
119 | #ifdef CONFIG_SPARC64 | 121 | #ifdef CONFIG_SPARC64 |
120 | case R_SPARC_64: | 122 | case R_SPARC_64: |
121 | location[0] = v >> 56; | 123 | location[0] = v >> 56; |
@@ -128,11 +130,6 @@ int apply_relocate_add(Elf_Shdr *sechdrs, | |||
128 | location[7] = v >> 0; | 130 | location[7] = v >> 0; |
129 | break; | 131 | break; |
130 | 132 | ||
131 | case R_SPARC_DISP32: | ||
132 | v -= (Elf_Addr) location; | ||
133 | *loc32 = v; | ||
134 | break; | ||
135 | |||
136 | case R_SPARC_WDISP19: | 133 | case R_SPARC_WDISP19: |
137 | v -= (Elf_Addr) location; | 134 | v -= (Elf_Addr) location; |
138 | *loc32 = (*loc32 & ~0x7ffff) | | 135 | *loc32 = (*loc32 & ~0x7ffff) | |