[dev.link] cmd/link: set cgo attributes early when internal cgo linking
In newobj mode, cgo attributes are typically set later, as we create sym.Symbols later. But when internal cgo linking, the host object loaders still work with sym.Symbols, and the cgo attributes need to be set for them to work properly. Therefore, set them early. This will cause creating some Symbols eagerly, but they are mostly host object symbols and will need to be created anyway. Now all cgo internal linking tests pass on ELF systems. Change-Id: I023a4df4429acc8ebf5e185f62e6809198497a78 Reviewed-on: https://go-review.googlesource.com/c/go/+/204857Reviewed-by: Than McIntosh <thanm@google.com>
Showing
Please register or sign in to comment