aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/8l/obj.c
AgeCommit message (Collapse)Author
2011-11-146l, 8l: add missing space in error messageLucio De Re
R=golang-dev CC=golang-dev, rsc https://golang.org/cl/5374085
2011-08-268l: add openbsdJoel Sing
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4972043
2011-07-18ld: allow seek within write bufferRuss Cox
Reduces number of write+seek's from 88516 to 2080 when linking godoc with 6l. Thanks to Alex Brainman for pointing out the many small writes. R=golang-dev, r, alex.brainman, robert.hencke CC=golang-dev https://golang.org/cl/4743043
2011-06-218l: more fixes for Plan 9Lucio De Re
Once these changes are effected, it is possible to construct "8l" native on a (386?) Plan 9 system, albeit with assistance from modules such as mkfiles that are not (yet) included in any public patches. 8l/asm.c: . Corrected some format qualifiers. 8l/list.c: . Cast a print() argument to (int) to match the given format. It may be possible to change the format (%R), but I have not looked into it. 8l/obj.c: . Removed some unused code. 8l/span.c: . Removed unnecessary incrementation on "bp". . Corrected some format qualifiers. ld/data.c: . Corrected some format qualifiers. . Cast print argument to (int): used as field size. . Use braces to suppress warning about empty if() statements. ld/dwarf.c: . Trivial spelling mistake in comment. ld/ldelf.c: . Added USED() statements to silence warnings. . Dropped redundant address (&) operators. . corrected some format qualifiers. . Cast to (int) for switch selection variable. ld/macho.c: . Added USED() statements to silence warnings. ld/ldpe.c: . Added USED() statements to silence warnings. . More careful use of "sect" variable. . Corrected some format qualifiers. . Removed redundant assignments. . Minor fix dropped as it was submitted separately. ld/pe.c: . Dropped <time.h> which is now in <u.h>. . Dropped redundant address (&) operators. . Added a missing variable initialisation. ld/symtab.c: . Added USED() statements to silence warnings. . Removed redundant incrementation. . Corrected some format qualifiers. All the above have been tested against a (very) recent release and do not seem to trigger any regressions. All review suggestions have been incorporated. R=rsc CC=golang-dev https://golang.org/cl/4633043
2011-06-21nacl, tiny: remove vestigesRobert Hencke
R=golang-dev, r, rsc CC=golang-dev https://golang.org/cl/4635053
2011-05-246l, 8l: fix Mach-O binaries with many dynamic librariesRuss Cox
R=ken2 CC=golang-dev https://golang.org/cl/4529084
2011-05-11ld: fix alignment of rodata section on Plan 9Anthony Martin
This was causing a panic in the reflect package since type.* pointers with their low bits set are assumed to have certain flags set that disallow the use of reflection. Thanks to Pavel and Taru for help tracking down this bug. R=rsc, paulzhol, taruti CC=golang-dev https://golang.org/cl/4511041
2011-04-258g,8l: fix "set but not used" gcc errorFazlul Shahriar
$ gcc --version gcc (GCC) 4.6.0 20110415 (prerelease) R=golang-dev, rsc1, rsc CC=golang-dev https://golang.org/cl/4442080
2011-04-14ld: defend against some broken object filesRuss Cox
Fixes #1698. Fixes #1699. R=ken2 CC=golang-dev https://golang.org/cl/4419041
2011-02-24ld: weak symbolsRuss Cox
A reference to the address of weak.foo resolves at link time to the address of the symbol foo if foo would end up in the binary anyway, or to zero if foo would not be in the binary. For example: int xxx = 1; int yyy = 2; int weak·xxx; int weak·yyy; void main·main(void) { runtime·printf("%p %p %p\n", &xxx, &weak·xxx, &weak·yyy); } prints the same non-nil address twice, then 0 (because yyy is not referenced so it was dropped from the binary). This will be used by the reflection tables. R=iant CC=golang-dev https://golang.org/cl/4223044
2011-02-248l/6l: new -Hwindowsgui flag allows to build windows gui peAlex Brainman
Fixes #1516. R=rsc, mattn CC=golang-dev https://golang.org/cl/4214041
2011-02-235l/6l/8l: use enums for header type and symbolic strings for -H option valuesAlex Brainman
Thanks to rsc for the suggestion. R=r CC=golang-dev https://golang.org/cl/4174060
2011-02-22ld: detect stack overflow due to NOSPLITRuss Cox
Fix problems found. On amd64, various library routines had bigger stack frames than expected, because large function calls had been added. runtime.assertI2T: nosplit stack overflow 120 assumed on entry to runtime.assertI2T 8 after runtime.assertI2T uses 112 0 on entry to runtime.newTypeAssertionError -8 on entry to runtime.morestack01 runtime.assertE2E: nosplit stack overflow 120 assumed on entry to runtime.assertE2E 16 after runtime.assertE2E uses 104 8 on entry to runtime.panic 0 on entry to runtime.morestack16 -8 after runtime.morestack16 uses 8 runtime.assertE2T: nosplit stack overflow 120 assumed on entry to runtime.assertE2T 16 after runtime.assertE2T uses 104 8 on entry to runtime.panic 0 on entry to runtime.morestack16 -8 after runtime.morestack16 uses 8 runtime.newselect: nosplit stack overflow 120 assumed on entry to runtime.newselect 56 after runtime.newselect uses 64 48 on entry to runtime.printf 8 after runtime.printf uses 40 0 on entry to vprintf -8 on entry to runtime.morestack16 runtime.selectdefault: nosplit stack overflow 120 assumed on entry to runtime.selectdefault 56 after runtime.selectdefault uses 64 48 on entry to runtime.printf 8 after runtime.printf uses 40 0 on entry to vprintf -8 on entry to runtime.morestack16 runtime.selectgo: nosplit stack overflow 120 assumed on entry to runtime.selectgo 0 after runtime.selectgo uses 120 -8 on entry to runtime.gosched On arm, 5c was tagging functions NOSPLIT that should not have been, like the recursive function printpanics: printpanics: nosplit stack overflow 124 assumed on entry to printpanics 112 after printpanics uses 12 108 on entry to printpanics 96 after printpanics uses 12 92 on entry to printpanics 80 after printpanics uses 12 76 on entry to printpanics 64 after printpanics uses 12 60 on entry to printpanics 48 after printpanics uses 12 44 on entry to printpanics 32 after printpanics uses 12 28 on entry to printpanics 16 after printpanics uses 12 12 on entry to printpanics 0 after printpanics uses 12 -4 on entry to printpanics R=r, r2 CC=golang-dev https://golang.org/cl/4188061
2011-02-18fix buildRuss Cox
pieces of an upcoming CL leaked into CL 4168056 TBR=r CC=golang-dev https://golang.org/cl/4180057
2011-02-18ld: drop rpathRuss Cox
Was required by old cgo but we don't generate stub .so files anymore. Update #1527. R=iant CC=golang-dev https://golang.org/cl/4168056
2011-02-118l, runtime: place G and M pointers relative to _tos on Plan 9, instead of ↵Yuval Pavel Zholkover
hardcoded values for USTKTOP. This should allow executing both on native Plan 9 and inside 9vx. R=rsc CC=golang-dev https://golang.org/cl/3993044
2011-02-01ld: Add -I option to set ELF interpreter.Ian Lance Taylor
R=rsc CC=golang-dev https://golang.org/cl/4080049
2010-12-15fix freebsd buildRuss Cox
R=iant, r CC=dho, golang-dev https://golang.org/cl/3687041
2010-12-15remove naclRuss Cox
The recent linker changes broke NaCl support a month ago, and there are no known users of it. The NaCl code can always be recovered from the repository history. R=adg, r CC=golang-dev https://golang.org/cl/3671042
2010-12-086l, 8l: minor changes & cleanupRuss Cox
R=ken2, ken3 CC=golang-dev https://golang.org/cl/3505041
2010-12-078l : add dynimport to import table in Windows PE, initial make cgo dll work.Wei Guangjing
R=rsc, brainman, Joe Poirier, mattn CC=golang-dev https://golang.org/cl/2166041
2010-12-068l, runtime: fix Plan 9 386 build.Yuval Pavel Zholkover
8l was broken by commit 7ac0d2eed9, it caused .data to be page aligned in the file - which is not how Plan 9 expects things to be. Also .rodata was layed out in a similar fashion. Not sure when signame was introduced, but added a stub. Removed the symo assignment in asm.c as it is not currently used. Fix runtime breakage after commit 629c065d36 which prefixes all external symbols with runtime·. R=rsc CC=golang-dev https://golang.org/cl/2674041
2010-11-028l: pe generation fixesAlex Brainman
Restore ability to have different file and section alignment in generated pe file. Stop generating .bss pe section, it is part of .data now. Some code refactoring. R=rsc, vcc CC=golang-dev https://golang.org/cl/2731041
2010-10-195l, 6l, 8l: link pclntab and symtab as ordinary rodata symbolsRuss Cox
That is, move the pc/ln table and the symbol table into the read-only data segment. This eliminates the need for a special load command to map the symbol table into memory, which makes the information available on systems that couldn't handle the magic load to 0x99000000, like NaCl and ARM QEMU and Linux without config_highmem=y. It also eliminates an #ifdef and some clumsy code to find the symbol table on Windows. The bad news is that the binary appears to be bigger than it used to be. This is not actually the case, though: the same amount of data is being mapped into memory as before, and the tables are still read-only, so they're still shared across multiple instances of the binary as they were before. The difference is just that the tables aren't squirreled away in some section that "size" doesn't know to look at. This is a checkpoint. It probably breaks Windows and breaks NaCl more than it used to be broken, but those will be fixed. The logic involving -s needs to be revisited too. Fixes #871. R=ken2 CC=golang-dev https://golang.org/cl/2587041
2010-10-195l, 6l, 8l: separate pass to fix addressesRuss Cox
Lay out code before data. R=ken2 CC=golang-dev https://golang.org/cl/2490043
2010-10-188l, runtime: initial support for Plan 9Yuval Pavel Zholkover
No multiple processes/locks, managed to compile and run a hello.go (with print not fmt). Also test/sieve.go seems to run until 439 and stops with a 'throw: all goroutines are asleep - deadlock!' - just like runtime/tiny. based on Russ's suggestions at: http://groups.google.com/group/comp.os.plan9/browse_thread/thread/cfda8b82535d2d68/243777a597ec1612 Build instructions: cd src/pkg/runtime make clean && GOOS=plan9 make install this will build and install the runtime. When linking with 8l, you should pass -s to suppress symbol generation in the a.out, otherwise the generated executable will not run. This is runtime only, the porting of the toolchain has already been done: http://code.google.com/p/go-plan9/source/browse in the plan9-quanstro branch. R=rsc CC=golang-dev https://golang.org/cl/2273041
2010-10-158l: blind attempt to fix windows buildRuss Cox
or at least gather more information R=ken2 CC=golang-dev https://golang.org/cl/2515042
2010-10-145l, 6l, 8l: accumulate data image during importRuss Cox
Using explicit relocations internally, we can represent the data for a particular symbol as an initialized block of memory instead of a linked list of ADATA instructions. The real goal here is to be able to hand off some of the relocations to the dynamic linker when interacting with system libraries, but a pleasant side effect is that the memory image is much more compact than the ADATA list, so the linkers use less memory. R=ken2 CC=golang-dev https://golang.org/cl/2512041
2010-10-13various: avoid %ld etcRuss Cox
The Plan 9 tools assume that long is 32 bits. We converted all instances of long to int32 when importing the code but missed the print formats. Because int32 is always int on the compilers we use, it is never correct to use %lux, %ld, etc. Convert to %ux, %d, etc. (It matters because on 64-bit gcc, long is 64 bits, so we were printing 32-bit quantities with 64-bit formats.) R=ken2 CC=golang-dev https://golang.org/cl/2491041
2010-10-135l, 6l, 8l: first pass cleanupRuss Cox
* Maintain Sym* list for text with individual prog lists instead of using one huge list and overloading p->pcond. * Comment what each file is for. * Move some output code from span.c to asm.c. * Move profiling into prof.c, symbol table into symtab.c. * Move mkfwd to ld/lib.c. * Throw away dhog dynamic loading code. * Throw away Alef become. * Fix printing of WORD instructions in 5l -a. Goal here is to be able to handle each piece of text or data as a separate piece, both to make it easier to load the occasional .o file and also to make it possible to split the work across multiple threads. R=ken2, r, ken3 CC=golang-dev https://golang.org/cl/2335043
2010-09-14tabsRuss Cox
TBR=lvd CC=golang-dev https://golang.org/cl/2194041
2010-09-126g, 6l, 8g, 8l: move read-only data to text segmentRuss Cox
Changing 5g and 5l too, but it doesn't work yet. R=ken2 CC=golang-dev https://golang.org/cl/2136047
2010-08-308l: emit DWARF in ELF.Luuk van Dijk
R=rsc, r, ken2 CC=golang-dev https://golang.org/cl/2004046
2010-08-04amd64: use segment memory for thread-local storageRuss Cox
Returns R14 and R15 to the available register pool. Plays more nicely with ELF ABI C code. In particular, our signal handlers will no longer crash when a signal arrives during execution of a cgo C call. Fixes #720. R=ken2, r CC=golang-dev https://golang.org/cl/1847051
2010-07-21ld: various bug fixesRuss Cox
Fixes #937. Fixes #938. Fixes #939. Fixes #940. R=r CC=golang-dev https://golang.org/cl/1886043
2010-07-165l, 6l, 8l: reject invalid input filesRuss Cox
Fixes #925. Fixes #926. Fixes #927. Fixes #928. Fixes #929. Fixes #930. R=r CC=golang-dev https://golang.org/cl/1752044
2010-06-30cgo: use slash-free relative paths for .so referencesRuss Cox
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 #857. R=iant, r CC=golang-dev https://golang.org/cl/1700048
2010-06-21ld: add -u flag to check safe bits; discard old -u, -x flagsRuss Cox
R=r, r2 CC=golang-dev https://golang.org/cl/1707043
2010-06-07runtime: finish pchw -> tiny, added gettime for tinyDaniel Theophanes
R=rsc CC=golang-dev https://golang.org/cl/1514041
2010-04-29rename GOOS=mingw to GOOS=windowsAlex Brainman
R=rsc, Joe Poirier CC=golang-dev https://golang.org/cl/1015043
2010-04-22runtime: closures, defer bug fix for Native ClientRuss Cox
Enable package tests for Native Client build. R=r CC=golang-dev https://golang.org/cl/957042
2010-02-26Add -r option to 6l/8l/5l.Ian Lance Taylor
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 https://golang.org/cl/223068
2010-02-08*l/*c: add -V flag to display version numberAndrew Gerrand
R=rsc CC=golang-dev https://golang.org/cl/204044
2010-02-03search for runtime.a in the package path instead of hardcodingKai Backman
the location. remove last remnants of broken -l flag. R=rsc CC=golang-dev https://golang.org/cl/201042
2010-02-03ld: include main and runtime in the library loopRuss Cox
Fixes #585. R=r CC=golang-dev https://golang.org/cl/195075
2010-01-255l, 6l, 8l: accept only one object fileRuss Cox
(package main; others are pulled in automatically) R=ken2 CC=golang-dev https://golang.org/cl/194069
2010-01-25ld: do not load the same object file multiple times.Russ Cox
eliminates spurious multiple initialization errors. give more information in the multiple init errors that remain. Fixes #87. R=r CC=golang-dev https://golang.org/cl/194052
2010-01-22eliminate the package global name space assumption in object filesRuss Cox
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 https://golang.org/cl/186263
2010-01-13runtime: add demo running Go on raw (emulated) hwRuss Cox
8l: add GOOS=pchw, stop spelling out all the elf numbers. R=r CC=golang-dev https://golang.org/cl/186144
2009-12-138l: add support for PE output.Hector Chu
R=rsc https://golang.org/cl/166080