1
0
mirror of https://github.com/golang/go synced 2024-11-18 04:04:49 -07:00

runtime, cmd/link: fix netbsd/arm EABI support

Fixes reported by oshimaya (see #13806).

Fixes #13806.

Change-Id: I9b659ab918a34bc5f7c58f3d7f59058115b7f776
Reviewed-on: https://go-review.googlesource.com/31651
Reviewed-by: Minux Ma <minux@golang.org>
This commit is contained in:
Russ Cox 2016-10-20 20:37:28 -04:00
parent 19adf8aeaa
commit 8419c85eaa
2 changed files with 10 additions and 6 deletions

View File

@ -945,11 +945,10 @@ func Elfinit(ctxt *Link) {
ehdr.phentsize = ELF64PHDRSIZE /* Must be ELF64PHDRSIZE */
ehdr.shentsize = ELF64SHDRSIZE /* Must be ELF64SHDRSIZE */
// we use EABI on both linux/arm and freebsd/arm.
// 32-bit architectures
case sys.ARM:
// we use EABI on both linux/arm and freebsd/arm.
if Headtype == obj.Hlinux || Headtype == obj.Hfreebsd {
// we use EABI on linux/arm, freebsd/arm, netbsd/arm.
if Headtype == obj.Hlinux || Headtype == obj.Hfreebsd || Headtype == obj.Hnetbsd {
// We set a value here that makes no indication of which
// float ABI the object uses, because this is information
// used by the dynamic linker to compare executables and

View File

@ -104,6 +104,7 @@ type stackt struct {
type timespec struct {
tv_sec int64
tv_nsec int32
_ [4]byte // EABI
}
func (ts *timespec) set_sec(x int32) {
@ -117,6 +118,7 @@ func (ts *timespec) set_nsec(x int32) {
type timeval struct {
tv_sec int64
tv_usec int32
_ [4]byte // EABI
}
func (tv *timeval) set_usec(x int32) {
@ -129,10 +131,11 @@ type itimerval struct {
}
type mcontextt struct {
__gregs [17]uint32
__fpu [4 + 8*32 + 4]byte // EABI
// __fpu [4+4*33+4]byte // not EABI
__gregs [17]uint32
_ [4]byte // EABI
__fpu [272]byte // EABI
_mc_tlsbase uint32
_ [4]byte // EABI
}
type ucontextt struct {
@ -140,6 +143,7 @@ type ucontextt struct {
uc_link *ucontextt
uc_sigmask sigset
uc_stack stackt
_ [4]byte // EABI
uc_mcontext mcontextt
__uc_pad [2]int32
}
@ -151,6 +155,7 @@ type keventt struct {
fflags uint32
data int64
udata *byte
_ [4]byte // EABI
}
// created by cgo -cdefs and then converted to Go