1
0
mirror of https://github.com/golang/go synced 2024-11-19 17:04:41 -07:00

5l, runtime: remove softfloat emulation code when not used

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
This commit is contained in:
Shenghou Ma 2012-04-11 04:11:27 +08:00
parent 2031252fb8
commit 1a59e6239c
2 changed files with 3 additions and 22 deletions

View File

@ -63,13 +63,6 @@ Header headers[] = {
* -Hlinux -Tx -Rx is linux elf
*/
static char*
linkername[] =
{
"runtime.softfloat",
"math.sqrtGoC",
};
void
usage(void)
{
@ -80,7 +73,7 @@ usage(void)
void
main(int argc, char *argv[])
{
int c, i;
int c;
char *p, *name, *val;
Binit(&bso, 1, OWRITE);
@ -250,9 +243,8 @@ main(int argc, char *argv[])
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");

View File

@ -58,17 +58,6 @@ TEXT _rt0_arm(SB),7,$-4
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