aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-12-17 10:03:43 -0800
committerRuss Cox <rsc@golang.org>2010-12-17 10:03:43 -0800
commit8ec6f7cd11ff9f376ef42a062295cd315ebc29af (patch)
treea4b3c7218889e2648369be5e66fd9c86528e4575
parent01464cf9564c57accd427e90fdd760a35377d9c9 (diff)
downloadgo-8ec6f7cd11ff9f376ef42a062295cd315ebc29af.tar.gz
go-8ec6f7cd11ff9f376ef42a062295cd315ebc29af.zip
ld: ignore stab symbols
Makes 6l work better on OS X 10.5. Fixes #1352. Fixes #1353. R=r CC=golang-dev https://golang.org/cl/3661042
-rw-r--r--src/cmd/ld/ldmacho.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cmd/ld/ldmacho.c b/src/cmd/ld/ldmacho.c
index ba243245bf..f6095fb334 100644
--- a/src/cmd/ld/ldmacho.c
+++ b/src/cmd/ld/ldmacho.c
@@ -32,6 +32,8 @@ enum {
MACHO_FAKE_GOTPCREL = 100, // from macho.h
N_EXT = 0x01,
+ N_TYPE = 0x1e,
+ N_STAB = 0xe0,
};
typedef struct MachoObj MachoObj;
@@ -596,6 +598,8 @@ ldmacho(Biobuf *f, char *pkg, int64 len, char *pn)
for(i=0; i<symtab->nsym; i++) {
int v;
sym = &symtab->sym[i];
+ if(sym->type&N_STAB)
+ continue;
// TODO: check sym->type against outer->type.
name = sym->name;
if(name[0] == '_' && name[1] != '\0')
@@ -632,7 +636,7 @@ ldmacho(Biobuf *f, char *pkg, int64 len, char *pn)
Prog *p;
if(s->text != P)
- diag("%s: duplicate definition of %s", pn, s->name);
+ diag("%s sym#%d: duplicate definition of %s", pn, i, s->name);
// build a TEXT instruction with a unique pc
// just to make the rest of the linker happy.
// TODO: this is too 6l-specific ?