Repository: go
Issue: cmd/link: ld: B/BL out of range -134840372 (max +/-128MB) from 0x10809F954
Labels: OS-Darwin,NeedsInvestigation,compiler/runtime

### Go version

1.22.4

### Output of `go env` in your module/workspace:

```shell
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/danny/Library/Caches/go-build'
GOENV='/Users/danny/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/danny/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/danny/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.22.4/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.22.4/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.4'
GCCGO='gccgo'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/Users/danny/src/bytebase/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-build3442076162=/tmp/go-build -gno-record-gcc-switches -fno-common'
```


### What did you do?

https://github.com/bytebase/bytebase

build command: CGO_ENABLED=1 go build -o ./.air/bytebase ./backend/bin/server/main.go

### What did you see happen?

/opt/homebrew/Cellar/go/1.22.4/libexec/pkg/tool/darwin_arm64/link: running cc failed: exit status 1
ld: warning: -bind_at_load is deprecated on macOS
ld: B/BL out of range -134840372 (max +/-128MB) from 0x10809F954 ('_runtime.cmpstring.island' from 'branch-islands-file') to 0x100007920 ('_runtime.cmpstring' from '/private/var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1336181017/go.o')
final section layout:
    __PAGEZERO           addr=0x00000000, size=0x100000000, fileOffset=0x00000000
    __TEXT               addr=0x100000000, size=0x11640000, fileOffset=0x00000000
        __text           addr=0x100002ff0, size=0x082b982c, fileOffset=0x00002ff0
        __stubs          addr=0x1082bc81c, size=0x00000810, fileOffset=0x082bc81c
        __rodata         addr=0x1082bd040, size=0x0929ddf0, fileOffset=0x082bd040
        __cstring        addr=0x11155ae30, size=0x000363a7, fileOffset=0x1155ae30
        __const          addr=0x111591200, size=0x000a71b8, fileOffset=0x11591200
        __unwind_info    addr=0x1116383b8, size=0x00003d40, fileOffset=0x116383b8
        __eh_frame       addr=0x11163c0f8, size=0x000000b8, fileOffset=0x1163c0f8
    __DATA_CONST         addr=0x111640000, size=0x0f640000, fileOffset=0x11640000
        __got            addr=0x111640000, size=0x00000948, fileOffset=0x11640000
        __const          addr=0x111640948, size=0x00039678, fileOffset=0x11640948
        __cfstring       addr=0x111679fc0, size=0x000000e0, fileOffset=0x11679fc0
        __rodata         addr=0x11167a0a0, size=0x027eb4d0, fileOffset=0x1167a0a0
        __typelink       addr=0x113e65580, size=0x00050d44, fileOffset=0x13e65580
        __itablink       addr=0x113eb62e0, size=0x0003a7c8, fileOffset=0x13eb62e0
        __gopclntab      addr=0x113ef0ac0, size=0x0cd8c250, fileOffset=0x13ef0ac0
    __DATA               addr=0x120c80000, size=0x011f8000, fileOffset=0x20c80000
        __data           addr=0x120c80000, size=0x006ad908, fileOffset=0x20c80000
        __go_buildinfo   addr=0x12132d910, size=0x000069c0, fileOffset=0x2132d910
        __noptrdata      addr=0x1213342e0, size=0x009145c0, fileOffset=0x213342e0
        __thread_vars    addr=0x121c488a0, size=0x00000630, fileOffset=0x21c488a0
        __thread_ptrs    addr=0x121c48ed0, size=0x00000138, fileOffset=0x21c48ed0
        __thread_data    addr=0x121c49008, size=0x00000108, fileOffset=0x21c49008
        __thread_bss     addr=0x121c49110, size=0x00000618, fileOffset=0x21c49110
        __bss            addr=0x121c49740, size=0x0020c74c, fileOffset=0x00000000
        __noptrbss       addr=0x121e55ea0, size=0x000201b0, fileOffset=0x00000000
        __common         addr=0x121e76050, size=0x00000070, fileOffset=0x00000000
    __LINKEDIT           addr=0x121e78000, size=0x0db24000, fileOffset=0x21c4c000
clang: error: linker command failed with exit code 1 (use -v to see invocation)

### What did you expect to see?

build success. I think this is MacOS only issue related to linker and starting since 1.22.

related issue: https://github.com/golang/go/issues/66993