Jump to content

PLT section(s) missing using out-of-tree module on Armbian 20.11.6 Buster orangepizero


Recommended Posts

Posted
Armbianmonitor:

Dear all,


I can successfully build an out-of-tree module on 5.9 and 5.10.x kernels, but have trouble running them since Armbian 20.11.6. I fixed the module.lds missing problem using the receipt from a bugreport with an extra Makefile target:
 

PWD=$(shell pwd)
VER=$(shell uname -r)
KERNEL_BUILD=/lib/modules/$(VER)/build
# Later if you want to package the module binary you can provide an INSTALL_ROOT
# INSTALL_ROOT=/tmp/install-root
MY_CFLAGS += -g -DDEBUG

# for newer 5.10.x kernels with x<=4
$(KERNEL_BUILD)/scripts/module.lds: $(KERNEL_BUILD)/scripts/module.lds.S
        sudo sh -c "sed '$ d' $(KERNEL_BUILD)/scripts/module.lds.S > $(KERNEL_BUILD)/scripts/module.lds"

pps:    pps_timer.c
        $(MAKE) -C $(KERNEL_BUILD) M=$(PWD) modules
                                    
pps_install: pps
        sudo $(MAKE) -C $(KERNEL_BUILD) M=$(PWD) obj_m=pps_timer.o \
        INSTALL_MOD_PATH=$(INSTALL_ROOT) modules_instal

 

When trying the module on the 5.10.x kernel, I get an error that the Exec format is not correct:

$ sudo modprobe pps_timer
modprobe: ERROR: could not insert 'pps_timer': Exec format error


And in dmesg, I see the following line:

[ 1413.944125] pps_timer: module PLT section(s) missing

 

Did something change in the 5.10.x kernel that needs something extra in the Makefile or source for out-of-tree modules?

Kind regards,

Dennis

Posted

Just retried with a very simple kernel module (added license in second attempt to get rid of kernel taint), with the same result.

 

$ sudo modprobe ktest_module
modprobe: ERROR: could not insert 'ktest_module': Exec format error

 

$ dmesg|tail
[   24.151391] pps_timer: module PLT section(s) missing
[   33.784067] vcc3v0: disabling
[   33.784092] vcc5v0: disabling
[   33.784099] vcc-wifi: disabling
[ 1413.944125] pps_timer: module PLT section(s) missing
[ 7157.483985] ktest_module: module license 'unspecified' taints kernel.
[ 7157.484004] Disabling lock debugging due to kernel taint
[ 7157.484019] ktest_module: module PLT section(s) missing
[ 7357.485416] ktest_module: module PLT section(s) missing
[ 7465.032086] ktest_module: module PLT section(s) missing

 

 

#include <linux/module.h>    /* Needed by all modules */
#include <linux/kernel.h>    /* Needed for KERN_INFO */
#include <linux/init.h>      /* Needed for the macros */
#include <linux/version.h>
 
/* Licensed under the GPL-2 or later. */
MODULE_LICENSE("GPL v2");

static int __init ktest_module_init(void)
{
    //printk(KERN_INFO "Driver version %s\n", VERSION);
    printk(KERN_INFO "Buona Sera :)\n");
    return 0;
}
 
static void __exit ktest_module_exit(void)
{
    printk(KERN_INFO "Ciao!\n");
}
 
module_init(ktest_module_init);
module_exit(ktest_module_exit);

 

Posted

Hi, have the same problem with compiling the can4linux driver.
Why does someone suggest to remove the last line of the linker script module.lds ?

  sudo sh -c "sed '$ d' 

 

it should include something for sure, may be the .plt section.

#include does not work, so I added the content of  ./linux-headers-5.10.4-sunxi/arch/arm/include/asm/module.lds.h

 

Zitat

SECTIONS {
        .plt : { BYTE(0) }
        .init.plt : { BYTE(0) }
}


now I can load the module, but is may be not correct

Posted
13 minutes ago, hjoe said:

Hi, have the same problem with compiling the can4linux driver.

 

Like most of the people out there because of:
https://github.com/Mange/rtl8192eu-linux-driver/issues/205#issuecomment-736366347

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=975571


It would be already fixed, but daytime job and family has advantage, there are lots of bugs:
https://github.com/armbian/build/pulls

https://github.com/armbian/build/issues

https://armbian.atlassian.net/browse/AR

 

... and no help where we are asking for one:
https://forum.armbian.com/forum/54-help-wanted/

Posted
1 hour ago, hjoe said:

Hi, have the same problem with compiling the can4linux driver.
Why does someone suggest to remove the last line of the linker script module.lds ?

  sudo sh -c "sed '$ d' 

 

it should include something for sure, may be the .plt section.

#include does not work, so I added the content of  ./linux-headers-5.10.4-sunxi/arch/arm/include/asm/module.lds.h

 


now I can load the module, but is may be not correct

Hi @hjoe,

 

Your fix seems to work beautifully on the orangepizero, thanks! My kernel module loads and runs beautifully. Tomorrow I'll try on nanopi neo2+ and neo3.

 

@Igor Good luck with the family in these strange times. I hope things change for the best in the next months as more people get vacinated.


Kind regards,

Dennis

Posted
38 minutes ago, Dennboy said:

Good luck with the family in these strange times.


Its fixing bugs for you or fixing broken RC car for my kid. 

Posted

Yes Igor, for sure we are thankful for all your help here!
I'm glad only toys got broken:) Hope you can teach your kid to repair toys some day;)

I tried with the nanopineo2 (Armbian 20.11.6 Buster), the modules build fine but the installation reports SSL errors during installation of the module, that didn't appear on the orangepizero. The module(s) can be loaded and run after depmod -a.

  INSTALL pps_timer.ko
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:69
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:76
sign-file: certs/signing_key.pem: No such file or directory
  DEPMOD  5.10.4-sunxi64

 

Kind regards,

Dennis

 

Posted

Igor, in https://armbian.atlassian.net/browse/AR I can see you marked it as solved. Did now expect that we have new kernel-headers, but apt-get update and apt-get upgrade does not show a new one?

 

May be it is not related but I can not get interrupt number 58 (CAN module) working.

Am 13.1.2021 um 18:34 schrieb Igor:

... and no help where we are asking for one:
https://forum.armbian.com/forum/54-help-wanted/

I'm sure all these tasks are above my skills, but when finished may small project, I'll have a look at it. 

Posted

Hi Igor,

 

Thanks very much for fixing this, building out-of-tree modules now works great in Armbian 20.02.1, on 5.10.12-sunxi (opi0) and 5.10.12-rockchip64 (neo3)!

Kind regards,
Dennis

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines