-
Notifications
You must be signed in to change notification settings - Fork 17.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/link: type symbol name mangling for plugins
Moves type symbol name mangling out of the object reader and into a separate pass. Requires some care, as changing the name of a type may require dealing with duplicate symbols for the first time. Disables DWARF for both plugins and programs that use plugin.Open, because type manging is currently incompatible with the go.info.* symbol generator in cmd/link. (It relies on the symbol names to find type information.) A future fix for this would be moving the go.info.* generation into the compiler, with the logic we use for generating the type.* symbols. Fixes #19529 Change-Id: I75615f8bdda86ff9e767e536d9aa36e15c194098 Reviewed-on: https://go-review.googlesource.com/67312 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
- Loading branch information
Showing
5 changed files
with
101 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package main | ||
|
||
import ( | ||
"reflect" | ||
) | ||
|
||
type Foo struct { | ||
Bar string `json:"Bar@baz,omitempty"` | ||
} | ||
|
||
func F() { | ||
println(reflect.TypeOf(Foo{}).Field(0).Tag) | ||
} | ||
|
||
func main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters