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
* -Hlinux -Tx -Rx is linux elf
*/
-static char*
-linkername[] =
-{
- "runtime.softfloat",
- "math.sqrtGoC",
-};
-
void
usage(void)
{
void
main(int argc, char *argv[])
{
- int c, i;
+ int c;
char *p, *name, *val;
Binit(&bso, 1, OWRITE);
loadlib();
// mark some functions that are only referenced after linker code editing
- // TODO(kaib): this doesn't work, the prog can't be found in runtime
- for(i=0; i<nelem(linkername); i++)
- mark(lookup(linkername[i], 0));
+ if(debug['F'])
+ mark(rlookup("_sfloat", 0));
deadcode();
if(textp == nil) {
diag("no code");
MOVW $1234, R0
MOVW $1000, R1
MOVW R0, (R1) // fail hard
- B runtime·_dep_dummy(SB) // Never reached
-
-// TODO(kaib): remove these once i actually understand how the linker removes symbols
-// pull in dummy dependencies
-TEXT runtime·_dep_dummy(SB),7,$0
- BL _div(SB)
- BL _divu(SB)
- BL _mod(SB)
- BL _modu(SB)
- BL _modu(SB)
- BL _sfloat(SB)
TEXT runtime·breakpoint(SB),7,$0
// no breakpoint yet; let program exit