aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2023-12-18 22:59:26 -0500
committerArnd Bergmann <arnd@arndb.de>2024-05-03 22:09:09 +0200
commit397c66c2c989ff98a5016c69cb1547676d596fd1 (patch)
tree0f801fe64491ae12f3e14e9b6124cea89a524dff
parent5d7531517427429e31d7bb84c00b0c7bec30e280 (diff)
downloadlinux-397c66c2c989ff98a5016c69cb1547676d596fd1.tar.gz
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>
-rw-r--r--arch/alpha/lib/Makefile14
-rw-r--r--arch/alpha/lib/stycpy.S11
-rw-r--r--arch/alpha/lib/styncpy.S11
3 files changed, 22 insertions, 14 deletions
diff --git a/arch/alpha/lib/Makefile b/arch/alpha/lib/Makefile
index 6a779b9018fd15..84046e730e6de8 100644
--- a/arch/alpha/lib/Makefile
+++ b/arch/alpha/lib/Makefile
@@ -44,17 +44,3 @@ AFLAGS___remlu.o = -DREM -DINTSIZE
$(addprefix $(obj)/,__divqu.o __remqu.o __divlu.o __remlu.o): \
$(src)/$(ev6-y)divide.S FORCE
$(call if_changed_rule,as_o_S)
-
-# There are direct branches between {str*cpy,str*cat} and stx*cpy.
-# Ensure the branches are within range by merging these objects.
-
-LDFLAGS_stycpy.o := -r
-LDFLAGS_styncpy.o := -r
-
-$(obj)/stycpy.o: $(obj)/strcpy.o $(obj)/$(ev67-y)strcat.o \
- $(obj)/$(ev6-y)stxcpy.o FORCE
- $(call if_changed,ld)
-
-$(obj)/styncpy.o: $(obj)/strncpy.o $(obj)/$(ev67-y)strncat.o \
- $(obj)/$(ev6-y)stxncpy.o FORCE
- $(call if_changed,ld)
diff --git a/arch/alpha/lib/stycpy.S b/arch/alpha/lib/stycpy.S
new file mode 100644
index 00000000000000..32ecd9c5f90d70
--- /dev/null
+++ b/arch/alpha/lib/stycpy.S
@@ -0,0 +1,11 @@
+#include "strcpy.S"
+#ifdef CONFIG_ALPHA_EV67
+#include "ev67-strcat.S"
+#else
+#include "strcat.S"
+#endif
+#ifdef CONFIG_ALPHA_EV6
+#include "ev6-stxcpy.S"
+#else
+#include "stxcpy.S"
+#endif
diff --git a/arch/alpha/lib/styncpy.S b/arch/alpha/lib/styncpy.S
new file mode 100644
index 00000000000000..72fc2754eb57c7
--- /dev/null
+++ b/arch/alpha/lib/styncpy.S
@@ -0,0 +1,11 @@
+#include "strncpy.S"
+#ifdef CONFIG_ALPHA_EV67
+#include "ev67-strncat.S"
+#else
+#include "strncat.S"
+#endif
+#ifdef CONFIG_ALPHA_EV6
+#include "ev6-stxncpy.S"
+#else
+#include "stxncpy.S"
+#endif