]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
dwarf.exp: In 64-bit units, emit also abbrev offset as a 64-bit field
authorPetr Machata <pmachata@redhat.com>
Mon, 17 Nov 2014 00:31:47 +0000 (08:31 +0800)
committerYao Qi <yao@codesourcery.com>
Mon, 17 Nov 2014 00:31:47 +0000 (08:31 +0800)
Dwarf::tu and Dwarf::cu allow selection of units with 64-bit offsets
through an option.  When selected, unit size is encoded properly, but
offset to abbreviation unit is still encoded in a 4-byte field.  This
patch fixes the problem.

Reproducer:

Dwarf::assemble "blah.s" {
    tu {is_64 1 version 4 addr_size 8} 0x1122334455667788 the_type {
type_unit {} { the_type: }
    }

    cu {is_64 1 version 4 addr_size 8} {
compile_unit {{language @DW_LANG_C}} {}
    }
}

gdb/testsuite:

* lib/dwarf.exp  (Dwarf::cu, Dwarf::tu): Emit
${_cu_offset_size} bytes abbrev offset.

gdb/testsuite/ChangeLog
gdb/testsuite/lib/dwarf.exp

index 65687c011b765bf0dd22cfeaa8ddfc18f3dd0da9..2a027d5c132068175b68f1e70a950357c3e37a3e 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-17  Petr Machata  <pmachata@redhat.com>
+
+       * lib/dwarf.exp  (Dwarf::cu, Dwarf::tu): Emit
+       ${_cu_offset_size} bytes abbrev offset.
+
 2014-11-15  Doug Evans  <xdje42@gmail.com>
 
        PR symtab/17559
index cadda3e81f9ba5557a59ae6c9853b4cd686894d7..778ad1cf797046b4d35068c94d515921666f550a 100644 (file)
@@ -954,7 +954,7 @@ namespace eval Dwarf {
        }
        define_label $start_label
        _op .2byte $_cu_version Version
-       _op .4byte $my_abbrevs Abbrevs
+       _op .${_cu_offset_size}byte $my_abbrevs Abbrevs
        _op .byte $_cu_addr_size "Pointer size"
 
        _defer_output $_abbrev_section {
@@ -1047,7 +1047,7 @@ namespace eval Dwarf {
        }
        define_label $start_label
        _op .2byte $_cu_version Version
-       _op .4byte $my_abbrevs Abbrevs
+       _op .${_cu_offset_size}byte $my_abbrevs Abbrevs
        _op .byte $_cu_addr_size "Pointer size"
        _op .8byte $signature Signature
        if { $type_label != "" } {