1
0
mirror of https://github.com/golang/go synced 2024-11-14 05:50:27 -07:00
go/misc/cgo
Quim Muntal 82f9c6cac1 [release-branch.go1.15] cmd/link: avoid exporting all symbols on windows buildmode=pie
Marking one functions with __declspec(dllexport) forces mingw to
create .reloc section without having to export all symbols.

See https://insights.sei.cmu.edu/cert/2018/08/when-aslr-is-not-really-aslr---the-case-of-incorrect-assumptions-and-bad-defaults.html for more info.

This change cuts 73kb of a "hello world" pie binary.

Updates #6853.
Updates #40795.
Fixes #43592.

Change-Id: I3cc57c3b64f61187550bc8751dfa085f106c8475
Reviewed-on: https://go-review.googlesource.com/c/go/+/264459
Trust: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/300692
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2021-03-31 21:39:47 +00:00
..
errors [release-branch.go1.15-security] cmd/go, cmd/cgo: don't let bogus symbol set cgo_ldflag 2020-11-11 23:35:14 +00:00
fortran misc/cgo/fortran: avoid writing to $PWD 2019-11-20 22:37:23 +00:00
gmp
life misc: remove use of relative directories in overlayDir functions 2019-11-25 16:26:15 +00:00
nocgo
stdio misc: remove use of relative directories in overlayDir functions 2019-11-25 16:26:15 +00:00
test [release-branch.go1.15] cmd/compile: export notinheap annotation to object file 2020-10-12 15:15:57 +00:00
testasan misc: log 'ok' from 'go run' tests on success 2019-11-25 16:43:27 +00:00
testcarchive all: remove scattered remnants of darwin/arm 2020-04-08 18:35:49 +00:00
testcshared [release-branch.go1.15] cmd/link: avoid exporting all symbols on windows buildmode=pie 2021-03-31 21:39:47 +00:00
testgodefs cmd/cgo: in -godefs mode, don't change constant to type 2020-06-11 21:53:45 +00:00
testplugin misc/cgo/testplugin: fix typo in comment 2020-06-01 23:25:14 +00:00
testsanitizers runtime: save/restore callee saved registers in arm64's sigtramp 2019-06-03 19:02:11 +00:00
testshared cmd/link: don't mark shared library symbols reachable unconditionally 2020-07-27 16:04:55 +00:00
testsigfwd misc: log 'ok' from 'go run' tests on success 2019-11-25 16:43:27 +00:00
testso all: remove scattered remnants of darwin/arm 2020-04-08 18:35:49 +00:00
testsovar all: remove scattered remnants of darwin/arm 2020-04-08 18:35:49 +00:00
testtls