aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/ld/data.c
diff options
context:
space:
mode:
authorShenghou Ma <minux.ma@gmail.com>2012-10-10 00:55:48 +0800
committerShenghou Ma <minux.ma@gmail.com>2012-10-10 00:55:48 +0800
commitfa563ae82e2d1038656be21c52831e7ad42108a8 (patch)
tree94a7df7dfaab2aae1dc44a7a7b1dc99a7415b509 /src/cmd/ld/data.c
parentcffbfaeb1819bfb6770848c4d57615f0ee1a46ba (diff)
downloadgo-fa563ae82e2d1038656be21c52831e7ad42108a8.tar.xz
cmd/ld, cmd/6l, cmd/8l: sort exported dynamic symbols for Darwin
Also corrected cmd/8l's .dynsym handling (differentiate between exported symbols and imported symbols) Fixes #4029. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6620075
Diffstat (limited to 'src/cmd/ld/data.c')
-rw-r--r--src/cmd/ld/data.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/cmd/ld/data.c b/src/cmd/ld/data.c
index 4afe4b801c..e551f72903 100644
--- a/src/cmd/ld/data.c
+++ b/src/cmd/ld/data.c
@@ -794,6 +794,33 @@ addaddr(Sym *s, Sym *t)
}
vlong
+setaddrplus(Sym *s, vlong off, Sym *t, int32 add)
+{
+ Reloc *r;
+
+ if(s->type == 0)
+ s->type = SDATA;
+ s->reachable = 1;
+ if(off+PtrSize > s->size) {
+ s->size = off + PtrSize;
+ symgrow(s, s->size);
+ }
+ r = addrel(s);
+ r->sym = t;
+ r->off = off;
+ r->siz = PtrSize;
+ r->type = D_ADDR;
+ r->add = add;
+ return off;
+}
+
+vlong
+setaddr(Sym *s, vlong off, Sym *t)
+{
+ return setaddrplus(s, off, t, 0);
+}
+
+vlong
addsize(Sym *s, Sym *t)
{
vlong i;