]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
objdump: Handle 32-bit base address in debug_ranges / debug_loc.
authorAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 16 Oct 2015 09:58:02 +0000 (11:58 +0200)
committerAlan Modra <amodra@gmail.com>
Thu, 10 Dec 2015 13:48:48 +0000 (00:18 +1030)
commit3a0dfbe2872116cad4f821624fd9d62d582485fe
tree72d15930365e5fb3d9e068df9df633f6fa5bfd88
parentdd5474b0c1a0ae90bc68d07e18136000fde2e461
objdump: Handle 32-bit base address in debug_ranges / debug_loc.

When the DWARF address size is 32-bit, but the host machine is 64-bit,
objdump fails to spot base addresses specified in the .debug_ranges and
.debug_loc lists.

As an example, here is the output when dumping an example .debug_ranges
section with the pre-patched objdump:

    Contents of the .debug_ranges section:

        Offset   Begin    End
        00000000 ffffffff 00000004 (start > end)
        00000000 00000000 00000004
        00000000 ffffffff 00000008 (start > end)
        00000000 00000000 00000004
        00000000 <End of list>

And this is what the same section looks like when dumped with the
patched version of objdump:

    Contents of the .debug_ranges section:

        Offset   Begin    End
        00000000 ffffffff 00000004 (base address)
        00000000 00000004 00000008
        00000000 ffffffff 00000008 (base address)
        00000000 00000008 0000000c
        00000000 <End of list>

binutils/ChangeLog:

* dwarf.c (is_max_address): New function.
(display_loc_list): Remove out of date comment, use
is_max_address.
(display_debug_ranges): Likewise.

binutils/testsuite/ChangeLog:

* binutils-all/objdump.exp: Add test for .debug_ranges decode.
* binutils-all/dw2-ranges.S: New file.
* binutils-all/dw2-ranges.W: New file.
binutils/ChangeLog
binutils/dwarf.c
binutils/testsuite/ChangeLog
binutils/testsuite/binutils-all/dw2-ranges.S [new file with mode: 0644]
binutils/testsuite/binutils-all/dw2-ranges.W [new file with mode: 0644]
binutils/testsuite/binutils-all/objdump.exp