Irritating symbol table problem
Posted: Thu Dec 27, 2007 10:49 pm
I have a working backtrace function which relies on a kernel symbol table I load using grub modules. All of this works properly. My problem lies with generating accurate symbol tables.
I currently use that command to generate a list of symbols which includes the start and size of each function in the kernel. The problem is that my assembly functions have no reported size.
These functions, for background, are written in GNU AS assembly.
A quick look at the kernel .symtab section shows that my assembly functions are listed as NOTYPE, rather than FUNC.
Currently I have a workaround. I currently manually patch the symbols table with a script that replaces the 0 size value with a precalculated value
Has anybody worked out how to do this properly? More specifically has anybody figured out how to generate proper symbols for assembly functions?
Code: Select all
i586-elf-objdump.exe -tC install/kernel.elf | grep .text | sort | cut -c 1-9,25- > symbols
These functions, for background, are written in GNU AS assembly.
Code: Select all
00101ffa 000005e memory::PageController::VirtToPhys(memory::PageDirectory*, unsigned long)
00102058 000000b memory::PageController::Invalidate(unsigned long*)
00102064 000008c tasks::ProcessController::createProcess(void*, unsigned long)
001020f0 0000000 loader
0010212c 0000000 exception0
00102133 0000000 exception1
Code: Select all
138: 001020f0 0 NOTYPE GLOBAL DEFAULT 1 loader
Code: Select all
sed 's/0000000 loader/0000036 loader/' <symbols > symbols.tmp