cmd/link: place Darwin bind entries on the __DATA_CONST segment #71416
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FixPending
Issues that have a fix which has not yet been reviewed or submitted.
Implementation
Issues describing a semantics-preserving change to the Go implementation.
Milestone
#38830 moved the .rodata, .typelink, .itablink, and .gopclntab sections to the __DATA_CONST segment. Looks like the .got section can also go into that new segment. It is currently passed in the __DATA segment.
You can verify that the macOS clang linker already does what I'm suggesting here by following these steps:
go build -ldflags=linkmode=external -o ext
objdump --macho --bind ./ext
The result is something like this:
While the same binary built with the Go internal linker has the following bind table:
Also note that clang names the.got section as
__got
on ARM, while we use__nl_symbol_ptr
uncoditionally. Don't know if this makes any real difference, but clang made that change consciously in this commit: https://cgit.geodns-americas.gentoo.org/fork/llvm-project.git/commit/?h=release/3.8.x&id=e8d9df4ea52a5652a13f080614507d70e9f9ad79.Go version:
Clang version:
@golang/compiler @golang/darwin
The text was updated successfully, but these errors were encountered: