summaryrefslogtreecommitdiff
path: root/src/cmd/6l
AgeCommit message (Collapse)AuthorFilesLines
2009-08-21linker workRuss Cox8-177/+407
* remove now-unused D_SBIG (was for typestrings) * rename elf64.[ch] to elf.[ch] * pull in elf headers from FreeBSD instead of writing our own * emit non-header ELF data in data section * stub out a few more ELF sections needed for dynamic loading R=r DELTA=1928 (1237 added, 635 deleted, 56 changed) OCL=33642 CL=33658
2009-08-20symbol bugs.Russ Cox5-14/+43
do not emit unreachable data symbols. R=austin DELTA=103 (71 added, 4 deleted, 28 changed) OCL=33325 CL=33622
2009-08-20FFI step 2: can ask for libc.so.6.Russ Cox4-5/+34
introduced explicit "data" symbol instead of etext to mark beginning of data, so that using larger alignment (i.e. 4MB like GNU loader) doesn't confuse garbage collector. split dodata into dodata and dobss in preparation for putting the dynamic data + headers in the data segment instead of stuffed at the beginning of the binary. R=r DELTA=52 (37 added, 3 deleted, 12 changed) OCL=33610 CL=33618
2009-08-136g/6l: add go type information to symbol table.Russ Cox3-15/+31
archive size +70% binary size +30% old wreck.mtv=; ls -l /Users/rsc/bin/{godoc,gofmt} -rwxr-xr-x 1 rsc eng 1487922 Aug 13 13:21 /Users/rsc/bin/godoc -rwxr-xr-x 1 rsc eng 995995 Aug 13 13:21 /Users/rsc/bin/gofmt wreck.mtv=; du -sh $GOROOT/pkg/ 9.5M /home/rsc/go/pkg/ wreck.mtv=; new wreck.mtv=; ls -l /Users/rsc/bin/{godoc,gofmt} -rwxr-xr-x 1 rsc eng 2014390 Aug 13 14:25 /Users/rsc/bin/godoc -rwxr-xr-x 1 rsc eng 1268705 Aug 13 14:25 /Users/rsc/bin/gofmt wreck.mtv=; du -sh $GOROOT/pkg 16M /home/rsc/go/pkg wreck.mtv=; R=ken OCL=33217 CL=33220
2009-08-12mechanism for putting go types into 6.out symbol table.Russ Cox4-8/+12
no types yet. R=ken OCL=33142 CL=33146
2009-08-12change gotype in symbol table fromRuss Cox2-10/+7
character string to machine address. not filled in, just carved out. R=austin DELTA=77 (11 added, 34 deleted, 32 changed) OCL=33122 CL=33124
2009-08-12delete heuristic left over from incremental compilationRuss Cox1-14/+1
R=r DELTA=31 (2 added, 28 deleted, 1 changed) OCL=33064 CL=33112
2009-08-09increase from 3 to 11 floating registersKen Thompson1-1/+1
R=rsc OCL=32947 CL=32947
2009-08-07remove 8.out before creating it.Russ Cox1-0/+1
hope this will work around Mac NFS bug where writing to an 8.out that has crashed recently sometimes wedges NFS. R=r DELTA=3 (3 added, 0 deleted, 0 changed) OCL=32906 CL=32908
2009-07-28Support use of $GOBINDIR to override $HOME/binPhil Pennock1-1/+2
R=r,gri,rsc APPROVED=rsc DELTA=53 (12 added, 6 deleted, 35 changed) OCL=31822 CL=32282
2009-07-21a little more 6l cleanupRuss Cox1-36/+26
R=r DELTA=51 (14 added, 24 deleted, 13 changed) OCL=31968 CL=31971
2009-07-21add a .interp section and fix vaddr in INTERP prog.Rob Pike1-7/+13
R=rsc DELTA=16 (9 added, 3 deleted, 4 changed) OCL=31956 CL=31963
2009-07-21make 6l produce dynamically linked binaries (although they are fully ↵Rob Pike3-49/+165
statically linked as far as go is concerned). the -d flag is now flipped; as on the mac, -d disables dynamic. much remains to be improved to move the output closer to the gcc format. R=rsc DELTA=366 (310 added, 30 deleted, 26 changed) OCL=31929 CL=31951
2009-07-206l cleanup: last set of magic numbers for elf64 moved to ld/elf64*.Rob Pike2-10/+10
R=rsc DELTA=68 (21 added, 28 deleted, 19 changed) OCL=31857 CL=31864
2009-07-20clean up generation of exec header.Rob Pike3-64/+63
make endianness explicit when writing values. R=rsc DELTA=129 (37 added, 7 deleted, 85 changed) OCL=31826 CL=31854
2009-07-17take care of a few more magic numbersRob Pike1-9/+16
R=rsc DELTA=51 (41 added, 0 deleted, 10 changed) OCL=31815 CL=31818
2009-07-17count SHdrs and PHdrs and write them out as a unitRob Pike1-52/+40
R=rsc DELTA=181 (93 added, 63 deleted, 25 changed) OCL=31802 CL=31812
2009-07-17more elf64 support: phdrs, constantsRob Pike1-41/+44
R=rsc DELTA=130 (68 added, 6 deleted, 56 changed) OCL=31798 CL=31798
2009-07-17First steps towards cleaner support for ELF64 in 6l.Rob Pike5-172/+68
R=rsc DELTA=337 (165 added, 119 deleted, 53 changed) OCL=31786 CL=31794
2009-07-13compilers were inconsistent aboutRuss Cox1-1/+1
whether no register argument was REGARG == 0 or REGARG < 0. use REGARG < 0 because arm needs 0 for R0. R=ken OCL=31562 CL=31566
2009-07-13fix undefined function error.Russ Cox1-2/+3
before: mainstart: undefined: main·init in mainstart mainstart: branch out of range in mainstart (95) CALL ,0(PC) [main·init] mainstart: undefined: main·main in mainstart mainstart: branch out of range in mainstart (97) CALL ,0(PC) [main·main] mainstart: doasm: notfound from=6f to=6f (95) CALL , mainstart: doasm: notfound from=6f to=6f (97) CALL , mainstart: doasm: notfound from=6f to=6f (95) CALL , mainstart: doasm: notfound from=6f to=6f (97) CALL , mainstart: doasm: notfound from=6f to=6f (95) CALL , mainstart: doasm: notfound from=6f to=6f (97) CALL , after: mainstart: undefined: main·init in mainstart mainstart: undefined: main·main in mainstart R=r DELTA=7 (1 added, 0 deleted, 6 changed) OCL=31555 CL=31555
2009-07-07the ld-supplied typestrings are now obsoleteRuss Cox2-4/+0
R=r DELTA=167 (0 added, 167 deleted, 0 changed) OCL=31304 CL=31316
2009-06-06move src/runtime -> src/lib/runtime;Russ Cox1-1/+1
hand-edited files. R=r DELTA=125 (77 added, 16 deleted, 32 changed) OCL=30001 CL=30008
2009-06-05more build refinements:Russ Cox1-1/+1
* use new Make.$GOARCH files in gobuild. * rename 6ar to arch-generic gopack. * place objects in $GOROOT/pkg/$GOOS_$GOARCH (makes cross-compiling easier, and no one ever types these paths by hand anyway). R=r DELTA=29 (6 added, 8 deleted, 15 changed) OCL=29923 CL=29967
2009-06-028l fixes, cut and paste from 6l.Russ Cox2-4/+6
move PtrSize value into 6l/8l files. R=r DELTA=78 (47 added, 15 deleted, 16 changed) OCL=29729 CL=29798
2009-05-056l: eliminate dead code, not just the symbolsRuss Cox1-1/+1
editing the firstp list was ineffective, because follow rebuilds it from the textp list. the symbols for dead code were being dropped from the binary but the code was all still there. text for fmt.Printf("hello, world\n") drops from 143945 to 128650. R=r,ken DELTA=22 (20 added, 0 deleted, 2 changed) OCL=28255 CL=28290
2009-05-03more morestack fiddlingKen Thompson1-34/+61
R=r OCL=28204 CL=28204
2009-05-01code improvementKen Thompson1-35/+85
better calling of morestack R=r OCL=28179 CL=28179
2009-04-30change 6l library directory flag to -L,Russ Cox3-33/+29
to match traditional c linkers. R=r DELTA=42 (8 added, 12 deleted, 22 changed) OCL=28101 CL=28115
2009-04-17add -P pkgdir option to 6l to have it look first in pkgdir for a package.Rob Pike2-2/+10
this allows gotest to find the locally built package when doing make gotest without this option, one would have to say make install gotest which kinda defeats the purpose based on discussions with rsc. R=ken,rsc DELTA=12 (10 added, 1 deleted, 1 changed) OCL=27606 CL=27606
2009-04-08yet another attempt at auto-linkingRuss Cox1-6/+14
store only the original import path string (+ .a) if 6g resolves it to an archive file. let 6l re-resolve the .a at link time. this lets libraries build against an archive in the current directory but get used against an installed archive. R=r OCL=27244 CL=27244
2009-04-01fix runtime stack overflow bug that gri ran into:Russ Cox1-3/+10
160 - 75 was just barely not enough for deferproc + morestack. added enum names and bumped to 256 - 128. added explanation. changed a few mal() (garbage-collected) to malloc()/free() (manually collected). R=ken OCL=26981 CL=26981
2009-03-31* move go-specific loader codeRuss Cox4-602/+5
into gc directory, where it gets included as ../gc/ldbody this is similar to the assemblers including ../cc/lexbody and ../cc/macbody. * hook go-specific loader code into 8l. * make current 8.out.h and 6.out.h backward compatible with plan 9's versions. i had added some constants in the middle of enums and have now moved them to the end. this keeps us from invalidating old .8 and .6 files. not sure how much it really matters, but easy to do. R=r DELTA=1314 (667 added, 623 deleted, 24 changed) OCL=26938 CL=26941
2009-03-24move darwin specific code into runtime/darwin/Russ Cox1-6/+0
move darwin-amd64 specific code into runtime/darwin/amd64/ repeat for linux. move rt0 into runtime.a instead of keeping a separate .6 file. 6l seems to have no problem with that. TBR=r OCL=26680 CL=26680
2009-03-24throw away most of the compat.h compatibility layerRuss Cox1-2/+2
in favor of the lib9 compatibility layer. no need for two. now that mycreate is gone, .6 files are 0644 not 0755. TBR=r OCL=26679 CL=26679
2009-03-20don't need two names for the same function (vputl and llputl).Russ Cox2-27/+20
also use thechar, to make copy/paste easier. R=ken OCL=26583 CL=26588
2009-02-05heuristic to stop pulling .6 in from .aRuss Cox3-25/+3
is not right if the .6 is only for data and the init function. instead of that, pick up everything and let the dead code/data eliminator throw away the parts that weren't useful. R=r DELTA=25 (0 added, 22 deleted, 3 changed) OCL=24446 CL=24446
2009-01-30keep line number history even whenRuss Cox2-2/+5
throwing away dead code at end of file. also fix an uninitialized memory error found by valgrind. R=r DELTA=7 (5 added, 2 deleted, 0 changed) OCL=23991 CL=23994
2009-01-27make "size 6.out" work on mac.Russ Cox1-5/+11
R=r DELTA=11 (6 added, 0 deleted, 5 changed) OCL=23629 CL=23631
2009-01-21delete unused code and data from 6.outs.Russ Cox6-10/+123
cuts simple test binary by 7%. would be more except for reflection. R=r DELTA=126 (117 added, 4 deleted, 5 changed) OCL=23163 CL=23237
2009-01-206l: do not link in objects from an archive just for init functions.Russ Cox4-18/+73
(makes go libraries behave more like c libraries.) R=r DELTA=85 (67 added, 12 deleted, 6 changed) OCL=23133 CL=23139
2009-01-206l: ignore undefined symbols in gotypesigs.Russ Cox2-5/+9
they end up in the symbol table with type==0 if they are in a library but not pulled in. also add a few debugging prints. R=r DELTA=11 (5 added, 1 deleted, 5 changed) OCL=23104 CL=23108
2009-01-15diagnose missing symbols instead ofRob Pike3-1/+4
silently miscompiling. R=rsc OCL=22872 CL=22872
2008-12-08pick up symbol for JMP main(SB)Russ Cox1-1/+1
but not JMP main (label). R=ken OCL=20724 CL=20724
2008-12-04emit dynamically linked 6.out on darwin instead of static,Russ Cox2-5/+39
unless given -d flag. the resulting binary doesn't *use* any dynamic libraries, it just has a reference to the dynamic linker and an empty list of needed symbols and libraries. this is enough to make 6.out binaries that can be run under dtrace / dtruss. R=r DELTA=39 (34 added, 0 deleted, 5 changed) OCL=20476 CL=20482
2008-11-23delete stack mark stringsRuss Cox3-96/+0
in favor of using in-memory copy of symbol table. $ ls -l pretty pretty.big -rwxr-xr-x 1 rsc eng 439516 Nov 21 16:43 pretty -rwxr-xr-x 1 rsc eng 580984 Nov 21 16:20 pretty.big $ R=r DELTA=446 (238 added, 178 deleted, 30 changed) OCL=19851 CL=19884
2008-11-21fix 6l bug - moved symbol table withoutRuss Cox1-4/+2
recording correct place in mach tables used by debuggers. R=r DELTA=4 (0 added, 2 deleted, 2 changed) OCL=19810 CL=19849
2008-11-20symbol table changesRuss Cox4-25/+86
* add gotype string to symbol table * fill in gotype in 6l for known funcs/vars * print gotype with nm -t * load symbol and pc/ln tables into memory at magic address 0x99<<32. * add sys.symdat() to retrieve raw bytes of symbol table and pc/ln table. most of this should be considered experimental and subject to change. R=r DELTA=157 (128 added, 0 deleted, 29 changed) OCL=19746 CL=19750
2008-11-14package-local declarations using keyword "package".Russ Cox1-3/+7
R=r DELTA=129 (81 added, 0 deleted, 48 changed) OCL=19283 CL=19291
2008-11-13* 6l:Russ Cox1-3/+44
if an object in an archive tries to refer to a file in its original source directory, ignore it. * 6ar: fix bug if archive is empty. * gobuild: build archive in current directory. * math: use new gobuild Makefile. * test/math.go: rename to mathest.go, add // run line, make it run. R=r DELTA=494 (277 added, 203 deleted, 14 changed) OCL=19090 CL=19171