Skip to content

Commit

Permalink
cmd/cgo: use 1 as last entry for __cgodebug_data
Browse files Browse the repository at this point in the history
        LLVM-based gcc will place all-zero data in a zero-filled
        section, but our debug/macho can't handle that.
        Fixes #3821.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6444049
  • Loading branch information
minux committed Jul 30, 2012
1 parent 7520f0b commit dd62bb4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cmd/cgo/gcc.go
Expand Up @@ -508,7 +508,12 @@ func (p *Package) loadDWARF(f *File, names []*Name) {
fmt.Fprintf(&b, "\t0,\n")
}
}
fmt.Fprintf(&b, "\t0\n")
// for the last entry, we can not use 0, otherwise
// in case all __cgodebug_data is zero initialized,
// LLVM-based gcc will place the it in the __DATA.__common
// zero-filled section (our debug/macho doesn't support
// this)
fmt.Fprintf(&b, "\t1\n")
fmt.Fprintf(&b, "};\n")

d, bo, debugData := p.gccDebug(b.Bytes())
Expand Down

0 comments on commit dd62bb4

Please sign in to comment.