0

I tried to build simple kernel module (using source downloaded from developer.sonymobile.com) but after compiling i can't insmod it: Unknown symbol __gnu_mcount_nc so i founded a solution and I wrote another module using assembler and I exported this function. After this module insmoded correctly but I see in lsmod that all modules are permament. I have a problem with simple filesystem (Permission denied - default action when pointer is null), on PC this code works without any errors.

I guess the config is wrong in source code, (probably offset of some fields in structure is another than in device).

Version of built is: 24.0.A.5.14 (downloaded from developer.sonymobile.com site).

Can I do anything to get this same configuration as in device?

I had not /proc/config.gz so I can't get it easily.

Module source:

#include <linux/module.h>
#include <linux/kernel.h>

int __init example_init(void)
{
    printk("Hello world!\n");
    return 0;
}

void __exit example_exit(void)
{
    printk("example module exit\n");
}

module_init(example_init);
module_exit(example_exit);

And I see Hello World! in dmesg but module is still permament.

Source of __gnu_mcount_nc i found here: http://doc.ironwoodlabs.com/arm-arm-none-eabi/html/getting-started/arm-mcount.html

krystian71115
  • 1,927
  • 17
  • 36

1 Answers1

0

Do you compile with with profile enable -pg flag when you build the kernel module? It looks that way.

The kernel module Makefile for CFLAGS.

Jbobo Lee
  • 33
  • 4