Some newer Linux distributions (Ubuntu ARM at least) use a new multiarch
directory organization, where dynamic linker is no longer in the hardcoded
path in our linker.
For example, Ubuntu 12.04 ARM hardfloat places its dynamic linker at
/lib/arm-linux-gnueabihf/ld-linux.so.3
Ref: http://lackof.org/taggart/hacking/multiarch/
Also, to support Debian GNU/kFreeBSD as a FreeBSD variant, we need this capability, so it's part of issue 3533.
This CL add a new pragma (#pragma dynlinker "path") to cc.
R=iant, rsc
CC=golang-dev
https://golang.org/cl/6086043
Part 1 of CL 5601044 (cgo: Linux/ARM support)
Limitation: doesn't support thumb library yet.
R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/5991065
This leads to ~30kB improvement on code size for ARM machines with VFP/NEON.
Example: go test -c math
GOARM=5 GOARM=6
Old: 1884200 1839144
New: 1884165 1805245
-: 35 33899
R=rsc, bradfitz, dave, kai.backman
CC=golang-dev
https://golang.org/cl/5975060
Using reg as the flag word was unfortunate, since the
default value is not 0 but NREG (==16), which happens
to be the bit NOPTR now. Clear it.
If I say this will fix the build, it won't.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5690072
dodata will convert to SNOPTRDATA if appropriate.
Should fix arm build (hope springs eternal).
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/5687074
cc: add #pragma textflag to set it
runtime: mark mheap to go into noptr-bss.
remove special case in garbage collector
Remove the ARM from.flag field created by CL 5687044.
The DUPOK flag was already in p->reg, so keep using that.
Otherwise test/nilptr.go creates a very large binary.
Should fix the arm build.
Diagnosed by minux.ma; replacement for CL 5690044.
R=golang-dev, minux.ma, r
CC=golang-dev
https://golang.org/cl/5686060
ARM doesn't have the concept of scale, so I renamed the field
Addr.scale to Addr.flag to better reflect its true meaning.
R=rsc
CC=golang-dev
https://golang.org/cl/5687044
The garbage collector can avoid scanning this section, with
reduces collection time as well as the number of false positives.
Helps a little bit with issue 909, but certainly does not solve it.
R=ken2
CC=golang-dev
https://golang.org/cl/5671099
As a convenience to people working on the tools,
leave Makefiles that invoke the go dist tool appropriately.
They are not used during the build.
R=golang-dev, bradfitz, n13m3y3r, gustavo
CC=golang-dev
https://golang.org/cl/5636050
5l -v is for benchmarking various parts of the loader, but this code in
obj.c will clutter the output. I only comment them out, because this is
on par with 8l/6l.
R=golang-dev
CC=golang-dev
https://golang.org/cl/5600046
Also delete gotest, since it's messy to fix and slated for deletion anyway.
A couple of things outside src can't be tested any more. "go test" will be
fixed and these tests will be re-enabled. They're noisy for now.
Fixes#284.
R=rsc
CC=golang-dev
https://golang.org/cl/5598049
To allow these types as map keys, we must fill in
equal and hash functions in their algorithm tables.
Structs or arrays that are "just memory", like [2]int,
can and do continue to use the AMEM algorithm.
Structs or arrays that contain special values like
strings or interface values use generated functions
for both equal and hash.
The runtime helper func runtime.equal(t, x, y) bool handles
the general equality case for x == y and calls out to
the equal implementation in the algorithm table.
For short values (<= 4 struct fields or array elements),
the sequence of elementwise comparisons is inlined
instead of calling runtime.equal.
R=ken, mpimenov
CC=golang-dev
https://golang.org/cl/5451105
If the length of the interpreter string
pushes us over the ELFRESERVE limit, the
resulting error message will be comical.
I was doing some ELF tinkering with a
modified version of 8l when I hit this.
To be clear, the stock linkers wouldn't
hit this without adding about forty more
section headers. We're safe for now. ;)
Also, remove a redundant call to cflush.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5268044
This requires making the .dynamic section writable, as the
dynamic linker will change the value of the DT_DEBUG tag at
runtime. The DT_DEBUG tag is used by gdb to find all loaded
shared libraries.
R=rsc
CC=golang-dev
https://golang.org/cl/5189044
The dynamic ELF sections were pointing to the proper data,
but that data was already owned by the rodata and text sections.
Some ELF references explicitly prohibit multiple sections from
owning the same data, and strip behaves accordingly.
The data for these sections was moved out and their ranges are
now owned by their respective sections. This change makes strip
happy both with and without -s being provided at link time.
A test was added in debug/elf to ensure there are no regressions
on this area in the future.
Fixes#1242.
Fixes#2022.
NOTE: Tested on Linux amd64/386/arm only.
R=rsc
CC=golang-dev
https://golang.org/cl/4808043
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
Per the TIS ELF spec, if a PHDR entry is present in the
program header table, it must be part of the memory image of
the program. Failure to do this makes elflint complain, and
causes some tools that manipulate ELF to crash.
R=iant, rsc
CC=dave, golang-dev
https://golang.org/cl/4650067
The gosymtab and gopclntab sections were pointing to the proper
data, but that data was already owned by the rodata section.
Some ELF references explicitly prohibit multiple sections from
owning the same data, and strip behaves accordingly.
The data for these sections was moved to after rodata, and the
gosymtab and gopclntab sections now own their respective ranges.
This change makes strip happy both with and without -s being
provided at link time. Note that it won't remove these sections
because they are still allocated, and that's by design since
they are necessary at runtime for generating proper backtraces
and similar introspection operations.
Unlike the previous behavior, -s will now maintain zero-sized
gosymtab and gopclntab sections. This makes the implementation
slightly cleaner.
Fixes#1242.
NOTE: Tested on Linux amd64/386/arm only.
R=ality, rsc
CC=golang-dev
https://golang.org/cl/4639077
Thumb code and ARM pre-V4 code is unused,
unmaintained, and almost certainly wrong by now.
Every time I try to change 5l I have to sort out
what's dead code and what's not.
30% of lines of code in this directory deleted.
R=ken2
CC=golang-dev
https://golang.org/cl/4601049
5a: add SQRTF and SQRTD
5l: add ASQRTF and ASQRTD
Use ARMv7 VFP VSQRT instruction to speed up math.Sqrt
R=rsc, dave, m
CC=golang-dev
https://golang.org/cl/4551082
I started looking at this code because the nm in GNU
binutils was ignoring the first symbol in the .symtab
section. Apparently, the System V ABI reserves the
first entry and requires all fields inside to be set
to zero.
The list of changes is as follows:
· reserve the first symbol entry (as noted above)
· fix the section indices for .data and .bss symbols
· factor out common code for Elf32 and Elf64
· remove the special case for elfsymo in [568]l/asm.c:/^asmb
· add the "etext" symbol in 6l
· add static symbols
R=rsc
CC=golang-dev
https://golang.org/cl/4524075