]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: load runtime.goarm as a byte, not a word
authorDave Cheney <dave@cheney.net>
Sun, 29 Dec 2013 04:25:34 +0000 (15:25 +1100)
committerDave Cheney <dave@cheney.net>
Sun, 29 Dec 2013 04:25:34 +0000 (15:25 +1100)
Fixes #6952.

runtime.asminit was incorrectly loading runtime.goarm as a word, not a uint8 which made it subject to alignment issues on arm5 platforms.

Alignment aside, this also meant that the top 3 bytes in R11 would have been garbage and could not be assumed to be setting up the FPU reliably.

R=iant, minux.ma
CC=golang-codereviews
https://golang.org/cl/46240043

src/pkg/runtime/asm_arm.s

index a9ccfbe508c51637f799d2cabcb33b4c99473149..fa5540bdf0b90f8fd32cbaa3bd26668bd9c9bcc0 100644 (file)
@@ -91,7 +91,7 @@ TEXT runtime·breakpoint(SB),NOSPLIT,$0-0
 
 TEXT runtime·asminit(SB),NOSPLIT,$0-0
        // disable runfast (flush-to-zero) mode of vfp if runtime.goarm > 5
-       MOVW    runtime·goarm(SB), R11
+       MOVB    runtime·goarm(SB), R11
        CMP     $5, R11
        BLE     4(PC)
        WORD    $0xeef1ba10     // vmrs r11, fpscr