Dumping symbolic table of kernel image itself
Posted: Fri Jun 24, 2011 3:18 pm
I'm currently working on loading elf modules and I want to let the modules to access function within kernel binary.
However, I figured out that kernel.bss is overlapping with the elf section & headers, which contain the symbolic table, got wiped out upon initializations.
My current workaround is to force the bss to shift behind the headers:
My question, is there any better way instead of putting the ugly 10240 constant there? Can I tell the linker to put bss after the (address start + file_length)?
However, I figured out that kernel.bss is overlapping with the elf section & headers, which contain the symbolic table, got wiped out upon initializations.
My current workaround is to force the bss to shift behind the headers:
Code: Select all
.data ALIGN(4096) : {
*(.data*)
*(.gnu.linkonce.d*)
data_end = .;
}
.= data_end + 10240;
.bss ALIGN(4096) : {
sbss = .;
*(COMMON*)
*(.bss*)
*(.gnu.linkonce.b*)
ebss = .;
}