aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/ld/data.c
diff options
context:
space:
mode:
authorShenghou Ma <minux.ma@gmail.com>2014-02-11 18:43:05 -0500
committerShenghou Ma <minux.ma@gmail.com>2014-02-11 18:43:05 -0500
commit4687b5414789581f635ff96d401e23a50da8024b (patch)
tree1030ba8ac290d33edb64477874f084d1c3e5e1e2 /src/cmd/ld/data.c
parent13a5958db328a74f863d8391f453a81ae326fd31 (diff)
downloadgo-4687b5414789581f635ff96d401e23a50da8024b.tar.xz
cmd/ld, cmd/6l: part 2 of solaris/amd64 linker changes.
Second part of the solaris/amd64 linker changes: relocation and symbol table. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://golang.org/cl/61330043
Diffstat (limited to 'src/cmd/ld/data.c')
-rw-r--r--src/cmd/ld/data.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/ld/data.c b/src/cmd/ld/data.c
index 640fd6d6ef..8acb72331c 100644
--- a/src/cmd/ld/data.c
+++ b/src/cmd/ld/data.c
@@ -154,9 +154,9 @@ relocsym(LSym *s)
if(r->type >= 256)
continue;
- if(r->sym != S && r->sym->type == SDYNIMPORT)
+ // Solaris needs the ability to reference dynimport symbols.
+ if(HEADTYPE != Hsolaris && r->sym != S && r->sym->type == SDYNIMPORT)
diag("unhandled relocation for %s (type %d rtype %d)", r->sym->name, r->sym->type, r->type);
-
if(r->sym != S && r->sym->type != STLSBSS && !r->sym->reachable)
diag("unreachable sym in relocation: %s %s", s->name, r->sym->name);
@@ -194,7 +194,7 @@ relocsym(LSym *s)
r->xadd += symaddr(rs) - symaddr(rs->outer);
rs = rs->outer;
}
- if(rs->type != SHOSTOBJ && rs->sect == nil)
+ if(rs->type != SHOSTOBJ && rs->type != SDYNIMPORT && rs->sect == nil)
diag("missing section for %s", rs->name);
r->xsym = rs;
@@ -225,7 +225,7 @@ relocsym(LSym *s)
rs = rs->outer;
}
r->xadd -= r->siz; // relative to address after the relocated chunk
- if(rs->type != SHOSTOBJ && rs->sect == nil)
+ if(rs->type != SHOSTOBJ && rs->type != SDYNIMPORT && rs->sect == nil)
diag("missing section for %s", rs->name);
r->xsym = rs;