| 1 |
// Copyright 2018 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
package wasm |
| 6 |
|
| 7 |
import ( |
| 8 |
"cmd/internal/sys" |
| 9 |
"cmd/link/internal/ld" |
| 10 |
) |
| 11 |
|
| 12 |
func Init() (*sys.Arch, ld.Arch) { |
| 13 |
theArch := ld.Arch{ |
| 14 |
Funcalign: 16, |
| 15 |
Maxalign: 32, |
| 16 |
Minalign: 1, |
| 17 |
|
| 18 |
Archinit: archinit, |
| 19 |
AssignAddress: assignAddress, |
| 20 |
Asmb: asmb, |
| 21 |
Asmb2: asmb2, |
| 22 |
Gentext: gentext, |
| 23 |
} |
| 24 |
|
| 25 |
return sys.ArchWasm, theArch |
| 26 |
} |
| 27 |
|
| 28 |
func archinit(ctxt *ld.Link) { |
| 29 |
if *ld.FlagRound == -1 { |
| 30 |
*ld.FlagRound = 4096 |
| 31 |
} |
| 32 |
if *ld.FlagTextAddr == -1 { |
| 33 |
*ld.FlagTextAddr = 0 |
| 34 |
} |
| 35 |
} |