]> Cypherpunks repositories - gostls13.git/commitdiff
5l, runtime: remove softfloat emulation code when not used
authorShenghou Ma <minux.ma@gmail.com>
Tue, 10 Apr 2012 20:11:27 +0000 (04:11 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Tue, 10 Apr 2012 20:11:27 +0000 (04:11 +0800)
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

src/cmd/5l/obj.c
src/pkg/runtime/asm_arm.s

index a3f81616018af745a8aadec62d8285c538d18871..fe6bc2e7e170b285764a90f902fb6926727ce635 100644 (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");
index 423fda7a0c25da2fc46787f6923c6fdf353486e6..489a3474001e095dcb0df5ccdc17e00cae1f0f79 100644 (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