diff mbox series

libdw: set address size, offset size and version on fake CUs

Message ID 20210908201402.38174-1-mark@klomp.org
State Committed
Headers show
Series libdw: set address size, offset size and version on fake CUs | expand

Commit Message

Mark Wielaard Sept. 8, 2021, 8:14 p.m. UTC
There are three "fake CUs" that are associated with .debug_loc,
.debug_loclist and .debug_addr.  These fake CUs are used for "fake
attributes" to provide values that are stored in these sections
instead of in the .debug_info section. These fake CUs didn't have the
address size, offset size and DWARF version set. This meant that
values that depended on those properties might not be interpreted
correctly. One example was the value associated with a DW_OP_addrx
(which comes from the .debug_addr section).

Add a testcase using varlocs to test that addresses can correctly be
retrieved for gcc/clang, DWARF4/5 and 32/64 bits objects.

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

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 libdw/dwarf_begin_elf.c                   |  32 ++++++--
 tests/Makefile.am                         |  13 ++-
 tests/run-varlocs-vars.sh                 |  93 ++++++++++++++++++++++
 tests/testfile-vars-clang-dwarf4-32.o.bz2 | Bin 0 -> 568 bytes
 tests/testfile-vars-clang-dwarf4-64.o.bz2 | Bin 0 -> 605 bytes
 tests/testfile-vars-clang-dwarf5-32.o.bz2 | Bin 0 -> 741 bytes
 tests/testfile-vars-clang-dwarf5-64.o.bz2 | Bin 0 -> 761 bytes
 tests/testfile-vars-gcc-dwarf4-32.o.bz2   | Bin 0 -> 660 bytes
 tests/testfile-vars-gcc-dwarf4-64.o.bz2   | Bin 0 -> 691 bytes
 tests/testfile-vars-gcc-dwarf5-32.o.bz2   | Bin 0 -> 728 bytes
 tests/testfile-vars-gcc-dwarf5-64.o.bz2   | Bin 0 -> 768 bytes
 11 files changed, 130 insertions(+), 8 deletions(-)
 create mode 100755 tests/run-varlocs-vars.sh
 create mode 100644 tests/testfile-vars-clang-dwarf4-32.o.bz2
 create mode 100644 tests/testfile-vars-clang-dwarf4-64.o.bz2
 create mode 100644 tests/testfile-vars-clang-dwarf5-32.o.bz2
 create mode 100644 tests/testfile-vars-clang-dwarf5-64.o.bz2
 create mode 100644 tests/testfile-vars-gcc-dwarf4-32.o.bz2
 create mode 100644 tests/testfile-vars-gcc-dwarf4-64.o.bz2
 create mode 100644 tests/testfile-vars-gcc-dwarf5-32.o.bz2
 create mode 100644 tests/testfile-vars-gcc-dwarf5-64.o.bz2

