Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

alpha: fix modversions for strcpy() et.al.

On alpha str{n,}{cpy,cat}() implementations are playing
fun games with shared chunks of code. The problem is, they are
using direct branches and need to be next to each other.
Currently it's done by building them in separate object
files, then using ld -r to link those together. Unfortunately,
genksyms machinery has no idea what to do with that - we have
generated in arch/alpha/lib/.strcat.S.cmd, but there's nothing
to propagate that into .stycpy.S.cmd, so modpost doesn't find
anything for those symbols, resulting in
WARNING: modpost: EXPORT symbol "strcpy" [vmlinux] version generation failed, symbol will not be versioned.
Is "strcpy" prototyped in <asm/asm-prototypes.h>?
WARNING: modpost: EXPORT symbol "strcat" [vmlinux] version generation failed, symbol will not be versioned.
Is "strcat" prototyped in <asm/asm-prototypes.h>?
WARNING: modpost: EXPORT symbol "strncpy" [vmlinux] version generation failed, symbol will not be versioned.
Is "strncpy" prototyped in <asm/asm-prototypes.h>?
WARNING: modpost: EXPORT symbol "strncat" [vmlinux] version generation failed, symbol will not be versioned.
Is "strncat" prototyped in <asm/asm-prototypes.h>?
spew on modversion-enabled builds (all 4 functions in question
are in fact prototyped in asm-prototypes.h)

Fixing doesn't require messing with kbuild, thankfully -
just build one object (i.e. have sty{n,}cpy.S with includes of relevant
*.S instead of playing with ld -r) and that's it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Acked-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Al Viro and committed by
Arnd Bergmann
397c66c2 5d753151

+22 -14
-14
arch/alpha/lib/Makefile
··· 44 44 $(addprefix $(obj)/,__divqu.o __remqu.o __divlu.o __remlu.o): \ 45 45 $(src)/$(ev6-y)divide.S FORCE 46 46 $(call if_changed_rule,as_o_S) 47 - 48 - # There are direct branches between {str*cpy,str*cat} and stx*cpy. 49 - # Ensure the branches are within range by merging these objects. 50 - 51 - LDFLAGS_stycpy.o := -r 52 - LDFLAGS_styncpy.o := -r 53 - 54 - $(obj)/stycpy.o: $(obj)/strcpy.o $(obj)/$(ev67-y)strcat.o \ 55 - $(obj)/$(ev6-y)stxcpy.o FORCE 56 - $(call if_changed,ld) 57 - 58 - $(obj)/styncpy.o: $(obj)/strncpy.o $(obj)/$(ev67-y)strncat.o \ 59 - $(obj)/$(ev6-y)stxncpy.o FORCE 60 - $(call if_changed,ld)
+11
arch/alpha/lib/stycpy.S
··· 1 + #include "strcpy.S" 2 + #ifdef CONFIG_ALPHA_EV67 3 + #include "ev67-strcat.S" 4 + #else 5 + #include "strcat.S" 6 + #endif 7 + #ifdef CONFIG_ALPHA_EV6 8 + #include "ev6-stxcpy.S" 9 + #else 10 + #include "stxcpy.S" 11 + #endif
+11
arch/alpha/lib/styncpy.S
··· 1 + #include "strncpy.S" 2 + #ifdef CONFIG_ALPHA_EV67 3 + #include "ev67-strncat.S" 4 + #else 5 + #include "strncat.S" 6 + #endif 7 + #ifdef CONFIG_ALPHA_EV6 8 + #include "ev6-stxncpy.S" 9 + #else 10 + #include "stxncpy.S" 11 + #endif