aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/ld/data.c
diff options
context:
space:
mode:
authorShenghou Ma <minux.ma@gmail.com>2012-05-23 02:32:27 +0800
committerShenghou Ma <minux.ma@gmail.com>2012-05-23 02:32:27 +0800
commit576d648b2a961a474acd6b2236ae062b901bb404 (patch)
tree4a08a12bcc19a22a54f5a930f806571600cf9493 /src/cmd/ld/data.c
parent1c4b77a7c8adc6eed393a83991a3a67b88739050 (diff)
downloadgo-576d648b2a961a474acd6b2236ae062b901bb404.tar.xz
cmd/ld, cmd/6l, cmd/8l, cmd/5l: fix hidden/local symbol import for ELF systems
Introduce a newsym() to cmd/lib.c to add a symbol but don't add them to hash table. Introduce a new bit flag SHIDDEN and bit mask SMASK to handle hidden and/or local symbols in ELF symbol tables. Though we still need to order the symbol table entries correctly. Fix for issue 3261 comment #9. For CL 5822049. R=iant, rsc CC=golang-dev https://golang.org/cl/5823055
Diffstat (limited to 'src/cmd/ld/data.c')
-rw-r--r--src/cmd/ld/data.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/ld/data.c b/src/cmd/ld/data.c
index ea7129781e..4eff24024e 100644
--- a/src/cmd/ld/data.c
+++ b/src/cmd/ld/data.c
@@ -159,7 +159,7 @@ relocsym(Sym *s)
diag("%s: invalid relocation %d+%d not in [%d,%d)", s->name, off, siz&~Rbig, 0, s->np);
continue;
}
- if(r->sym != S && (r->sym->type == 0 || r->sym->type == SXREF)) {
+ if(r->sym != S && (r->sym->type & SMASK == 0 || r->sym->type & SMASK == SXREF)) {
diag("%s: not defined", r->sym->name);
continue;
}