This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: binutils/2096: addr2line fails on linux-kernel


There are 2 bugs in dwarf2.c. BFD section's lvm is not very useful
for ELF since ELF section doesn't have it and it is made up by bfd:

[hjl@gnu-3 addr2line]$ readelf -S vmlinux
There are 41 section headers, starting at offset 0x20f06bc:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .text             PROGBITS        c0100000 001000 226f60 00  AX  0   0 16
...
[hjl@gnu-3 addr2line]$ objdump -h  vmlinux

vmlinux:     file format elf32-i386

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00226f60  c0100000  00100000  00001000  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE

dwarf2.c should use vma for ELF.

The section bug is when comp_unit_contains_address return TRUE,
it doesn't necessary mean a compilation unit really contains the
given address. It may happen when "asm" is used to define functions
like arch/i386/kernel/semaphore.c in the Linux 2.6.14 kernel. My
patch checks the line info table to make sure that a compilation
unit really contains the given address.


H.J.

Attachment: bfd-dwarf-addr-2.patch
Description: Text document

Attachment: bfd-dwarf-unit-1.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]