aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link/internal/ld/macho.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/link/internal/ld/macho.go')
-rw-r--r--src/cmd/link/internal/ld/macho.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cmd/link/internal/ld/macho.go b/src/cmd/link/internal/ld/macho.go
index 1c7f3a0d82..cf3fba1eee 100644
--- a/src/cmd/link/internal/ld/macho.go
+++ b/src/cmd/link/internal/ld/macho.go
@@ -356,8 +356,9 @@ func machoshbits(mseg *MachoSeg, sect *Section, segname string) {
buf := "__" + strings.Replace(sect.Name[1:], ".", "_", -1)
var msect *MachoSect
- if sect.Rwx&1 == 0 && (Thearch.Thechar == '7' || (Thearch.Thechar == '6' && Buildmode == BuildmodeCShared)) {
- // Darwin external linker on arm64 and on amd64 in c-shared buildmode
+ if sect.Rwx&1 == 0 && (Thearch.Thechar == '7' || // arm64
+ (Thearch.Thechar == '6' && (Buildmode == BuildmodeCShared || Buildmode == BuildmodeCArchive))) { // amd64
+ // Darwin external linker on arm64 and on amd64 in c-shared/c-archive buildmode
// complains about absolute relocs in __TEXT, so if the section is not
// executable, put it in __DATA segment.
msect = newMachoSect(mseg, buf, "__DATA")