GIT binary patch
literal 768
zcmV+b1ONO&T4*^jL0KkKSwuCE8vp{`fBpae`Tq9z_xtPpQh>kj-{^n{6aWN301!|B
zP(UC^zyfOFMpXm~DYmHnQ%wdmo~Dfr4KRRc(WXE!5s+X^k5CysG@58M5j38HX+0V#
z<4R;S(WcOY1R6ACF$_%_7zoj|GHBBr001-%4Gj%405kvrpc)zg0Av6FktIDwDtW3I
zq|u@3Gz~P-`lCjMKmY^OGzX|OG-zmPkb_W*jZkIAF%S^~#$&G~RhT@Kzs_Sm3_ZK4
z=y;F@nEQa*5MqL}HFaBReR?UqTD6>ScXPvI*O8f_`>z?W=P}r^IjJ<wf@T7u@P`o^
zh(^oYwc+JtInd#WYg?(Rb)<1Kd8G3Y!OQ~y63u%dQ6T8&`TcZFa!)sMN>-qurN!Z8
z-nrVh7c&SHkd-{>hJsFtAWBbi=BiPc(j?M3tt1_0l1XA{!<~~MV>3bPzq=;wxL|f#
z2{gPc0IpDgY-~z~LqOU`d59sln@H?5D;ik-?Q7c6sHN+m$oMXiV1Q0A67T7__;s}b
zxkC6>e5FDn0CXbRm~axq4gDA#lNjSJR<t7nw$^hC8ot(>15aaX6@<~u+lYa0o%RTA
z3y$%x?9S3sXfNE)l2$abGGP}b5XQ#a27!c{M=yH_K09ayOI_B#*s4`95Hq(55}6Q$
zz=!bVu#g!WxS`#1;6X6Ns5q_+-CO9KJ|U_(eS&xK&m~r_KG{4!3KuY7`8Wq^0MI<u
zGe9!)k%7i}OuW|ORFspiRMi=1CRQI?CK5a5QFk1w?gaix2$oTzm2=~YjT-L1xQa&W
zw6es1u9jdo`7PawNQQP2;E<A&T~jaGG9GTiYtZn=18Y#TG%)V2iHG*7%KXSmy_(o~
zFYu^Mm8h^9+$;ScvH06(J8q?+YV&6$4-<GM8;rFv!gj2p=2Gw^P$#!2ltdyci4z5M
yYiiaD-Z-zD%81S>oyrsj#tK<)WK(sBu+KrBGExwf#0dxgs9nhv;X*+W)<A3>kzU0B

literal 0
HcmV?d00001

Comments

Mark Wielaard Sept. 12, 2021, 7:43 p.m. UTC | #1
Hi,

On Wed, Sep 08, 2021 at 10:14:02PM +0200, Mark Wielaard wrote:
> There are three "fake CUs" that are associated with .debug_loc,
> .debug_loclist and .debug_addr.  These fake CUs are used for "fake
> attributes" to provide values that are stored in these sections
> instead of in the .debug_info section. These fake CUs didn't have the
> address size, offset size and DWARF version set. This meant that
> values that depended on those properties might not be interpreted
> correctly. One example was the value associated with a DW_OP_addrx
> (which comes from the .debug_addr section).
> 
> Add a testcase using varlocs to test that addresses can correctly be
> retrieved for gcc/clang, DWARF4/5 and 32/64 bits objects.
> 
> https://sourceware.org/bugzilla/show_bug.cgi?id=28220

Added ChangeLog entries and pushed.

Cheers,

Mark
diff mbox series

Patch

diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c
index 9e944b86..a368feb8 100644
--- a/libdw/dwarf_begin_elf.c
+++ b/libdw/dwarf_begin_elf.c
@@ -224,6 +224,23 @@  valid_p (Dwarf *result)
       result = NULL;
     }
 
+  /* We are setting up some "fake" CUs, which need an address size.
+     Check the ELF class to come up with something reasonable.  */
+  int elf_addr_size = 8;
+  if (result != NULL)
+    {
+      GElf_Ehdr ehdr;
+      if (gelf_getehdr (result->elf, &ehdr) == NULL)
+	{
+	  Dwarf_Sig8_Hash_free (&result->sig8_hash);
+	  __libdw_seterrno (DWARF_E_INVALID_ELF);
+	  free (result);
+	  result = NULL;
+	}
+      else if (ehdr.e_ident[EI_CLASS] == ELFCLASS32)
+	elf_addr_size = 4;
+    }
+
   /* For dwarf_location_attr () we need a "fake" CU to indicate
      where the "fake" attribute data comes from.  This is a block
      inside the .debug_loc or .debug_loclists section.  */
@@ -247,8 +264,9 @@  valid_p (Dwarf *result)
 	    = (result->sectiondata[IDX_debug_loc]->d_buf
 	       + result->sectiondata[IDX_debug_loc]->d_size);
 	  result->fake_loc_cu->locs = NULL;
-	  result->fake_loc_cu->address_size = 0;
-	  result->fake_loc_cu->version = 0;
+	  result->fake_loc_cu->address_size = elf_addr_size;
+	  result->fake_loc_cu->offset_size = 4;
+	  result->fake_loc_cu->version = 4;
 	  result->fake_loc_cu->split = NULL;
 	}
     }
@@ -274,8 +292,9 @@  valid_p (Dwarf *result)
 	    = (result->sectiondata[IDX_debug_loclists]->d_buf
 	       + result->sectiondata[IDX_debug_loclists]->d_size);
 	  result->fake_loclists_cu->locs = NULL;
-	  result->fake_loclists_cu->address_size = 0;
-	  result->fake_loclists_cu->version = 0;
+	  result->fake_loclists_cu->address_size = elf_addr_size;
+	  result->fake_loclists_cu->offset_size = 4;
+	  result->fake_loclists_cu->version = 5;
 	  result->fake_loclists_cu->split = NULL;
 	}
     }
@@ -306,8 +325,9 @@  valid_p (Dwarf *result)
 	    = (result->sectiondata[IDX_debug_addr]->d_buf
 	       + result->sectiondata[IDX_debug_addr]->d_size);
 	  result->fake_addr_cu->locs = NULL;
-	  result->fake_addr_cu->address_size = 0;
-	  result->fake_addr_cu->version = 0;
+	  result->fake_addr_cu->address_size = elf_addr_size;
+	  result->fake_addr_cu->offset_size = 4;
+	  result->fake_addr_cu->version = 5;
 	  result->fake_addr_cu->split = NULL;
 	}
     }
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c586422e..22942733 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -143,7 +143,7 @@  TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile test-nlist \
 	run-dwfl-report-elf-align.sh run-addr2line-test.sh \
 	run-addr2line-i-test.sh run-addr2line-i-lex-test.sh \
 	run-addr2line-i-demangle-test.sh run-addr2line-alt-debugpath.sh \
-	run-varlocs.sh run-exprlocs.sh run-funcretval.sh \
+	run-varlocs.sh run-exprlocs.sh run-varlocs-vars.sh run-funcretval.sh \
 	run-backtrace-native.sh run-backtrace-data.sh run-backtrace-dwarf.sh \
 	run-backtrace-native-biarch.sh run-backtrace-native-core.sh \
 	run-backtrace-native-core-biarch.sh run-backtrace-core-x86_64.sh \
@@ -399,7 +399,16 @@  EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-ar.sh \
 	     testfileppc32.bz2 testfileppc64.bz2 \
 	     testfiles390.bz2 testfiles390x.bz2 \
 	     testfilearm.bz2 testfileaarch64.bz2 \
-	     run-varlocs.sh run-exprlocs.sh testfile-stridex.bz2 \
+	     run-varlocs.sh run-exprlocs.sh run-varlocs-vars.sh \
+	     testfile-vars-clang-dwarf4-32.o.bz2 \
+	     testfile-vars-clang-dwarf4-64.o.bz2 \
+	     testfile-vars-clang-dwarf5-32.o.bz2 \
+	     testfile-vars-clang-dwarf5-64.o.bz2 \
+	     testfile-vars-gcc-dwarf4-32.o.bz2 \
+	     testfile-vars-gcc-dwarf4-64.o.bz2 \
+	     testfile-vars-gcc-dwarf5-32.o.bz2 \
+	     testfile-vars-gcc-dwarf5-64.o.bz2 \
+	     testfile-stridex.bz2 \
 	     testfile_const_type.c testfile_const_type.bz2 \
 	     testfile_implicit_pointer.c testfile_implicit_pointer.bz2 \
 	     testfile_parameter_ref.c testfile_parameter_ref.bz2 \
diff --git a/tests/run-varlocs-vars.sh b/tests/run-varlocs-vars.sh
new file mode 100755
index 00000000..e7598bf0
--- /dev/null
+++ b/tests/run-varlocs-vars.sh
@@ -0,0 +1,93 @@ 
+#! /bin/sh
+# Copyright (C) 2013, 2021 Red Hat, Inc.
+# This file is part of elfutils.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# elfutils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+. $srcdir/test-subr.sh
+
+# Testfiles generated with:
+#
+# $ cat foo.c
+# int x = 1;
+# int y = 2;
+#
+# for cc in gcc clang; do
+#   for v in 4 5; do
+#     for w in 32 64; do
+#       out="testfile-vars-$cc-dwarf$v-$w.o"
+#       "$cc" -m"$w" -Wall -Wextra -gdwarf-"$v" -c foo.c -o "$out"
+#     done
+#   done
+# done
+
+testfiles testfile-vars-clang-dwarf4-32.o
+testfiles testfile-vars-clang-dwarf4-64.o
+testfiles testfile-vars-clang-dwarf5-32.o
+testfiles testfile-vars-clang-dwarf5-64.o
+testfiles testfile-vars-gcc-dwarf4-32.o
+testfiles testfile-vars-gcc-dwarf4-64.o
+testfiles testfile-vars-gcc-dwarf5-32.o
+testfiles testfile-vars-gcc-dwarf5-64.o
+
+tempfiles varlocs.out
+testrun ${abs_top_builddir}/tests/varlocs --debug --exprlocs -e testfile-vars-clang-dwarf4-32.o | grep exprloc > varlocs.out
+diff -u varlocs.out - <<EOF
+    location (exprloc) {addr(0x0)}
+    location (exprloc) {addr(0x4)}
+EOF
+
+testrun ${abs_top_builddir}/tests/varlocs --debug --exprlocs -e testfile-vars-clang-dwarf4-64.o | grep exprloc > varlocs.out
+diff -u varlocs.out - <<EOF
+    location (exprloc) {addr(0x0)}
+    location (exprloc) {addr(0x4)}
+EOF
+
+testrun ${abs_top_builddir}/tests/varlocs --debug --exprlocs -e testfile-vars-clang-dwarf5-32.o | grep exprloc > varlocs.out
+diff -u varlocs.out - <<EOF
+    location (exprloc) {addr: 0x0}
+    location (exprloc) {addr: 0x4}
+EOF
+
+testrun ${abs_top_builddir}/tests/varlocs --debug --exprlocs -e testfile-vars-clang-dwarf5-32.o | grep exprloc > varlocs.out
+diff -u varlocs.out - <<EOF
+    location (exprloc) {addr: 0x0}
+    location (exprloc) {addr: 0x4}
+EOF
+
+testrun ${abs_top_builddir}/tests/varlocs --debug --exprlocs -e testfile-vars-gcc-dwarf4-32.o | grep exprloc > varlocs.out
+diff -u varlocs.out - <<EOF
+    location (exprloc) {addr(0x0)}
+    location (exprloc) {addr(0x4)}
+EOF
+
+testrun ${abs_top_builddir}/tests/varlocs --debug --exprlocs -e testfile-vars-gcc-dwarf4-64.o | grep exprloc > varlocs.out
+diff -u varlocs.out - <<EOF
+    location (exprloc) {addr(0x0)}
+    location (exprloc) {addr(0x4)}
+EOF
+
+testrun ${abs_top_builddir}/tests/varlocs --debug --exprlocs -e testfile-vars-gcc-dwarf5-32.o | grep exprloc > varlocs.out
+diff -u varlocs.out - <<EOF
+    location (exprloc) {addr(0x0)}
+    location (exprloc) {addr(0x4)}
+EOF
+
+testrun ${abs_top_builddir}/tests/varlocs --debug --exprlocs -e testfile-vars-gcc-dwarf5-64.o | grep exprloc > varlocs.out
+diff -u varlocs.out - <<EOF
+    location (exprloc) {addr(0x0)}
+    location (exprloc) {addr(0x4)}
+EOF
+
+exit 0
diff --git a/tests/testfile-vars-clang-dwarf4-32.o.bz2 b/tests/testfile-vars-clang-dwarf4-32.o.bz2
new file mode 100644
index 0000000000000000000000000000000000000000..c1ddf81ff6fcbc94e1f32cd3c2eccd38e733b92a
GIT binary patch
literal 568
zcmV-80>}MAT4*^jL0KkKS%dA}XaE7y|H=RVdH&z;{J)RqLI}U_-(tu>L;wH)pa{SL
z)!lYwkrZhF01W}4&<2eFXc_=$003lY0i`yHqMpiR(?*~G4^RLA$)E#302)0_83Rm`
znL|dJ0MVv~fB*m)0002>0BNAmN@^+UXqf;s0MGyrPylFTXaEL=Kr{#RVOlA4P(oBw
zT_yCAvw@uZ&rP?VA6p+NToQjnO*EqEu~(txUmW7EHc*&NItcKjm}z!QTy^4z4(!Ah
zg~)&yGY$h{Q1l_!Qr-@t=Kx|!c3KXU_E5}qKgrngTE4YO`&Fg`M3`f3GgB-8Y2}8A
zCea}hL9WsShpJOVK!c=NsS=r(-9(B5nw9H-B22;%%p}D$1k`b+!9@Ocs~wt?)m^8-
zxI`ne)+SxXm=Oo7fh>li78DQ&BHm-)7@9=LvjRl&6u;LF<zg0i!e|B~DDeW&A%L=t
z0Wij3l9dM#CXVZ~mI0&jN=YMt82z=S_!1CA#69(2pDo=>!q{=pS31n%K{mz0s75>_
zN<HZZAZEtVHFQKEYN0I!5@<dF8FKMfB{}`G=Ry~%i4gv&vL?!p=EPKo)6eNGsYnr2
znZxdjZO{U1eh5s%fHwe8UPK53U^W`z3V1F8^tNNb3;UF$c*Zps0$_IJF-;c=1VWg7
zhxc~rP)IVANgG=5g7It$l(QsQ<6xr2)N1Uwp=Jcku{zW_5k#8t5~x<i{}*yaI8cy-
G?cHbry7+AX

literal 0
HcmV?d00001

diff --git a/tests/testfile-vars-clang-dwarf4-64.o.bz2 b/tests/testfile-vars-clang-dwarf4-64.o.bz2
new file mode 100644
index 0000000000000000000000000000000000000000..df33299f1a1e32c593ff8e0890b280c7e86118cf
GIT binary patch
literal 605
zcmV-j0;2swT4*^jL0KkKS&6riHvj@0|J48g`TE}P{JZ1jLPWps-(kc606+u)U<kkg
z=M)wOrbKF<rfAgknLS3-(;(0T(t4hzO*96800*g|>FR)LlVvuL+7Y8fX^Eo)K$>L4
zFiarC(@acFFrI^khK!mtXwyR@A%p>t10d5t01SbU1c?xUBPpXts4=J*gVYQldQ43W
zgGZ*LMuCKyK`KKDA|URB*H(qjZlpPpZNkl3Ve3{Sy(3JyD)O2tq$-pU!G|Tg(leH%
zmtb||QJ`o`PgznZ5L<u6Wm(;>4$i(vE3!E@YwT^2ee^$>vP7ef5hRk}X9Tn{@lji{
z;26<-VgsuvL_pwa?0#Vc+DD;+4K|P?{L$2+5$SEDv9KFRH#Ok_X^o*afwUt@pbY+V
zi_Ma!1u3-`T-*RYNH2-=>CEcr+HxvV!VD<DzMMo9vJ-4N?w;d>*xm;o>swz6A(?5n
zAyZU4@U$4K*ea4iX`~I?a>W5QNvSn9A=!lPM1XWLZnYR;WNB*a#ZS8aT+`uX&``^4
zso8V<Q+bzO-D<d8@|wr2?~|e2vGy?&q0chG$BZzBt|eVuWkW%b$_Jdf6SYV|h|as}
zCT(7=D0m|d?FUMpTz_)4>-JZHtY2fkwN_yw-uPjUvLh2#M-_k{Mi8gtP)PvLUX<el
z#2s%yi<H5hA;l2b8=HK=h$SxI71~EtrEoStxPBcdOz=`cQi34Jesh>Rgp<JKlqfJ^
r)p0=d>9VSAkSqjMsSb{iu~GF*-G!nE;K>!PO>-A=ML1B9iMNqA2RRz=

literal 0
HcmV?d00001

diff --git a/tests/testfile-vars-clang-dwarf5-32.o.bz2 b/tests/testfile-vars-clang-dwarf5-32.o.bz2
new file mode 100644
index 0000000000000000000000000000000000000000..b1d6b6c436bafbd4cc0c18b33e77d1a273e29c43
GIT binary patch
literal 741
zcmV<B0vi27T4*^jL0KkKS-yM3Q~&~m|Nj5~{{7eI{=cuKMnM1X-(ti7Q37&MKtT!s
z005v0zyfsPKw}LPRXm=lr>OLe226l@Pf$HZKn*ki27#ae14e2Z4@fkPO#+?-o{XRX
z1JnQj&;S|$0002U0l)w>05k!h00TxK0B8UJ003wJks_HiCYnP)#Aq;qlT1xCX`>+Z
z8UO*IwG9T1Gyt`rHTu$_dWIRAZX0Y}A-5D{vI$8_XxT@CzD`BtZ+bZz2?z%i+e)z`
zF&;}Xx97(jw*9``xfLCz_RZ8nuNra{hmM#|JuYOqxocaERBcQcSJH@uBOns?;mhU9
zvze^h%`|Kn0G&mEobhNsG*@GEEZp2e=HsH$*6Zh8*ryvG^(wp8V-DZKQxG-+)nYPO
zkg;%K0a?X}B`ji1iZonl#7{;FFQ6vClR(@srIK*aW<5rWEJqonTxB_A2jQabG$B{B
z2}1%HgxDs~*uK@}B%4dPV35eB_doASjFcX*wbuHfkw`F8%nEc-EDp(tXhjNzjmTO!
zGNCVBWdOQW^($^x;Jiwf#FPw2nSmCuWh=0GEKfsbiVOO;a?fUET(6wenU|Fe7%k-x
zg<F4AfU@Q%GKtP`;f7WBo~hPpj0D(2L@_pkt%!@)q!(HJ-o;E>4Oo-~x9r)8Jj}fL
zQu|KBFl>-}jkDBe6TUC$g?ePQZlCHcX%S8FwH=V(2SZ6sT1<41gH4N%ujK;qfEB3?
zGYa7TC1Gph+Lr;GnGk+<unU<L{+9NvN7l~}+-oJ_I(23<ZL<v5$XeAUx?ggB8*{kk
zG^iO8xP*~shk%BFzcv~ctvXN9F-VF9H%=lm7IUj20K(zsVVMLXf<z@aGfaN5E>1e2
zu|_7k9S2&LgMd`2(4f0g6~n~Pk7?mC_GE#YK)`+yBuXT78Unu(Dv?%@fhmMgl&`oM
X48W&gfsE>*@9}peQ-ui&=e$KgnQlgt

literal 0
HcmV?d00001

diff --git a/tests/testfile-vars-clang-dwarf5-64.o.bz2 b/tests/testfile-vars-clang-dwarf5-64.o.bz2
new file mode 100644
index 0000000000000000000000000000000000000000..adf6c6a532b5902f0a911d7f6b092e211efc420f
GIT binary patch
literal 761
zcmV<V0tWp;T4*^jL0KkKS;MF%^#B6z|NsC0{{7bH{=3WN0ucZ2-{Qc)LQ)}AWJDSO
zAOL_sU`oIObm2yt%r!J229pFd3?n9(fslHD!T>Y?$N``<44J4NkZNcnMA}noJx!!!
z4Kx4%&>8>$0000000F=N0000082|tP000000gwPlktRZ(n3GKdO&J;nnrJl841u5l
zplE1lGy$iiWCG@dq$Ex`!5N@Q2RIP7^9!ph!c(OnsGE~2qMlt{jfO`psF!V&MhoTp
zo_|T%E8s*T6f3~u9sF3e7M#S387}SMP<HX?O79Q?2qgFlq`@Ka!PYB8`Tiy{(jac`
zQAJvm=UL6q+Sp)8E20neb}|I-PCyId!aN!uK19)}Sln{wo89MeDJZuPR)Jw-PAp>Y
zYAJO>LTx2fp$0T3lGMFz3T-8v#0w>eNoKTXx)`w@b5|Nc(rK|8jR1DD;UeQhXhUEX
zn`8|kS8&ozpviwGP5d-x`FYE^K&Z0~y$;|S2?h7hSG^A2CCad=H>L4Inq_$Ay)%~R
z2Et6ztkeS*>kgc^G{&76vL$l+`8A};yZ3z3*Q(5m+TXc0xDN)}AW0WpOhh}n@oOFd
zQA8=RP2BZWBr9~o8cn3ZGE~A1Hb)K@MWkgsroX+&uFMRlPVr7j!wAClpbo+u{fR+c
z+{sEom<s{qu_uY}j-yoX8D)F5uGI_P=X*f^PS#;={^5~*q#JPMbJa@$G1Nj1JFr@X
zdrS{WeiNuO3ciHGx#8K!+fFg`XfUhMTVAu^_EeWt+g5a-u9(4+G@^n}bkZY$abSoX
zS%_*a%xC816TrxsA*De{k!8YN0?=IToM}^oVBgroS3fc}lEkyJFjj#Ywx$pc8V{}t
z81M}Phz%evGCE;s&oMzJh*7XGB4OMQ0Vzxh4LKy%Pnp4_!2|8ZK;OVX563Zz&_yzA
ru%g6Y@~I_bLkA<7lr`#bp%RT@p`|IR(&>?CO#c^hML1B9!>A_ppSe^;

literal 0
HcmV?d00001

diff --git a/tests/testfile-vars-gcc-dwarf4-32.o.bz2 b/tests/testfile-vars-gcc-dwarf4-32.o.bz2
new file mode 100644
index 0000000000000000000000000000000000000000..da9aac73829eb036dad242af38c027e50259f70d
GIT binary patch
literal 660
zcmV;F0&D$3T4*^jL0KkKSt97HBme?4f7Sp0?&@ym{r~Ir5)%LK-{Rl`1O$M9Kmi~K
zzydVliqwXtiG@Qo8){8FqaXm$<Ur6G0MGyin^1b027rl>My6?{89!9@HlPMT^#ec#
zfB*mh27r2lfuLvxfuW!SLm{Ss8fXT90LWqh4FrgyG-(q}JwOai4^vG5&>CVH8UV;1
zkTk?J^w2p8(TBW*t>Og;Eg(UHIie&@(3c9OjoG&CC>euDNJIEeiIW?B1PNpMu=YPA
zmAN6!kGfFAh>bKv+AzJ4u?@&MP=SsZz;97<{(Q6NuAsVN05GAFu!>bU&|qqG>bBj&
zh$HUXpG>?8y*k&Y4JAOE5NEU<<{@%7VI*2;2F{C0wwr9W%S@%NYdlPrIwQ8h=fD-c
z*Kvtb^2TPcnxSN|1hj_F96~~Fwh9>8r4THl+aLt;1Hax>mSac4BMc%jg`y8UaQx$$
z)YXb{5denROG1N>AZTE{H7oEC)yEAd&Vm?kdOx#;)1w9}tn0wKnTR1>ZHO#7n6cc<
zvQz0}NJ|i?WH@Mqz&1V6e*L@jD=j|^aBBRnP!zajiP@7S<2w;44(y8cvb;~_NLLbB
z4Z$g{oaeA*oR*wWfoVV`Qou+%^WaTp3`K0N$z=Q<(U1~WAHAAFO@itF$gCJC^|A1Z
zAeOAwMGB?|eJ2qh6kql{{{$6ecoxe73o?U5+xD;_@oxqP>5Ps125+!ES9yqQD%~?c
z#fyg#+C~zhoJ5h-CydjWDo%>rRM7q_vR+k~B7ip?yr^_<lblDavoMWD7*-1j31|VN
ul(DD47eT@>8O#_XfAr={3=M3#5gbY4x{;9(q91pIgk8xL;X*)*qOgz}W+?{%

literal 0
HcmV?d00001

diff --git a/tests/testfile-vars-gcc-dwarf4-64.o.bz2 b/tests/testfile-vars-gcc-dwarf4-64.o.bz2
new file mode 100644
index 0000000000000000000000000000000000000000..26421644423ae556ae4b968cda93ceab1ffe0403
GIT binary patch
literal 691
zcmV;k0!;lvT4*^jL0KkKS??NpH2?y7|Mma>`u=X`_5087QiQ+n-{61%f(SrBNB{@`
zU<kkhBZ@U>8X`<1O*GR;#*;y#)EWR}$N&#WGy$VP%%(sZAb?LrJc;UP!~v(Npa3)g
z000Jn0MIxZ27qW98UQph8fXEgfM@^=h9CgYNRl*)V^a~6XhDJoMwv9hFq&vFG7N{L
zJxw&zCLqETt7qLv%NZCj{e{<g42m-zpAyhIP+!3kyhh-d+7Rk-9C}NFg{^E@Dr@RR
zE=6Pp%sAPglsZ(-N<ei~1O7r%!x>X%zS9iP$+u&N>ep_?RiT|+z^^DEfHw2pP=Oay
z_P4g!R8BH9B5f9M@TZMQ3dsl+XP)7tPQ(da&_#2(Ng)(8FFO)hO(Y9JhT9B%C>87F
z(}Y=baKPkZlNYU^U0FgCZHYDvX&Vdz7;7{h76=KRH>2H#;$KaIl^jnpBZhR=sK(H{
zf}LT873NF^W&=cD*n@G@HL&Y;oF>~P+k#J_qwOdUa|_nDIy{+02*|iW2*7uZA+QS<
zcoa~Snk-&b;)(^}XeT&`f*8hzDyfi+p2Pua)a0!(TrpQOBdPw>-<=>6O}dc7AWE*)
z1AM`qhOHYwR5k?LQy~^Hg>mcbB)Ninm%U%sD^Uj}xrH@b35JJXMKz{0vR)Ha6&GFO
z<XZ+50>c3EPzW6Y*goW9l0M&TJ}a^&B7Fa;6m_~%kZ(H0>OIh|wdxjRND81sEs{&i
zFd`+w*T_G{46UC!DSq4)8mb2c3WN;5A6irl6D+XaA!Ilf#i1=4V;aAtCi7lrGm^`W
zx?(`5gjo@FDp;IEvY|O{l;jj}K<IQ)L#hWN*E$r|H?a-kp#i-Me(5E^L6=a|sY>BU
ZORZ5&=^79M>i>U>xgwk>NOz4r8i1I<BFF#$

literal 0
HcmV?d00001

diff --git a/tests/testfile-vars-gcc-dwarf5-32.o.bz2 b/tests/testfile-vars-gcc-dwarf5-32.o.bz2
new file mode 100644
index 0000000000000000000000000000000000000000..cb1c7054bc0550859143fc823a4afb42fd3882eb
GIT binary patch
literal 728
zcmV;}0w?`KT4*^jL0KkKS(1lsV*mnv|Mvg?{r>j%|Nq<dG6KKv-{F8nBt#$q0RTWi
zU<|+lRd987u5i^)YHAv7Kxj2FG-xzv#*k<|Kp6u~0Aw%|L8eU@j2b42X^Ezqjiee4
z8UPw%0MGycXaE2J27uE=6!i}&kQxtA05k(Y13(!W000008Z^*IkrO1F(tz?tfuL!p
zs0JpCng9R*00y3;(G92zT!uptX*r}@h@lk2j0zXVXOc=(ic;4{+gjFqm|Z7~RhTS9
zl20BzSy*tIHd}gJ5#(i$bEma=9{*KbvPRK_2vXzj$&WFHIS?pE7HFrYPgw#J(qz>@
znptf=9c>5@n@TAq7B#g^fQg6J*=JY#WT^c!opE8;r<ZkcYX4AFq$JoQ9f;^OC7RMk
zv$oKN%(jCWmN~_8(8h_mu!lq4G<zD82SgeTJg7lSRkSWY-W4v9mNZJJTh@?CrBf6-
z;sld++5#Eah#PGe+RSMgFE{OT1bk(yg!vUW<Glh0goPOp825Jkj!SGMdX%wEU66yj
zHP~p=s)-bmh&PB^D^?Ao12IASI(+ve5dKo|kraO*Tub61WHGS?mm(ThoTJY<qi2%}
zOcJ4}Dp3@o0)U|+Pa5`8syiW3Xmhec2&{ckh<nXaNrCMas$>v4l(obu_{rxlS%a)o
zx)6_NNjfnRtg=idkUQp#&1*qwz?f-QrVVSRfUc5~T85y>1j}KAGX)?VR}cdVxDQ-8
zhke?B?#51ntD(D9%(e1PK>+znzyFNJj25PKpNCp>mcEKuk+E~j3{Slq&+a1sggg69
zfS6@lqEi_Y)gCa|DuO97<|!f?J_qP4j|I`*Mz91j;y_3ptaLv)@y5AO8;2@Vl7nDJ
zP!eMZ!LZp@skMky#ytQ_b8?xuQJ^oydT?MJfFwwe#*SF4(d(R2RD~fzsd1=(i@744
KC`d^|wy}V6)i!Sc

literal 0
HcmV?d00001

diff --git a/tests/testfile-vars-gcc-dwarf5-64.o.bz2 b/tests/testfile-vars-gcc-dwarf5-64.o.bz2
new file mode 100644
index 0000000000000000000000000000000000000000..e286f8f7519be11238a332cd5617b2b7cdd27e8d