]> Cypherpunks repositories - gostls13.git/commit
debug/macho: support reading imported symbols without LC_DYSYMTAB
authorCherry Mui <cherryyz@google.com>
Mon, 4 Aug 2025 14:30:26 +0000 (10:30 -0400)
committerCherry Mui <cherryyz@google.com>
Wed, 6 Aug 2025 19:28:05 +0000 (12:28 -0700)
commit2747f925dd1f08f9b9a1ef23170ee601519d70c2
treeff86a3b5b243b0b27f0cd22d5a77770f52e2ea26
parent025d36917c8f56baede2f477131bbf08bf1382ca
debug/macho: support reading imported symbols without LC_DYSYMTAB

Currently, the ImportedSymbols method requires an LC_DYSYMTAB load
command to exist. However, a Mach-O object file may not have an
LC_DYSYMTAB load command, e.g. the one produced by "ld -r".
Support this case by just reading the symbol table and gathers
undefined symbols.

Updates #61229.

Change-Id: I8b4761ac7d99e1f1f378e883e9be75ee4049ffbb
Reviewed-on: https://go-review.googlesource.com/c/go/+/692995
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
src/debug/macho/file.go
src/debug/macho/file_test.go
src/debug/macho/testdata/clang-amd64-darwin-ld-r.obj.base64 [new file with mode: 0644]