summaryrefslogtreecommitdiff
path: root/src/cmd/6l/asm.c
AgeCommit message (Collapse)AuthorFilesLines
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý1-756/+633
2010-06-11Pad Go symbol table out to page boundary when linking dynamically.Ian Lance Taylor1-2/+4
This avoids a crash when using cgo where glibc's malloc thinks that it can use some of the memory following the symbol table. This fails because the symbol table is mapped read-only, which affects the whole page. R=rsc CC=golang-dev http://codereview.appspot.com/1616042
2010-04-275l, 6l, 8l, runtime: make -s binaries workRuss Cox1-10/+37
5l, 6l, 8l: change ELF header so that strip doesn't destroy binary Fixes issue 261. R=iant, r CC=golang-dev http://codereview.appspot.com/994044
2010-04-206l, 8l: include ELF header in PT_LOAD mapping for text segmentRuss Cox1-5/+5
Due to page boundary rounding, the header would have been loaded as part of the text segment already, but this change placates the "paxctl" tool on so-called hardened Linux distributions (as if normal distributions weren't already hard enough to use). R=r CC=golang-dev http://codereview.appspot.com/954041
2010-03-23Add support for #pragma dynexport.Ian Lance Taylor1-31/+46
R=rsc CC=golang-dev http://codereview.appspot.com/661043
2010-03-22Rename dynld to dynimport throughout.Ian Lance Taylor1-5/+5
Cgo users will need to rerun cgo. R=rsc CC=golang-dev http://codereview.appspot.com/692041
2010-02-26Add -r option to 6l/8l/5l.Ian Lance Taylor1-0/+2
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-046l: move mapped symbol table lower in memoryAndrew Gerrand1-1/+1
Allows binary to run on some Linux system. Fix for issue 365. R=rsc CC=golang-dev http://codereview.appspot.com/199096
2009-11-186l, 8l: add trivial hash table for dynamic symbolsRuss Cox1-18/+21
R=r http://codereview.appspot.com/156085
2009-11-18ld: move interpreter string into first block of ELF fileRuss Cox1-15/+10
necessary on freebsd. R=r, dho CC=golang-dev http://codereview.appspot.com/157069
2009-11-17fix botchKen Thompson1-1270/+0
R=rsc http://codereview.appspot.com/157046
2009-11-17change a n^2 algorithm inKen Thompson1-2/+1385
data initialization to n*log(n) R=rsc http://codereview.appspot.com/158041
2009-11-17FreeBSD-specific porting work.Devon H. O'Dell1-2/+15
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-166l: fix divide by zero in glibc linker.Russ Cox1-5/+12
repeats 8l change http://code.google.com/p/go/source/detail?r=7594e16b5cf9 Fixes issue 179. R=iant http://codereview.appspot.com/154145
2009-11-04speed up 6lKen Thompson1-21/+86
hopefully no change R=rsc http://go/go-review/1017035
2009-11-036l -e: emit external ELF symbol table.Russ Cox1-1/+51
enough to make nm and oprofile work. R=r http://go/go-review/1017016
2009-10-07factor portable object+library bits out of 5l/6l/8l into ldRuss Cox1-0/+1
R=r DELTA=3214 (904 added, 2260 deleted, 50 changed) OCL=35425 CL=35427
2009-10-038c, 8l dynamic loading support.Russ Cox1-92/+9
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-183/+87
R=r DELTA=771 (374 added, 287 deleted, 110 changed) OCL=35187 CL=35187
2009-09-24convert 8l to new ELF code.Russ Cox1-86/+39
mostly cut and paste from 6l. R=r DELTA=930 (525 added, 182 deleted, 223 changed) OCL=34976 CL=34976
2009-08-24ffi -> dynld.Russ Cox1-13/+6
move out of export data into its own section R=r DELTA=222 (71 added, 99 deleted, 52 changed) OCL=33801 CL=33808
2009-08-24linker workRuss Cox1-22/+54
* use //ffi comments in package import data to generate relocation entries and library loads. * call initffi in rt0.s if present R=r DELTA=117 (91 added, 3 deleted, 23 changed) OCL=33739 CL=33750
2009-08-23linker workRuss Cox1-55/+67
* more elf constants from FreeBSD * simple relocation demo R=r DELTA=410 (354 added, 49 deleted, 7 changed) OCL=33689 CL=33729
2009-08-21linker workRuss Cox1-164/+369
* 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-0/+2
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-5/+23
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-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 Pike1-47/+164
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-9/+9
R=rsc DELTA=68 (21 added, 28 deleted, 19 changed) OCL=31857 CL=31864
2009-07-20clean up generation of exec header.Rob Pike1-52/+46
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 Pike1-163/+54
R=rsc DELTA=337 (165 added, 119 deleted, 53 changed) OCL=31786 CL=31794
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 Cox1-26/+19
also use thechar, to make copy/paste easier. R=ken OCL=26583 CL=26588
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 Cox1-1/+3
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-15diagnose missing symbols instead ofRob Pike1-0/+2
silently miscompiling. R=rsc OCL=22872 CL=22872
2008-12-04emit dynamically linked 6.out on darwin instead of static,Russ Cox1-5/+38
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-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 Cox1-9/+40
* 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-10-216l: invent gotypestrings if neededRuss Cox1-5/+13
R=r DELTA=419 (409 added, 5 deleted, 5 changed) OCL=17524 CL=17530
2008-10-20use Biobuf not fd for reading objects.Russ Cox1-1/+0
will make reading type info easier. R=r DELTA=21 (2 added, 1 deleted, 18 changed) OCL=17491 CL=17501
2008-09-26fix ELF bugs found by iantRuss Cox1-9/+9
- .text begins at INITTEXT, not 0 and does not include HEADR - .shstrtab, .gosymtab, .gopclntab have alignment 1 - .gosymtab, .gopclntab have type SHT_PROGBITS R=r DELTA=9 (0 added, 0 deleted, 9 changed) OCL=15953 CL=15956
2008-09-08go linux x86-64 kernel fixes:Russ Cox1-3/+3
* 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-16/+16
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
2008-06-18stack offsetKen Thompson1-2/+1
SVN=123521
2008-06-18stack offseet table markerKen Thompson1-1/+2
tacked above each TEXT entry SVN=123496