summaryrefslogtreecommitdiff
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
commit0080de34a81ee58328a5942c6113e15388353e6d (patch)
tree03439f4c8dcdf94083ed22ba79fbc74ca457acfe /src/cmd/ld/lib.c
parente9ea457863e50b37476522aa122feca7df96e49c (diff)
downloadgo-0080de34a81ee58328a5942c6113e15388353e6d.tar.gz
6l, 8l: clean up ELF code, fix NaCl
R=r CC=golang-dev http://codereview.appspot.com/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 c91705c6b..0cdc6778f 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;
+}