Hitstudent
Hitstudent

Reputation: 1

Linux module loadables

I am trying to accomplish following: There is a binary file with simple mathematics (+ and *) - like a library. And the plans are to create such file in assembly. The question is how to "give" contents of such file to the module?

I was hoping that ELF has required functionality but than module is ELF and it is not clear whether it is possible to load and use ELF object inside a module.

Upvotes: 0

Views: 168

Answers (1)

user257111
user257111

Reputation:

If I understand what you are saying correctly, you have a piece of code in assembly containing some functions that do basic mathematics and you'd like to use them in a linux kernel module?

Compile the assembly together with the kernel module i.e. add the asmoutput.o file to the dependencies for the kernel module. However, given that this would make your module platform dependent I've no idea what the procedure is. I don't think it's commonly done; most kernel modules are in C.

You're misunderstanding what ELF is I think. ELF is the format of the binary file used for executables, nothing more.

If you're looking to load other kernel modules, well, module dependency happens so this is definitely possible, but as Rup says in the comments, why? There are very few reasons for switching out various dependent bits of code.

Upvotes: 1

Related Questions