diff options
author | Jim McGrath <jimmc2@gmail.com> | 2010-10-12 16:52:17 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-10-12 16:52:17 -0400 |
commit | 8a1b2e59ef553228a60d6799a2e001761e1e8ca8 (patch) | |
tree | 00f5a1d223cfeb1b78866a899edc98a29ebb9056 | |
parent | 12da5a90e0e51f8c74792ce52f4ec627ae0b8124 (diff) | |
download | go-8a1b2e59ef553228a60d6799a2e001761e1e8ca8.tar.gz go-8a1b2e59ef553228a60d6799a2e001761e1e8ca8.zip |
6l: work with OS X nm/otool
6l was skipping emitting the (2 byte) symbol table if there were no imported or exported
symbols. You can't just drop the symbol table entirely - the linker dies if you have
a linkedit section but no table. You can omit the linkedit section or both the linkedit
and the dlyd parts in the right circumstances, but that seems much more risky to me.
R=rsc
CC=golang-dev
https://golang.org/cl/2421042
-rw-r--r-- | src/cmd/ld/macho.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/ld/macho.c b/src/cmd/ld/macho.c index a3d302401e..799daf87ae 100644 --- a/src/cmd/ld/macho.c +++ b/src/cmd/ld/macho.c @@ -410,7 +410,7 @@ domacholink(void) uint64 val; linkoff = 0; - if(nlinkdata > 0) { + if(nlinkdata > 0 || nstrtab > 0) { linkoff = rnd(HEADR+textsize, INITRND) + rnd(datsize, INITRND); seek(cout, linkoff, 0); |