diff options
| author | Ian Lance Taylor <iant@golang.org> | 2022-06-27 14:58:58 -0700 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-01-25 20:45:42 +0000 |
| commit | 1f29f39795e736238200840c368c4e0c6edbfbae (patch) | |
| tree | c454f01c312305b67e45d3104327c8dc75bbda8e /src/cmd/link/internal/loader/loader.go | |
| parent | 2bf0f54bbd6dfa57fc11444f9b8ba722689e6490 (diff) | |
| download | go-1f29f39795e736238200840c368c4e0c6edbfbae.tar.xz | |
cmd/link: don't export all symbols for ELF external linking
Since this may add a large number of --export-dynamic-symbol options,
use a response file if the command line gets large.
Fixes #53579
Change-Id: Ic226bf372bf1e177a3dae886d1c48f4ce3569c0e
Reviewed-on: https://go-review.googlesource.com/c/go/+/414654
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Joedian Reid <joedian@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/cmd/link/internal/loader/loader.go')
| -rw-r--r-- | src/cmd/link/internal/loader/loader.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cmd/link/internal/loader/loader.go b/src/cmd/link/internal/loader/loader.go index 8e1575a5a2..808b218062 100644 --- a/src/cmd/link/internal/loader/loader.go +++ b/src/cmd/link/internal/loader/loader.go @@ -1041,6 +1041,14 @@ func (l *Loader) SetAttrCgoExportDynamic(i Sym, v bool) { } } +// ForAllAttrCgoExportDynamic calls f for every symbol that has been +// marked with the "cgo_export_dynamic" compiler directive. +func (l *Loader) ForAllCgoExportDynamic(f func(Sym)) { + for s := range l.attrCgoExportDynamic { + f(s) + } +} + // AttrCgoExportStatic returns true for a symbol that has been // specially marked via the "cgo_export_static" directive // written by cgo. |
