]> Cypherpunks repositories - gostls13.git/commitdiff
6l: correct offset for __nl_symbol_ptr in Mach-O.
authorJim McGrath <jimmc2@gmail.com>
Mon, 11 Oct 2010 18:45:01 +0000 (14:45 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 11 Oct 2010 18:45:01 +0000 (14:45 -0400)
Fixes malformed object message from nm etc.
Fixes #1180.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/2390042

src/cmd/ld/macho.c

index 63668a81ddccba6d5544e15c708a86aeb8521c39..a3d302401e78a9cf76d09c94f1cf410f99eb643a 100644 (file)
@@ -497,7 +497,7 @@ asmbmacho(vlong symdatva, vlong symo)
        ms->vaddr = va+v;
        ms->vsize = w;
        ms->fileoffset = v;
-       ms->filesize = datsize;
+       ms->filesize = datsize+dynptrsize;
        ms->prot1 = 7;
        ms->prot2 = 3;
 
@@ -510,6 +510,7 @@ asmbmacho(vlong symdatva, vlong symo)
                msect = newMachoSect(ms, "__nl_symbol_ptr");
                msect->addr = va+v+datsize;
                msect->size = dynptrsize;
+               msect->off = v+datsize;
                msect->align = 2;
                msect->flag = 6;        /* section with nonlazy symbol pointers */
                /*