Skip to content

Commit 397c66c

Browse files
Al Viroarndb
authored andcommitted
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>
1 parent 5d75315 commit 397c66c

3 files changed

Lines changed: 22 additions & 14 deletions

File tree

arch/alpha/lib/Makefile

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,3 @@ AFLAGS___remlu.o = -DREM -DINTSIZE
4444
$(addprefix $(obj)/,__divqu.o __remqu.o __divlu.o __remlu.o): \
4545
$(src)/$(ev6-y)divide.S FORCE
4646
$(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)

arch/alpha/lib/stycpy.S

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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

arch/alpha/lib/styncpy.S

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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

0 commit comments

Comments
 (0)