···1010#include <linux/vmalloc.h>1111#include <linux/fs.h>1212#include <linux/string.h>1313+#include <linux/ctype.h>13141415void *module_alloc(unsigned long size)1516{···3837}39384039/* Make generic code ignore STT_REGISTER dummy undefined symbols,4141- * and replace references to .func with func as in ppc64's dedotify.4040+ * and replace references to .func with _Func4241 */4342int module_frob_arch_sections(Elf_Ehdr *hdr,4443 Elf_Shdr *sechdrs,···6564 sym[i].st_shndx = SHN_ABS;6665 else {6766 char *name = strtab + sym[i].st_name;6868- if (name[0] == '.')6969- memmove(name, name+1, strlen(name));6767+ if (name[0] == '.') {6868+ name[0] = '_';6969+ name[1] = toupper(name[1]);7070+ }7071 }7172 }7273 }
+12-19
arch/sparc/kernel/sparc_ksyms.c
···9797/* Alias functions whose names begin with "." and export the aliases.9898 * The module references will be fixed up by module_frob_arch_sections.9999 */100100-#define DOT_ALIAS2(__ret, __x, __arg1, __arg2) \101101- extern __ret __x(__arg1, __arg2); \102102- asm(".weak " #__x);\103103- asm(#__x "=." #__x);104104-105105-DOT_ALIAS2(int, div, int, int)106106-DOT_ALIAS2(int, mul, int, int)107107-DOT_ALIAS2(int, rem, int, int)108108-DOT_ALIAS2(unsigned, udiv, unsigned, unsigned)109109-DOT_ALIAS2(unsigned, umul, unsigned, unsigned)110110-DOT_ALIAS2(unsigned, urem, unsigned, unsigned)111111-112112-#undef DOT_ALIAS2100100+extern int _Div(int, int);101101+extern int _Mul(int, int);102102+extern int _Rem(int, int);103103+extern unsigned _Udiv(unsigned, unsigned);104104+extern unsigned _Umul(unsigned, unsigned);105105+extern unsigned _Urem(unsigned, unsigned);113106114107/* used by various drivers */115108EXPORT_SYMBOL(sparc_cpu_model);···313320EXPORT_SYMBOL(__muldi3);314321EXPORT_SYMBOL(__divdi3);315322316316-EXPORT_SYMBOL(rem);317317-EXPORT_SYMBOL(urem);318318-EXPORT_SYMBOL(mul);319319-EXPORT_SYMBOL(umul);320320-EXPORT_SYMBOL(div);321321-EXPORT_SYMBOL(udiv);323323+EXPORT_SYMBOL(_Rem);324324+EXPORT_SYMBOL(_Urem);325325+EXPORT_SYMBOL(_Mul);326326+EXPORT_SYMBOL(_Umul);327327+EXPORT_SYMBOL(_Div);328328+EXPORT_SYMBOL(_Udiv);322329323330#ifdef CONFIG_DEBUG_BUGVERBOSE324331EXPORT_SYMBOL(do_BUG);
+2
arch/sparc/lib/mul.S
···1616 */17171818 .globl .mul1919+ .globl _Mul1920.mul:2121+_Mul: /* needed for export */2022 mov %o0, %y ! multiplier -> Y2123 andncc %o0, 0xfff, %g0 ! test bits 12..312224 be Lmul_shortway ! if zero, can do it the short way
+2
arch/sparc/lib/rem.S
···434344444545 .globl .rem4646+ .globl _Rem4647.rem:4848+_Rem: /* needed for export */4749 ! compute sign of result; if neither is negative, no problem4850 orcc %o1, %o0, %g0 ! either negative?4951 bge 2f ! no, go do the divide
+2
arch/sparc/lib/sdiv.S
···434344444545 .globl .div4646+ .globl _Div4647.div:4848+_Div: /* needed for export */4749 ! compute sign of result; if neither is negative, no problem4850 orcc %o1, %o0, %g0 ! either negative?4951 bge 2f ! no, go do the divide
+2
arch/sparc/lib/udiv.S
···434344444545 .globl .udiv4646+ .globl _Udiv4647.udiv:4848+_Udiv: /* needed for export */47494850 ! Ready to divide. Compute size of quotient; scale comparand.4951 orcc %o1, %g0, %o5