[PATCH] Properly sign-extend DWARF address ranges
Adam Nemet
anemet@caviumnetworks.com
Fri Jan 30 00:36:00 GMT 2009
More information about the Binutils mailing list
Fri Jan 30 00:36:00 GMT 2009
- Previous message (by thread): [PATCH, AVR] Add support for ATA6289
- Next message (by thread): [PATCH] Properly sign-extend DWARF address ranges
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
This is a simple follow-up to http://sourceware.org/ml/binutils/2007-08/msg00344.html. addr2line is not working on a MIPS64 -msym32 Linux kernel that uses ranges to describe compilation units. read_address already knows how to sign-extend addresses if the bfd target prescribes that. read_address is already used for DW_FORM_addr i.e. DW_AT_{low,high}_pc but not for ranges. The patch below adjusts that. Tested with mipsisa664r2-elfoabi with gas, ld and binutils. OK to install? Adam * dwarf2.c: Update copyright year. (read_rangelist): Use read_address to read low_pc and high_pc in order to properly sign-extend VMAs. Index: dwarf2.c =================================================================== RCS file: /cvs/src/src/bfd/dwarf2.c,v retrieving revision 1.116 diff -u -p -r1.116 dwarf2.c --- dwarf2.c 18 Nov 2008 14:05:00 -0000 1.116 +++ dwarf2.c 30 Jan 2009 00:16:32 -0000 @@ -1,6 +1,6 @@ /* DWARF 2 support. Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions (gavin@cygnus.com). @@ -1803,20 +1803,11 @@ read_rangelist (struct comp_unit *unit, bfd_vma low_pc; bfd_vma high_pc; - if (unit->addr_size == 4) - { - low_pc = read_4_bytes (unit->abfd, ranges_ptr); - ranges_ptr += 4; - high_pc = read_4_bytes (unit->abfd, ranges_ptr); - ranges_ptr += 4; - } - else - { - low_pc = read_8_bytes (unit->abfd, ranges_ptr); - ranges_ptr += 8; - high_pc = read_8_bytes (unit->abfd, ranges_ptr); - ranges_ptr += 8; - } + low_pc = read_address (unit, ranges_ptr); + ranges_ptr += unit->addr_size; + high_pc = read_address (unit, ranges_ptr); + ranges_ptr += unit->addr_size; + if (low_pc == 0 && high_pc == 0) break; if (low_pc == -1UL && high_pc != -1UL)
- Previous message (by thread): [PATCH, AVR] Add support for ATA6289
- Next message (by thread): [PATCH] Properly sign-extend DWARF address ranges
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list