Andes Workshop

It is currently Fri Mar 29, 2024 1:12 am

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Can not insert module in Linux built by BSP320 with N1337
PostPosted: Wed Jan 15, 2014 2:35 pm 
Offline

Joined: Wed Apr 13, 2011 7:44 pm
Posts: 23
===== 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.


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group