exporting the kernels linked list
I want to make a proof of concept and for easier development I would like to export the linked list methods which are in "include/linux/list.h". But I get the error below if I remove the "static" from the functions declaration. Also the exported functions cannot be static. (I have for now tried to just export the "add_list" method.) So:
Why can the add_list method be non-static? What can I do? The error while compiling the kernel with a non-static "list_add" method: Code:
init/do_mounts_initrd.o: In function `list_add': ** My main goal is to export the symbols and then use kprobes to hook these functions via kernel modules, and develop my proof of concept without recompiling the kernel every time from scratch. Of curse after I am happy with what I did, I will recommend putting the code into the kernel and removing the export. |
Quote:
If you want it to take a pointer, create a child class that takes pointers but give it another name. |
I think I may have not explained good enough what I did, because I didn't add any thing. The only thing I did was going to the file "include/linux/list.h" and remove the word "static" which appears in the definition of the function "add_list" and then re-compiled the kernel. The error above appeared.
|
That's because if it isn't static, it's being redefined everywhere it appears in your code (not to mention in the header files)
It would seem a better option to create a child class for it, leave the original code alone, and work with that otherwise your looking at re-writing a significant portion of the linux kernel code. |
OK, that helps a lot. But what do you mean by creating a child class? I don't know how this is done in C language.
|
Quote:
I'd start there. |
All times are GMT -5. The time now is 07:29 AM. |