aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/go-backend.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2011-05-27 22:46:11 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-05-27 22:46:11 +0000
commit76aa42d2663180d0eda360689a42040ac7ec92bd (patch)
treedbd080404d65f3dde4d423621c09556b357bc027 /gcc/go/go-backend.c
parentd112944143e99e9a99a78b43cdd60dc940c0209f (diff)
downloadgcc-76aa42d2663180d0eda360689a42040ac7ec92bd.zip
gcc-76aa42d2663180d0eda360689a42040ac7ec92bd.tar.gz
gcc-76aa42d2663180d0eda360689a42040ac7ec92bd.tar.bz2
Change export code to use the backend interface.
* go-backend.c: Include "output.h". (go_write_export_data): New function. * go-c.h (go_write_export_data): Declare. * Make-lang.in (go/go-backend.o): Depend on output.h. (go/export.o): Depend on $(GO_C_H). Do not depend on $(MACHMODE_H), output.h, or $(TARGET_H). From-SVN: r174366
Diffstat (limited to 'gcc/go/go-backend.c')
-rw-r--r--gcc/go/go-backend.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/go/go-backend.c b/gcc/go/go-backend.c
index 5ecc99b..60a97db 100644
--- a/gcc/go/go-backend.c
+++ b/gcc/go/go-backend.c
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "rtl.h"
#include "tree.h"
#include "tm_p.h"
+#include "output.h"
#include "target.h"
#include "go-c.h"
@@ -91,3 +92,21 @@ go_imported_unsafe (void)
/* Let the backend know that the options have changed. */
targetm.override_options_after_change ();
}
+
+/* This is called by the Go frontend proper to add data to the
+ .go_export section. */
+
+void
+go_write_export_data (const char *bytes, unsigned int size)
+{
+ static section* sec;
+
+ if (sec == NULL)
+ {
+ gcc_assert (targetm.have_named_sections);
+ sec = get_section (".go_export", SECTION_DEBUG, NULL);
+ }
+
+ switch_to_section (sec);
+ assemble_string (bytes, size);
+}