0

i have extracted the ELF file(stripped) from an bzImage using extract-vmlinux and extracted the __ksymtab and __ksymtab_strings sections afterwards.

How can i calculate the offset of an arbitrary symbol out of these two files?

Is the offset actually stored in the __ksymtab section and how is it linked to the __ksymtab_strings section?

Is it even possible to get the offset statically? My main goal is to get the offset (from kernel base) of an arbitrary kernel symbol out this ELF file(stripped).

How can i get the offset of an arbitrary kernel symbol for a specific kernel version(4.13.0-rc3)?

Thank you in advance.

1

Got it.

__ksymtab entries link directly into __ksymtab_strings section.

Can someone tell me, why there is no __ksymtab and __ksymtab_strings section, when i a create a linux+busybox image like in this tutorial:

http://www.zachpfeffer.com/single-post/Build-the-Linux-kernel-and-Busybox-and-run-on-QEMU

Even if i activate these options before compiling the kernel:

CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_KALLSYMS_BASE_RELATIVE=y

In this case an ksym offset table is located in the .rodata section

Which config option is the reason these sections are used in the elf file?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.