]> Cypherpunks repositories - gostls13.git/commitdiff
runtime, cmd/link: fix netbsd/arm EABI support
authorRuss Cox <rsc@golang.org>
Fri, 21 Oct 2016 00:37:28 +0000 (20:37 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 24 Oct 2016 15:23:13 +0000 (15:23 +0000)
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>
src/cmd/link/internal/ld/elf.go
src/runtime/defs1_netbsd_arm.go

index 636900e6ebabc83bf28ae53add75cd0e89a4e589..c331944ecbc80003eb72bef41eb8fe7ba4e5ef67 100644 (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
index a67dd8ac95f60b5d988f70134e95049b9af55c7d..db8e4c63fc77d4d9a5ea522f00a5e7aca7d65a9d 100644 (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