Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/link: panic: machorelocsect: size mismatch #66993

Closed
luhring opened this issue Apr 23, 2024 · 17 comments
Closed

cmd/link: panic: machorelocsect: size mismatch #66993

luhring opened this issue Apr 23, 2024 · 17 comments
Assignees
Labels
arch-arm64 compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done. OS-Darwin
Milestone

Comments

@luhring
Copy link

luhring commented Apr 23, 2024

Go version

go version go1.22.2 darwin/arm64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='arm64'
GOBIN='/Users/dan/go/bin'
GOCACHE='/Users/dan/Library/Caches/go-build'
GOENV='/Users/dan/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/dan/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/dan/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/dan/homebrew/Cellar/go/1.22.2/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/dan/homebrew/Cellar/go/1.22.2/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.2'
GCCGO='gccgo'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/dev/null'
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/pz/h07rtjmd4mv4wpnr5st5q1480000gn/T/go-build3905791175=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

Using GoLand, which I understand to use delve under the hood (see GoLand ticket where someone else is hitting this same issue), I attempted to start a debug session for the Trivy project: https://github.com/aquasecurity/trivy, running the program at ./cmd/trivy.

I'm able to reproduce this without GoLand, too, via:

dlv debug ./cmd/trivy/main.go

I'm running on macOS 14.4.1, on an M1 processor.

cc: @knqyf263 in case this interests you!

What did you see happen?

$ dlv debug ./cmd/trivy/main.go
 # command-line-arguments
runtime.textsectionmap: reloc 1 (R_ADDR) to non-macho symbol runtime.text.1 type=1 (STEXT)
runtime.textsectionmap: unsupported obj reloc 1 (R_ADDR)/8 to runtime.text.1
panic: machorelocsect: size mismatch

goroutine 3363 [running]:
cmd/link/internal/ld.machorelocsect(0x14000118000, 0x14000dfee00, 0x1401935b9e0, {0x140227d0000?, 0x14000000002e9bed?, 0x102d54800?})
        cmd/link/internal/ld/macho.go:1256 +0x214
cmd/link/internal/ld.relocSectFn.func1.1()
        cmd/link/internal/ld/asmb.go:203 +0x4c
created by cmd/link/internal/ld.relocSectFn.func1 in goroutine 1
        cmd/link/internal/ld/asmb.go:202 +0x1e4
exit status 1

