summaryrefslogtreecommitdiff
path: root/src/cmd/6l/obj.c
AgeCommit message (Collapse)AuthorFilesLines
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý1-433/+116
2010-06-30cgo: use slash-free relative paths for .so referencesRuss Cox1-0/+2
The Makefile and cgo now rewrite / to _ when creating the path. The .so for gosqlite.googlecode.com/hg/sqlite is named cgo_gosqlite.googlecode.com_hg_sqlite.so, and then 6l and 8l both include a default rpath of $GOROOT/pkg/$GOOS_$GOARCH. This should make it easier to move binaries from one system to another. Fixes issue 857. R=iant, r CC=golang-dev http://codereview.appspot.com/1700048
2010-06-21ld: add -u flag to check safe bits; discard old -u, -x flagsRuss Cox1-10/+0
R=r, r2 CC=golang-dev http://codereview.appspot.com/1707043
2010-02-26Add -r option to 6l/8l/5l.Ian Lance Taylor1-1/+4
This permits more flexibility with cgo and swig in cases where the program is run on a machine other than the one on which it is built. Rather than storing the absolute path to the shared library in the DT_NEEDED entry, we can store just the name, and let the dynamic linker find it using DT_RUNPATH or the LD_LIBRARY_PATH environment variable. R=rsc CC=golang-dev http://codereview.appspot.com/223068
2010-02-08*l/*c: add -V flag to display version numberAndrew Gerrand1-0/+3
R=rsc CC=golang-dev http://codereview.appspot.com/204044
2010-02-03search for runtime.a in the package path instead of hardcodingKai Backman1-5/+4
the location. remove last remnants of broken -l flag. R=rsc CC=golang-dev http://codereview.appspot.com/201042
2010-02-03ld: include main and runtime in the library loopRuss Cox1-1/+1
Fixes issue 585. R=r CC=golang-dev http://codereview.appspot.com/195075
2010-01-255l, 6l, 8l: accept only one object fileRuss Cox1-5/+4
(package main; others are pulled in automatically) R=ken2 CC=golang-dev http://codereview.appspot.com/194069
2010-01-25ld: do not load the same object file multiple times.Russ Cox1-0/+6
eliminates spurious multiple initialization errors. give more information in the multiple init errors that remain. Fixes issue 87. R=r CC=golang-dev http://codereview.appspot.com/194052
2010-01-22eliminate the package global name space assumption in object filesRuss Cox1-4/+8
5g/6g/8g: add import statements to export metadata, mapping package path to package name. recognize "" as the path of the package in export metadata. use "" as the path of the package in object symbol names. 5c/6c/8c, 5a/6a/8a: rewrite leading . to "". so that ·Sin means Sin in this package. 5l/6l/8l: rewrite "" in symbol names as object files are read. gotest: handle new symbol names. gopack: handle new import lines in export metadata. Collectively, these changes eliminate the assumption of a global name space in the object file formats. Higher level pieces such as reflect and the computation of type hashes still depend on the assumption; we're not done yet. R=ken2, r, ken3 CC=golang-dev http://codereview.appspot.com/186263 Committer: Russ Cox <rsc@golang.org>
2009-11-18More FreeBSD-touchups. Thundercats are GOOOOO!Devon H. O'Dell1-3/+2
R=rsc CC=golang-dev http://codereview.appspot.com/157074 Committer: Russ Cox <rsc@golang.org>
2009-11-17FreeBSD-specific porting work.Devon H. O'Dell1-0/+6
cgo/libmach remain unimplemented. However, compilers, runtime, and packages are 100%. I still need to go through and implement missing syscalls (at least make sure they're all listed), but for all shipped functionality, this is done. Ship! ;) R=rsc, VenkateshSrinivas http://codereview.appspot.com/152142 Committer: Russ Cox <rsc@golang.org>
2009-11-04speed up 6lKen Thompson1-14/+17
hopefully no change R=rsc http://go/go-review/1017035
2009-10-07factor portable object+library bits out of 5l/6l/8l into ldRuss Cox1-643/+12
R=r DELTA=3214 (904 added, 2260 deleted, 50 changed) OCL=35425 CL=35427
2009-10-05allow multiple -L optionsRob Pike1-8/+16
R=rsc DELTA=31 (15 added, 3 deleted, 13 changed) OCL=35364 CL=35364
2009-10-038c, 8l dynamic loading support.Russ Cox1-2/+4
better mach binaries. cgo working on darwin+linux amd64+386. eliminated context switches - pi is 30x faster. add libcgo to build. on snow leopard: - non-cgo binaries work; all tests pass. - cgo binaries work on amd64 but not 386. R=r DELTA=2031 (1316 added, 626 deleted, 89 changed) OCL=35264 CL=35304
2009-09-30step toward darwin ffi: factor out macho codeRuss Cox1-1/+3
R=r DELTA=771 (374 added, 287 deleted, 110 changed) OCL=35187 CL=35187
2009-08-21linker workRuss Cox1-3/+4
* 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 Cox1-7/+7
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 Cox1-0/+1
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 Cox1-2/+13
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 Cox1-1/+3
no types yet. R=ken OCL=33142 CL=33146
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-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-21make 6l produce dynamically linked binaries (although they are fully ↵Rob Pike1-1/+1
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 Pike1-1/+1
R=rsc DELTA=68 (21 added, 28 deleted, 19 changed) OCL=31857 CL=31864
2009-07-17First steps towards cleaner support for ELF64 in 6l.Rob Pike1-1/+2
R=rsc DELTA=337 (165 added, 119 deleted, 53 changed) OCL=31786 CL=31794
2009-07-07the ld-supplied typestrings are now obsoleteRuss Cox1-2/+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 Cox1-4/+2
move PtrSize value into 6l/8l files. R=r DELTA=78 (47 added, 15 deleted, 16 changed) OCL=29729 CL=29798
2009-04-30change 6l library directory flag to -L,Russ Cox1-25/+21
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 Pike1-2/+9
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-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-20don't need two names for the same function (vputl and llputl).Russ Cox1-1/+1
also use thechar, to make copy/paste easier. R=ken OCL=26583 CL=26588
2009-02-05heuristic to stop pulling .6 in from .aRuss Cox1-7/+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 Cox1-0/+3
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-21delete unused code and data from 6.outs.Russ Cox1-3/+8
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 Cox1-16/+9
(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 Cox1-2/+7
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
2008-11-23delete stack mark stringsRuss Cox1-1/+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-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
2008-11-056g interface changes:Russ Cox1-0/+8
* allow conversion between nil interface and any type. * mark signatures as DUPOK so that multiple .6 can contain sigt.*[]byte and only one gets used. R=ken OCL=18538 CL=18542
2008-11-036l: generate gotypesigs on demand.Russ Cox1-0/+1
add sys.unreflect, which uses gotypesigs. R=r DELTA=170 (152 added, 12 deleted, 6 changed) OCL=18396 CL=18404
2008-10-216l: invent gotypestrings if neededRuss Cox1-2/+11
R=r DELTA=419 (409 added, 5 deleted, 5 changed) OCL=17524 CL=17530
2008-10-206l:Russ Cox1-126/+81
use libbio instead of maintaining own buffer libbio: always use vlong offsets; die if off_t is too small R=r DELTA=163 (23 added, 63 deleted, 77 changed) OCL=17508 CL=17512
2008-10-20use Biobuf not fd for reading objects.Russ Cox1-17/+18
will make reading type info easier. R=r DELTA=21 (2 added, 1 deleted, 18 changed) OCL=17491 CL=17501
2008-09-08go linux x86-64 kernel fixes:Russ Cox1-1/+1
* change .gosymtab and .gopclntab to section 7 (note) * start INITTEXT at 4MB, not 4KB R=r OCL=14953 CL=14959
2008-08-03make 6a, 6c, 6g, 6l, libmach_amd64 build on 64-bit gcc.Russ Cox1-13/+13
these guys really really want long to be 32-bits, so ,s/long/int32/ (and then manual fixup). still passes all tests. (i started out looking for just those longs that needed to be int32 instead, and it was just too hard to track them down one by one.) the longs were rare enough that i don't think it will cause integration problems. R=ken OCL=13787 CL=13789