[Bug libdw/28220] dwarf_location_attr returns high-bit junk from .debug_addr when fetching 32-bit addresses

mark at klomp dot org sourceware-bugzilla@sourceware.org
Wed Sep 8 16:01:09 GMT 2021


https://sourceware.org/bugzilla/show_bug.cgi?id=28220

--- Comment #4 from Mark Wielaard <mark at klomp dot org> ---
Turns out we could have caught this with the varlocs testcase.
Before the fix:

$ for i in testfile-vars-*.o; do echo $i; tests/varlocs --debug --exprlocs -e
$i | grep exprloc; done
testfile-vars-clang-dwarf4-32.o
    location (exprloc) {addr(0x0)}
    location (exprloc) {addr(0x4)}
testfile-vars-clang-dwarf4-64.o
    location (exprloc) {addr(0x0)}
    location (exprloc) {addr(0x4)}
testfile-vars-clang-dwarf5-32.o
    location (exprloc) {addr: 0x400000000}
    location (exprloc) {addr: 0x616c630000000004}
testfile-vars-clang-dwarf5-64.o
    location (exprloc) {addr: 0x0}
    location (exprloc) {addr: 0x4}
testfile-vars-gcc-dwarf4-32.o
    location (exprloc) {addr(0x0)}
    location (exprloc) {addr(0x4)}
testfile-vars-gcc-dwarf4-64.o
    location (exprloc) {addr(0x0)}
    location (exprloc) {addr(0x4)}
testfile-vars-gcc-dwarf5-32.o
    location (exprloc) {addr(0x0)}
    location (exprloc) {addr(0x4)}
testfile-vars-gcc-dwarf5-64.o
    location (exprloc) {addr(0x0)}
    location (exprloc) {addr(0x4)}

With the patch:

$ for i in testfile-vars-*.o; do echo $i; LD_LIBRARY_PATH=libelf:libdw
tests/varlocs --debug --exprlocs -e $i | grep exprloc; done
testfile-vars-clang-dwarf4-32.o
    location (exprloc) {addr(0x0)}
    location (exprloc) {addr(0x4)}
testfile-vars-clang-dwarf4-64.o
    location (exprloc) {addr(0x0)}
    location (exprloc) {addr(0x4)}
testfile-vars-clang-dwarf5-32.o
    location (exprloc) {addr: 0x0}
    location (exprloc) {addr: 0x4}
testfile-vars-clang-dwarf5-64.o
    location (exprloc) {addr: 0x0}
    location (exprloc) {addr: 0x4}
testfile-vars-gcc-dwarf4-32.o
    location (exprloc) {addr(0x0)}
    location (exprloc) {addr(0x4)}
testfile-vars-gcc-dwarf4-64.o
    location (exprloc) {addr(0x0)}
    location (exprloc) {addr(0x4)}
testfile-vars-gcc-dwarf5-32.o
    location (exprloc) {addr(0x0)}
    location (exprloc) {addr(0x4)}
testfile-vars-gcc-dwarf5-64.o
    location (exprloc) {addr(0x0)}
    location (exprloc) {addr(0x4)}

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Elfutils-devel mailing list