summaryrefslogtreecommitdiff
path: root/src/cmd/cgo/main.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-12-17 09:51:55 -0800
committerRuss Cox <rsc@golang.org>2010-12-17 09:51:55 -0800
commit3357866fb9e2965a11c453dbd21013df0a1c893f (patch)
treed9654101bcb93f01411fbb571cdaa4f6b3e7f191 /src/cmd/cgo/main.go
parentdd717d23cdc29352ad5042f8f7090978b7df0d1a (diff)
downloadgo-3357866fb9e2965a11c453dbd21013df0a1c893f.tar.gz
misc/cgo/life: fix, add to build
#pragma dynexport is no longer needed for this use of cgo, since the gcc and gc code are now linked together into the same binary. It may still be necessary later. On the Mac, you cannot use the GOT to resolve symbols that exist in the current binary, so 6l and 8l translate the GOT-loading mov instructions into lea instructions. On ELF systems, we could use the GOT for those symbols, but for consistency 6l and 8l apply the same translation. The translation is sketchy in the extreme (depending on the relocation being in a mov instruction) but it verifies that the instruction is a mov before rewriting it to lea. Also makes typedefs global across files. Fixes issue 1335. Fixes issue 1345. R=iant, r CC=golang-dev http://codereview.appspot.com/3650042
Diffstat (limited to 'src/cmd/cgo/main.go')
-rw-r--r--src/cmd/cgo/main.go12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/cmd/cgo/main.go b/src/cmd/cgo/main.go
index c50ecfb05..942bda5f4 100644
--- a/src/cmd/cgo/main.go
+++ b/src/cmd/cgo/main.go
@@ -232,18 +232,6 @@ func (p *Package) Record(f *File) {
error(token.NoPos, "inconsistent package names: %s, %s", p.PackageName, f.Package)
}
- if p.Typedef == nil {
- p.Typedef = f.Typedef
- } else {
- for k, v := range f.Typedef {
- if p.Typedef[k] == nil {
- p.Typedef[k] = v
- } else if !reflect.DeepEqual(p.Typedef[k], v) {
- error(token.NoPos, "inconsistent definitions for C type %s", k)
- }
- }
- }
-
if p.Name == nil {
p.Name = f.Name
} else {