aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/ld/lib.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-09-19 22:10:34 -0400
committerRuss Cox <rsc@golang.org>2010-09-19 22:10:34 -0400
commitaf12feb8d514b5970c984be61b07c56e0e72b2ce (patch)
treec18b5c9b0cabfd8ba2cf0abb12f73bfbf8c4d96b /src/cmd/ld/lib.c
parentafbee9d87d1ce9fd98e1beb9ac8945263c1f3e52 (diff)
downloadgo-af12feb8d514b5970c984be61b07c56e0e72b2ce.tar.xz
6l, 8l: clean up ELF code, fix NaCl
R=r CC=golang-dev https://golang.org/cl/2221042
Diffstat (limited to 'src/cmd/ld/lib.c')
-rw-r--r--src/cmd/ld/lib.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cmd/ld/lib.c b/src/cmd/ld/lib.c
index c91705c6ba..0cdc6778fc 100644
--- a/src/cmd/ld/lib.c
+++ b/src/cmd/ld/lib.c
@@ -908,3 +908,19 @@ mangle(char *file)
fprint(2, "%s: mangled input file\n", file);
errorexit();
}
+
+Section*
+addsection(Segment *seg, char *name, int rwx)
+{
+ Section **l;
+ Section *sect;
+
+ for(l=&seg->sect; *l; l=&(*l)->next)
+ ;
+ sect = mal(sizeof *sect);
+ sect->rwx = rwx;
+ sect->name = name;
+ sect->seg = seg;
+ *l = sect;
+ return sect;
+}