Including .symtab in kernels binary image
Posted: Fri Aug 12, 2016 8:02 am
I am trying to include the symbol table of my kernel (or at least my statically linked kernel stdlib) in its binary image, so that I can use parts of the kernel like a shared library when loading processes.
The problem is that there does not seem to be a good way to dump the symbols of an elf image to binary.
I could of course just append the original elf file to the binary kernel image, but that feels pretty wasteful.
objcopy --extract-symbol yields a file that is the same size as the original image, so that doesn't seem to help at all and read-elf doesn't seem to let me dump the binary, the best it can do is dumping a representation of the hex values in plaintext.
Will I have to write my own way of getting that information or am I missing something trivial?
Just statically linking to kernel adresses in kernel modules is not an option sadly, since I want to be able to migrate processes to user space and patch the symbols into the user space stdlib then.
The problem is that there does not seem to be a good way to dump the symbols of an elf image to binary.
I could of course just append the original elf file to the binary kernel image, but that feels pretty wasteful.
objcopy --extract-symbol yields a file that is the same size as the original image, so that doesn't seem to help at all and read-elf doesn't seem to let me dump the binary, the best it can do is dumping a representation of the hex values in plaintext.
Will I have to write my own way of getting that information or am I missing something trivial?
Just statically linking to kernel adresses in kernel modules is not an option sadly, since I want to be able to migrate processes to user space and patch the symbols into the user space stdlib then.