I'm trying to use the addr2line source as an example of using bfd to map the
addresses from the glibc backtrace() back to file and line number. In the
process I realized that addr2line doesn't report the correct address.

This seems like a bug.

gdb reports:
(gdb) bt
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7e989a1 in raise () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7e9a2b9 in abort () from /lib/tls/i686/cmov/libc.so.6
#3  0x0804836b in level_aa () at ab.c:5
#4  0x0804838c in main () at ab.c:10

addr2line:

% addr2line -e ab 0x0804836b
/home/sroberts/s/segv/ab.c:9

% cat ab.c
#include <stdlib.h>

void level_aa()
{
        abort(); /* <- this is line 5, gdb is correct */
}

int main()
{
        level_aa();
        return 0;
}

compiled with:

% gcc -o ab -g ab.c

% /usr/bin/addr2line --version
GNU addr2line 2.16.91 20060118 Debian GNU/Linux

% uname -a
Linux pebble.bycast.com 2.6.15-25-386 #1 PREEMPT Wed Jun 14 11:25:49 UTC 2006 
i686 GNU/Linux

% cat /etc/issue
Ubuntu 6.06 LTS \n \l

% gcc --version
gcc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)

% gdb --version
GNU gdb 6.4-debian
This GDB was configured as "i486-linux-gnu".

Thanks,
Sam



_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to