From eced6754c2f2ce98cb5bacbdbfcbbaa4a6a69d53 Mon Sep 17 00:00:00 2001 From: David Crawshaw Date: Thu, 25 Aug 2016 21:58:45 -0400 Subject: cmd/link: -buildmode=plugin support for linux This CL contains several linker changes to support creating plugins. It collects the exported plugin symbols provided by the compiler and includes them in the moduledata. It treats a binary as being dynamically linked if it imports the plugin package. This lets the dynamic linker de-duplicate symbols. Change-Id: I099b6f38dda26306eba5c41dbe7862f5a5918d95 Reviewed-on: https://go-review.googlesource.com/27820 Run-TryBot: David Crawshaw TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/runtime/plugin.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/runtime/plugin.go (limited to 'src/runtime/plugin.go') diff --git a/src/runtime/plugin.go b/src/runtime/plugin.go new file mode 100644 index 0000000000..f5f3aa2e5b --- /dev/null +++ b/src/runtime/plugin.go @@ -0,0 +1,13 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package runtime + +// A ptabEntry is generated by the compiler for each exported function +// and global variable in the main package of a plugin. It is used to +// initialize the plugin module's symbol map. +type ptabEntry struct { + name nameOff + typ typeOff +} -- cgit v1.3