]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
debug/dwarf: formStrp uses a 64-bit value for 64-bit DWARF
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 11 Jan 2018 01:51:16 +0000 (01:51 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 11 Jan 2018 01:51:16 +0000 (01:51 +0000)
    No test as the only system I know that uses 64-bit DWARF is AIX.

    Backport of https://golang.org/cl/84379, which will be in Go 1.11.
    Backporting now for AIX support in gccgo.

    Reviewed-on: https://go-review.googlesource.com/87296

From-SVN: r256474

gcc/go/gofrontend/MERGE
libgo/go/debug/dwarf/entry.go

index 7abc2136aa6518a6eabf6675959d66dfd1157693..2e8a9928dc109316a81570d1205fd3fcd0009fb3 100644 (file)
@@ -1,4 +1,4 @@
-19d94969c5202c07b3b166079b9f4ebbb52dfa6b
+1176dd2b53f2d2b826b599a126f3f9828283cec3
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index ffa61c28d15b4f55f0cc3bfab9e514a1e54d946d..6be0700b7ef11452e58f69e3eec81ad56407efa6 100644 (file)
@@ -461,7 +461,18 @@ func (b *buf) entry(atab abbrevTable, ubase Offset) *Entry {
                case formString:
                        val = b.string()
                case formStrp:
-                       off := b.uint32() // offset into .debug_str
+                       var off uint64 // offset into .debug_str
+                       is64, known := b.format.dwarf64()
+                       if !known {
+                               b.error("unknown size for DW_FORM_strp")
+                       } else if is64 {
+                               off = b.uint64()
+                       } else {
+                               off = uint64(b.uint32())
+                       }
+                       if uint64(int(off)) != off {
+                               b.error("DW_FORM_strp offset out of range")
+                       }
                        if b.err != nil {
                                return nil
                        }