arc4.c:(___ksymtab+arc4_setkey+0x8): undefined reference to `no symbol'
+++ Matthias Maennich [11/09/19 06:21 +0100]:
Quoted 43 lines · kbuild test robot
Quoted 12 lines
tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/jeyu/linux.git modules-next head: 32bca2df7da27be34371a37f9bb5e2b85fdd92bd commit: 8651ec01daedad26290f76beeb4736f9d2da4b87 [3/11] module: add support for symbol namespaces. config: arm64-defconfig (attached as .config) compiler: aarch64-linux-gcc (GCC) 7.4.0reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
git checkout8651ec01daedad26290f76beeb4736f9d2da4b87
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=arm64Quoted 9 lines
If you fix the issue, kindly add following tag
Reported-by kbuild test robot <[email protected]>All errors (new ones prefixed by >>):
lib/crypto/arc4.o: In function `__ksymtab_arc4_setkey':Quoted 1 line
Quoted 1 line
arc4.c:(___ksymtab+arc4_setkey+0x8): undefined reference to `no symbol'
lib/crypto/arc4.o: In function `__ksymtab_arc4_crypt':Quoted 1 line
Quoted 1 line
arc4.c:(___ksymtab+arc4_crypt+0x8): undefined reference to `no symbol'
Hmm, this is caused by the relative relocation of the '
namespace_offset' struct member to NULL in case there is no namespace defined:#define __KSYMTAB_ENTRY(sym, sec) \ __ADDRESSABLE(sym) \ asm(" .section \"___ksymtab" sec "+" #sym "\", \"a\" \n" \ " .balign 4 \n" \ "__ksymtab_" #sym ": \n" \ " .long " #sym "- . \n" \ " .long __kstrtab_" #sym "- . \n" \ " .long 0 - . \n" \ ^^^^^^^ " .previous \n")struct kernel_symbol { int value_offset; int name_offset; int namespace_offset; };
Quoted 5 lines
That is apparently not an issue on x86, but on arm. Not sure how to express a relative relocation to NULL then.
I will try to solve this somehow, just wanted to check if somebody knows the trick here.
(Adding more CC's..)
Do we have to have a place-relative relocation there? If we can't find a workaround, having just .long 0 for a null namespace seemed to fix the build issues on arm64 for me at least..
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi all,
Quoted 47 lines · Jessica Yu
+++ Matthias Maennich [11/09/19 06:21 +0100]:
Quoted 46 lines · kbuild test robot
Quoted 12 lines
tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/jeyu/linux.git modules-next head: 32bca2df7da27be34371a37f9bb5e2b85fdd92bd commit: 8651ec01daedad26290f76beeb4736f9d2da4b87 [3/11] module: add support for symbol namespaces. config: arm64-defconfig (attached as .config) compiler: aarch64-linux-gcc (GCC) 7.4.0reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
git checkout8651ec01daedad26290f76beeb4736f9d2da4b87
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=arm64Quoted 9 lines
If you fix the issue, kindly add following tag
Reported-by kbuild test robot <[email protected]>All errors (new ones prefixed by >>):
lib/crypto/arc4.o: In function `__ksymtab_arc4_setkey':Quoted 1 line
Quoted 1 line
arc4.c:(___ksymtab+arc4_setkey+0x8): undefined reference to `no symbol'
lib/crypto/arc4.o: In function `__ksymtab_arc4_crypt':Quoted 1 line
Quoted 1 line
arc4.c:(___ksymtab+arc4_crypt+0x8): undefined reference to `no symbol'
Hmm, this is caused by the relative relocation of the '
namespace_offset' struct member to NULL in case there is no namespace defined:#define __KSYMTAB_ENTRY(sym, sec) \ __ADDRESSABLE(sym) \ asm(" .section \"___ksymtab" sec "+" #sym "\", \"a\" \n" \ " .balign 4 \n" \ "__ksymtab_" #sym ": \n" \ " .long " #sym "- . \n" \ " .long __kstrtab_" #sym "- . \n" \ " .long 0 - . \n" \ ^^^^^^^ " .previous \n")struct kernel_symbol { int value_offset; int name_offset; int namespace_offset; };That is apparently not an issue on x86, but on arm. Not sure how to express a relative relocation to NULL then.
Quoted 8 lines
Quoted 2 lines
I will try to solve this somehow, just wanted to check if somebody knows the trick here.
(Adding more CC's..)
Do we have to have a place-relative relocation there? If we can't find a workaround, having just .long 0 for a null namespace seemed to fix the build issues on arm64 for me at least..
Ard, Alex and I have hacked the following diff which seems to do the trick. I'll post as a proper patch later today.
Will
--->8
include/asm-generic/export.h +1 -1
@@ -17,7 +17,7 @@ .macro __put, val, name#ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS - .long \val - ., \name - ., 0 - . + .long \val - ., \name - ., 0#elif defined(CONFIG_64BIT ) .quad \val, \name, 0#else
include/linux/export.h +1 -1
@@ -68,7 +68,7 @@ extern struct module __this_module; "__ksymtab_" #sym ": \n" \ " .long " #sym "- . \n" \ " .long __kstrtab_" #sym "- . \n" \ - " .long 0 - . \n" \ + " .long 0 \n" \ " .previous \n")struct kernel_symbol {
kernel/module.c +2 -0
@@ -547,6 +547,8 @@ static const char *kernel_symbol_name(const struct kernel_symbol *sym)static const char *kernel_symbol_namespace (const struct kernel_symbol *sym) {#ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS +if (!sym->namespace_offset) +return NULL ;return offset_to_ptr (&sym->namespace_offset);#else return sym->namespace;
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel