aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/syscall_linux_test.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-11-08 11:57:42 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-12-22 20:00:00 +0000
commitc9fb4eb0a22131cc9922fa96afba01d4e21d4fd4 (patch)
treec9860a302fa6284452a5330b72a73191c0a2ae39 /src/syscall/syscall_linux_test.go
parentc06a354bccf60ea32ed74238be409a00aac292c5 (diff)
downloadgo-c9fb4eb0a22131cc9922fa96afba01d4e21d4fd4.tar.xz
cmd/link: handle grouped resource sections
The Go PE linker does not support enough generalized PE logic to properly handle .rsrc sections gracefully. Instead a few things are special cased for these. The linker also does not support PE's "grouped sections" features, in which input objects have several named sections that are sorted, merged, and renamed in the output file. In the past, more sophisticated support for resources or for PE features like grouped sections have not been necessary, as Go's own object formats are pretty vanilla, and GNU binutils also produces pretty vanilla objects where all sections are already merged. However, GNU binutils is lagging with arm support, and here LLVM has picked up the slack. In particular, LLVM has its own rc/cvtres combo, which are glued together in mingw LLVM distributions as windres, a command line compatible tool with binutils' windres, which supports arm and arm64. But there's a key difference between binutils' windres and LLVM's windres: the LLVM one uses proper grouped sections. So, this commit adds grouped sections support for resource sections to the linker. We don't attempt to plumb generic support for grouped sections, just as there isn't generic support already for what resources require. Instead we augment the resource handling logic to deal with standard two-section resource objects. We also add a test for this, akin to the current test for more vanilla binutils resource objects, and make sure that the rsrc tests are always performed. Fixes #42866. Fixes #43182. Change-Id: I059450021405cdf2ef1c195ddbab3960764ad711 Reviewed-on: https://go-review.googlesource.com/c/go/+/268337 Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Trust: Alex Brainman <alex.brainman@gmail.com> Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/syscall/syscall_linux_test.go')
0 files changed, 0 insertions, 0 deletions