mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: enable DWARF combining on macOS ARM64
It appears the machoCalcStart function is meant to align the segment, but it doesn't. Replace it with an actual alignment calculation. Also, use the alignment from the configuration, instead of hardcode. With this fix we could enable DWARF combining on macOS ARM64. Change-Id: I19ec771b77d752b83a54c53b6ee65af78a31b8ae Reviewed-on: https://go-review.googlesource.com/c/go/+/253558 Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
parent
a52a5d8a43
commit
1e6ad65b43
3 changed files with 5 additions and 18 deletions
|
|
@ -1240,11 +1240,11 @@ func (ctxt *Link) hostlink() {
|
|||
|
||||
// On darwin, whether to combine DWARF into executable.
|
||||
// Only macOS supports unmapped segments such as our __DWARF segment.
|
||||
combineDwarf := ctxt.IsDarwin() && !*FlagS && !*FlagW && !debug_s && machoPlatform == PLATFORM_MACOS && ctxt.IsAMD64()
|
||||
combineDwarf := ctxt.IsDarwin() && !*FlagS && !*FlagW && !debug_s && machoPlatform == PLATFORM_MACOS
|
||||
|
||||
switch ctxt.HeadType {
|
||||
case objabi.Hdarwin:
|
||||
if machoPlatform == PLATFORM_MACOS && ctxt.IsAMD64() {
|
||||
if combineDwarf {
|
||||
// Leave room for DWARF combining.
|
||||
// -headerpad is incompatible with -fembed-bitcode.
|
||||
argv = append(argv, "-Wl,-headerpad,1144")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue