]> Cypherpunks repositories - gostls13.git/commit
cmd/link: set the ELF headers of ARM executables that use cgo correctly
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Wed, 23 Sep 2015 03:46:00 +0000 (15:46 +1200)
committerMichael Hudson-Doyle <michael.hudson@canonical.com>
Tue, 6 Oct 2015 07:05:51 +0000 (07:05 +0000)
commit3e6334e2e059505aa3ebd16185b03f7a9cc88d23
treeaf166bf1babf95308e4ef939daf451639c3f3503
parent007ee631d6e0fa27973fd9f40f8fbae98547181a
cmd/link: set the ELF headers of ARM executables that use cgo correctly

It is generally expected that the ELF flags of a dynamically linked executable
and the libraries it links against match. Go's linker currently always produces
executables with flags that do not declare a float abi (hard, soft) at all, but
when cgo is involved it is unlikely that this matches the system libraries
being linked against -- really the decision about ABI is made by the C compiler
during the invocation of cgo.

This change is basically a port of the code from binutils that parses the
".ARM.attributes" section to check for the tag that declares that the code is
built for the hard-float ABI.

Fixes #7094

Change-Id: I737c8f3b5ed4af545cfc3e86722d03eb83083402
Reviewed-on: https://go-review.googlesource.com/14860
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
src/cmd/link/internal/ld/elf.go
src/cmd/link/internal/ld/ldelf.go