mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cgo: handle versioned ELF symbols
Fixes #1397. R=iant CC=golang-dev https://golang.org/cl/4444064
This commit is contained in:
parent
70b0de8e98
commit
09092a78e6
14 changed files with 454 additions and 119 deletions
|
|
@ -20,7 +20,6 @@ import (
|
|||
"os"
|
||||
"reflect"
|
||||
"strings"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
// A Package collects information about the package we're going to write.
|
||||
|
|
@ -135,20 +134,7 @@ func main() {
|
|||
// instead of needing to make the linkers duplicate all the
|
||||
// specialized knowledge gcc has about where to look for imported
|
||||
// symbols and which ones to use.
|
||||
syms, imports := dynimport(*dynobj)
|
||||
if runtime.GOOS == "windows" {
|
||||
for _, sym := range syms {
|
||||
ss := strings.Split(sym, ":", -1)
|
||||
fmt.Printf("#pragma dynimport %s %s %q\n", ss[0], ss[0], strings.ToLower(ss[1]))
|
||||
}
|
||||
return
|
||||
}
|
||||
for _, sym := range syms {
|
||||
fmt.Printf("#pragma dynimport %s %s %q\n", sym, sym, "")
|
||||
}
|
||||
for _, p := range imports {
|
||||
fmt.Printf("#pragma dynimport %s %s %q\n", "_", "_", p)
|
||||
}
|
||||
dynimport(*dynobj)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue