forked from openwrt/packages
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Includes fixes for: * CVE-2021-44716: unbounded growth of HTTP/2 header canonicalization cache * CVE-2021-44717: syscall.ForkExec can close file descriptor 0 Added patches: * 001-cmd-link-use-gold-on-ARM-ARM64-only-if-gold-is-available.patch: golang/go#49748 backported for Go 1.17, this removes the requirement for the gold linker when building Go programs that use Go plugins on arm/arm64 Signed-off-by: Jeffery To <jeffery.to@gmail.com> (cherry picked from commit 0ac57b1)
- Loading branch information
Showing
2 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
.../golang/golang/patches/001-cmd-link-use-gold-on-ARM-ARM64-only-if-gold-is-available.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
This is https://github.com/golang/go/pull/49748 backported for Go 1.17. | ||
|
||
--- a/src/cmd/link/internal/ld/lib.go | ||
+++ b/src/cmd/link/internal/ld/lib.go | ||
@@ -1388,23 +1388,18 @@ func (ctxt *Link) hostlink() { | ||
} | ||
|
||
if ctxt.Arch.InFamily(sys.ARM, sys.ARM64) && buildcfg.GOOS == "linux" { | ||
- // On ARM, the GNU linker will generate COPY relocations | ||
- // even with -znocopyreloc set. | ||
+ // On ARM, older versions of the GNU linker will generate | ||
+ // COPY relocations even with -znocopyreloc set. | ||
// https://sourceware.org/bugzilla/show_bug.cgi?id=19962 | ||
// | ||
- // On ARM64, the GNU linker will fail instead of | ||
- // generating COPY relocations. | ||
+ // On ARM64, older versions of the GNU linker will fail | ||
+ // instead of generating COPY relocations. | ||
// | ||
- // In both cases, switch to gold. | ||
- altLinker = "gold" | ||
- | ||
- // If gold is not installed, gcc will silently switch | ||
- // back to ld.bfd. So we parse the version information | ||
- // and provide a useful error if gold is missing. | ||
+ // In both cases, switch to gold if gold is available. | ||
cmd := exec.Command(*flagExtld, "-fuse-ld=gold", "-Wl,--version") | ||
if out, err := cmd.CombinedOutput(); err == nil { | ||
- if !bytes.Contains(out, []byte("GNU gold")) { | ||
- log.Fatalf("ARM external linker must be gold (issue #15696), but is not: %s", out) | ||
+ if bytes.Contains(out, []byte("GNU gold")) { | ||
+ altLinker = "gold" | ||
} | ||
} | ||
} |