diff options
| -rw-r--r-- | src/cmd/link/internal/ld/data.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go index 05c6da3e3b..e161a0a291 100644 --- a/src/cmd/link/internal/ld/data.go +++ b/src/cmd/link/internal/ld/data.go @@ -84,6 +84,9 @@ func maxSizeTrampolines(ctxt *Link, ldr *loader.Loader, s loader.Sym, isTramp bo } } + if ctxt.IsARM() { + return n * 20 // Trampolines in ARM range from 3 to 5 instructions. + } if ctxt.IsPPC64() { return n * 16 // Trampolines in PPC64 are 4 instructions. } @@ -2533,7 +2536,7 @@ func assignAddress(ctxt *Link, sect *sym.Section, n int, s loader.Sym, va uint64 // // The same applies to Darwin/ARM64, with 2^27 byte threshold. func splitTextSections(ctxt *Link) bool { - return (ctxt.IsPPC64() || (ctxt.IsARM64() && ctxt.IsDarwin())) && ctxt.IsExternal() + return (ctxt.IsARM() || ctxt.IsPPC64() || (ctxt.IsARM64() && ctxt.IsDarwin())) && ctxt.IsExternal() } // On Wasm, we reserve 4096 bytes for zero page, then 8192 bytes for wasm_exec.js |
