I want to write a c++ program that can find the location of a global variable. Here is the relevant readelf
...
 <1><98>: Abbrev Number: 7 (DW_TAG_variable)
    <99>   DW_AT_name        : (indirect string, offset: 0x32): sbox_bit
    <9d>   DW_AT_decl_file   : 1
    <9e>   DW_AT_decl_line   : 3
    <9f>   DW_AT_type        : <0x81>
    <a3>   DW_AT_external    : 1
    <a3>   DW_AT_location    : 5 byte block: 3 e8 0 1 0     (DW_OP_addr: 100e8)
...
I already got the DIE that has the Tag "DW_TAG_variable" with the dwarf_diename "sbox_bit". It shouldn't be too hard to find the location of this variable from here but I can't figure it out.