(Note: I also had to temporarily adjust Trivy's go.mod to use toolchain go1.22.2 so it matched my installed toolchain.)

What did you expect to see?

I expected to be able to start a debugging session successfully, via either dlv or GoLand.

(I can't reproduce this issue using go1.21.9, FWIW.)

@knqyf263
Copy link

knqyf263 commented Apr 23, 2024

@luhring Thanks for raising!

We've also faced the same issue and looked into it. It's even easier to reproduce it.

$ git clone --depth=1 git@github.com:aquasecurity/trivy.git 
$ cd trivy
$ go build -gcflags "all=-N -l" github.com/aquasecurity/trivy/cmd/trivy
# github.com/aquasecurity/trivy/cmd/trivy
runtime.textsectionmap: reloc 1 (R_ADDR) to non-macho symbol runtime.text.1 type=1 (STEXT)
runtime.textsectionmap: unsupported obj reloc 1 (R_ADDR)/8 to runtime.text.1
panic: machorelocsect: size mismatch

goroutine 3226 [running]:
cmd/link/internal/ld.machorelocsect(0x14000118000, 0x14001046700, 0x1401700b140, {0x1402a95c000?, 0x0?, 0x1030007a0?})
        /opt/homebrew/Cellar/go/1.22.1/libexec/src/cmd/link/internal/ld/macho.go:1256 +0x20c
cmd/link/internal/ld.relocSectFn.func1.1()
        /opt/homebrew/Cellar/go/1.22.1/libexec/src/cmd/link/internal/ld/asmb.go:203 +0x4c
created by cmd/link/internal/ld.relocSectFn.func1 in goroutine 1
        /opt/homebrew/Cellar/go/1.22.1/libexec/src/cmd/link/internal/ld/asmb.go:202 +0x1e4

We tried Go 1.22.0, 1.22.1, and 1.22.2, but the same error occurred with all of them. However, CGO_ENABLED=0 works around it.

CGO_ENABLED=0 go build -gcflags "all=-N -l" github.com/aquasecurity/trivy/cmd/trivy

We were trying to create a small project to replicate this problem, but it was taking a while.

@luhring
Copy link
Author

luhring commented Apr 23, 2024

Awesome, thanks for the added context! 🙌

@joedian joedian added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 23, 2024
@whhe
Copy link

whhe commented Apr 24, 2024

I met the same error when building bytebase by running sh scripts/build_bytebase.sh with CGO_ENABLED=1.

Step 2 - building Bytebase backend...
# command-line-arguments
runtime.textsectionmap: reloc 1 (R_ADDR) to non-macho symbol runtime.text.1 type=1 (STEXT)
runtime.textsectionmap: unsupported obj reloc 1 (R_ADDR)/8 to runtime.text.1
panic: machorelocsect: size mismatch

goroutine 205 [running]:
cmd/link/internal/ld.machorelocsect(0x14000114000, 0x140063ae7e0, 0x1400006c480, {0x14024dd8000?, 0x110000000058630c?, 0x1045d47a0?})
        /opt/homebrew/Cellar/go/1.22.2/libexec/src/cmd/link/internal/ld/macho.go:1256 +0x214
cmd/link/internal/ld.relocSectFn.func1.1()
        /opt/homebrew/Cellar/go/1.22.2/libexec/src/cmd/link/internal/ld/asmb.go:203 +0x4c
created by cmd/link/internal/ld.relocSectFn.func1 in goroutine 1
        /opt/homebrew/Cellar/go/1.22.2/libexec/src/cmd/link/internal/ld/asmb.go:202 +0x1e4

@FunTimeCoding
Copy link

In one of my projects, I was able to narrow down this error happening as soon as I use https://github.com/aws/aws-sdk-go-v2 in go 1.22+.

My workarounds are to exclude the library and all its usages via build flag, or to run the program in a container, which is obviously in Linux VM.

I also investigated for a while and thought maybe I have some old linked library somewhere.

Thank you for creating this issue.

@d-bytebase
Copy link

@randall77 would you help take a look? Thanks!

@randall77
Copy link
Contributor

@cherrymui This looks like a linker issue. That failing check is off by 8.

@cherrymui cherrymui changed the title cmd/link/internal/ld.machorelocsect: panic: machorelocsect: size mismatch cmd/link: panic: machorelocsect: size mismatch May 17, 2024
@cherrymui cherrymui self-assigned this May 17, 2024
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label May 17, 2024
@cherrymui
Copy link
Member

cherrymui commented May 17, 2024

Thanks for reporting. The direct problem is runtime.textsectionmap: reloc 1 (R_ADDR) to non-macho symbol runtime.text.1 type=1 (STEXT), that is, an (8-byte) relocation failed to apply, which causes a size mismatch by 8. The underlying issue is that the text-section-split code path doesn't interact well with the plugin-enabled code path. If the code doesn't (transitively) import the plugin package, it would work fine, but it does. I'll work on a fix.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/586555 mentions this issue: cmd/link: add runtime.text.N symbols to macho symbol table in dynlink mode

@d-bytebase
Copy link

Thanks for reporting. The direct problem is runtime.textsectionmap: reloc 1 (R_ADDR) to non-macho symbol runtime.text.1 type=1 (STEXT), that is, an (8-byte) relocation failed to apply, which causes a size mismatch by 8. The underlying issue is that the text-section-split code path doesn't interact well with the plugin-enabled code path. If the code doesn't (transitively) import the plugin package, it would work fine, but it does. I'll work on a fix.

Wish I could still send Kudos for your help. Thank you!

@d-bytebase
Copy link

Also curious why it happens to Darwin/arm64 only?

@cherrymui
Copy link
Member

Also curious why it happens to Darwin/arm64 only?

Because on ARM64 the C linker has a section size limit, so we need to split text sections. There is no such limit on AMD64. As for other OSes, the ELF linking is just different from Mach-O linking.

@d-bytebase
Copy link

d-bytebase commented May 20, 2024

Hi @cherrymui, we also found the regression in 1.22 that go build with -gcflags="all=-N -l" will fail with the following error. Hope you could shed some light on it as well. Thanks!

/Users/danny/tools/go/pkg/tool/darwin_arm64/link: running clang failed: exit status 1
/usr/bin/clang -arch arm64 -Wl,-headerpad,1144 -o $WORK/b001/exe/a.out -Qunused-arguments /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/go.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000000.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000001.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000002.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000003.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000004.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000005.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000006.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000007.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000008.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000009.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000010.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000011.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000012.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000013.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000014.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000015.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000016.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000017.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000018.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000019.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000020.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000021.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000022.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000023.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000024.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000025.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000026.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000027.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000028.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000029.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000030.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000031.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000032.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000033.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000034.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000035.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000036.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000037.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000038.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000039.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000040.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000041.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000042.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000043.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000044.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000045.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000046.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000047.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000048.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000049.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000050.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000051.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000052.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000053.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000054.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000055.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000056.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000057.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000058.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000059.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000060.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000061.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000062.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000063.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000064.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000065.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000066.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000067.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000068.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000069.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000070.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000071.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000072.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000073.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000074.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000075.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000076.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000077.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000078.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000079.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000080.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000081.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000082.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000083.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000084.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000085.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000086.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000087.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000088.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000089.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000090.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000091.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000092.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000093.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000094.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000095.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000096.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000097.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000098.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000099.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000100.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000101.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000102.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000103.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000104.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000105.o /var/folders/2m/s9rrpxps5rl00_wnvy3b2jd40000gn/T/go-link-1123638505/000106.o -lresolv -O2 -g -O2 -g -framework CoreFoundation -framework Security -O2 -g -framework CoreFoundation -O2 -g -O2 -g -O2 -g -O2 -g -framework CoreFoundation -framework IOKit -O2 -g -O2 -g -framework CoreFoundation -framework IOKit
ld: B/BL out of range 170675772 (max +/-128MB) to ''
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@thanm
Copy link
Contributor

thanm commented May 20, 2024

@d-bytebase Based on the error message the problem you're reporting is not related to the one described here. Would you please open another issue? Thanks. Be sure to include details instructions on how to reproduce.

@d-bytebase
Copy link

@d-bytebase Based on the error message the problem you're reporting is not related to the one described here. Would you please open another issue? Thanks. Be sure to include details instructions on how to reproduce.

Thanks. I figured it out as it has nothing to do with golang but clang, simply put macos/arm64 is too bad. Golang's linker improvement is exactly solving this kinds of issue, and I found a way out.

@cherrymui
Copy link
Member

@gopherbot please backport this to Go 1.22. This causes build failures on darwin/arm64.

@gopherbot
Copy link
Contributor

Backport issue(s) opened: #67527 (for 1.22).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/586081 mentions this issue: [release-branch.go1.22] cmd/link: add runtime.text.N symbols to macho symbol table in dynlink mode

@dmitshur dmitshur added this to the Go1.23 milestone May 22, 2024
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. OS-Darwin arch-arm64 and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels May 22, 2024
gopherbot pushed a commit that referenced this issue May 24, 2024
… symbol table in dynlink mode

In dynamic linking mode (e.g. when using plugins) on darwin, the
marker symbols runtime.text and runtime.etext are added to Textp
in an early stage, so when adding symbols to the symbol table we
don't need to explicitly add them. However, when splitting text
sections, the runtime.text.N marker symbols for the addtional
sections are not added to Textp. So we do need to add them
explicitly to the symbol table.

Updates #66993.
Fixes #67527.

Change-Id: Ic718d03cd71fc0bfb931cff82640b1f4c53b89be
Reviewed-on: https://go-review.googlesource.com/c/go/+/586555
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
(cherry picked from commit 9a9dd72)
Reviewed-on: https://go-review.googlesource.com/c/go/+/586081
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-arm64 compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done. OS-Darwin
Projects
None yet
Development

No branches or pull requests