Andes Workshop
https://forum.andestech.com/

Can not insert module in Linux built by BSP320 with N1337
https://forum.andestech.com/viewtopic.php?f=16&t=782
Page 1 of 1

Author:  ianfeng [ Wed Jan 15, 2014 2:35 pm ]
Post subject:  Can not insert module in Linux built by BSP320 with N1337

===== Question =====
With N1337,
Toolchain: nds32le-linux-uclibc-v3 Linux version
Ramdisk and Linux kernel are built with it under Ubuntu 10.04.
Kernel config: xc5_defconfig

Error messages when insert module.
Code:
/ # insmod hello.ko
hello: out of bounds relocation
insmod: can't insert 'hello.ko': invalid module format


===== Workaround =====
Update file "arch/nds32/kernel/module.c" to fix this issue.
Code:
@@ -182,7 +182,7 @@ apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, unsigned int syminde

sym = ((Elf32_Sym *)symsec->sh_addr) + offset;

- if (rel->r_offset < 0 || rel->r_offset > dstsec->sh_size - sizeof(u16)) {
+ if (rel->r_offset < 0) {
printk(KERN_ERR "%s: out of bounds relocation\n", module->name);
PRINTK("section %d reloc %d offset 0x%0x size %d\n",
relindex, i, rel->r_offset, dstsec->sh_size);


===== Fixing =====
Will be fixed in BSPv321.

Page 1 of 1 All times are UTC + 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/