diff --git a/src/cmd/link/internal/arm64/obj.go b/src/cmd/link/internal/arm64/obj.go index b2f1e39e3be..c8d12f2aef1 100644 --- a/src/cmd/link/internal/arm64/obj.go +++ b/src/cmd/link/internal/arm64/obj.go @@ -80,7 +80,7 @@ func archinit(ctxt *ld.Link) { ld.HEADR = 32 if *ld.FlagTextAddr == -1 { - *ld.FlagTextAddr = 4128 + *ld.FlagTextAddr = 4096 + int64(ld.HEADR) } if *ld.FlagDataAddr == -1 { *ld.FlagDataAddr = 0 diff --git a/src/cmd/link/internal/x86/obj.go b/src/cmd/link/internal/x86/obj.go index fe43615f16f..f35114f3b2e 100644 --- a/src/cmd/link/internal/x86/obj.go +++ b/src/cmd/link/internal/x86/obj.go @@ -79,7 +79,7 @@ func archinit(ctxt *ld.Link) { ld.HEADR = 32 if *ld.FlagTextAddr == -1 { - *ld.FlagTextAddr = 4096 + 32 + *ld.FlagTextAddr = 4096 + int64(ld.HEADR) } if *ld.FlagDataAddr == -1 { *ld.FlagDataAddr = 0