We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 135572e commit 3c8d6afCopy full SHA for 3c8d6af
src/cmd/link/internal/ld/lib.go
@@ -1117,6 +1117,18 @@ func hostlink() {
1117
// because lazy PLT resolution can use large amounts of stack at
1118
// times we cannot allow it to do so.
1119
argv = append(argv, "-Wl,-znow")
1120
+
1121
+ // Do not let the host linker generate COPY relocations. These
1122
+ // can move symbols out of sections that rely on stable offsets
1123
+ // from the beginning of the section (like STYPE).
1124
+ argv = append(argv, "-Wl,-znocopyreloc")
1125
1126
+ if SysArch.Family == sys.ARM {
1127
+ // The GNU linker will generate COPY relocations on ARM
1128
+ // even with -znocopyreloc set. Switch to gold.
1129
+ // https://sourceware.org/bugzilla/show_bug.cgi?id=19962
1130
+ argv = append(argv, "-fuse-ld=gold")
1131
+ }
1132
}
1133
1134
if Iself && len(buildinfo) > 0 {
0 commit comments