|
From: Real N. <enj...@gm...> - 2014-06-04 13:39:19
|
On Fri, May 30, 2014 at 10:50:59AM +0200, Richard Weinberger wrote:
I find the function through checking which object file has the _ex_table section.
tmp]$ cat find_ex_table.sh
#!/bin/bash
(cd ~/uml/linux-3.12.6; find . -type f -name '*.o' > /tmp/xx.txt)
for file in `cat /tmp/xx.txt`; do
readelf -S ~/uml/linux-3.12.6/$file | grep ex_table
if [ $? -eq 0 ]; then
echo $file;
echo;
fi
done
All __extable entries belong to function csum_partial_copy_generic_i386 defined in file linux-3.12.6/arch/x86/um/checksum_32.S
However, I am confused with the difference between __ex_table of vmlinux.o and vmlinux(linux). To avoid mess the email, I only take two lines of the each objdump output.
-------------------------------------------------------------------------------
um]$ objdump --full-contents --section=__ex_table ~/uml/linux-3.12.6/vmlinux.o
/uml/linux-3.12.6/vmlinux.o: file format elf32-i386
Contents of section __ex_table:
0000 9e3d0100 00000000 a13d0100 00000000 .=.......=......
0010 a33d0100 00000000 a83d0100 1b000000 .=.......=......
-------------------------------------------------------------------------------
um]$ objdump --full-contents --section=__ex_table ~/uml/linux-3.12.6/vmlinux
uml/linux-3.12.6/vmlinux: file format elf32-i386
Contents of section __ex_table:
82a9048 b630dcff 14bcf6ff b130dcff 0cbcf6ff .0.......0......
82a9058 ab30dcff 04bcf6ff a830dcff 17bcf6ff .0.......0......
-------------------------------------------------------------------------------
Do you know, how to "9e3d0100" (vmlinx.o) become "b630dcff" (vmlinux), and the "00000000" (vmlinx.o) have been replaced with different values?
> Am 30.05.2014 10:08, schrieb enjoy mindful:
> > Sorry. I know how to use addr2line. But it is not what I'm looking for.
> >
> > For example, with i386 kernel, it is easy to find c017e7a5 belong to
> > function get_user.
> >
> > x86]$ vi /hack/linux-3.12.6/Documentation/x86/exception-tables.txt
> > .............
> > 217 or in human readable byte order:
> > 218
> > 219 > c01aa7c4 c017c093 c0199fe0 c017c097 c017c099 ................
> > 220 > c01aa7d4 c017c2f6 c0199fe9 c017e7a5 c0199ff5 ................
> > 221 ^^^^^^^^^^^^^^^^^
> > 222 this is the interesting part!
> > 223 > c01aa7e4 c0180a08 c019a001 c0180a0a c019a004 ................
> >
> > my question is how to find 0xffdc6eb8 belong to which uml kernel function.
>
> Ah ok.
> I'd decode it from the source side.
> I.e. start in arch/x86/um/fault.c
>
> Thanks,
> //richard
|