Emit redirector functions in a fixed order.

Otherwise the order changes each time, which will make the build
egregiously non-deterministic.

Change-Id: Idd501ecd118c61a27566eafc61157715e48758bc
Reviewed-on: https://boringssl-review.googlesource.com/15026
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/crypto/fipsmodule/delocate.go b/crypto/fipsmodule/delocate.go
index d099823..d8b5fb3 100644
--- a/crypto/fipsmodule/delocate.go
+++ b/crypto/fipsmodule/delocate.go
@@ -23,6 +23,7 @@
 	"fmt"
 	"os"
 	"path/filepath"
+	"sort"
 	"strconv"
 	"strings"
 	"unicode/utf8"
@@ -289,10 +290,16 @@
 	ret = append(ret, "BORINGSSL_bcm_text_end:")
 
 	// Emit redirector functions. Each is a single JMP instruction.
-	for redirectorName, target := range redirectors {
-		ret = append(ret, ".type "+redirectorName+", @function")
-		ret = append(ret, redirectorName+":")
-		ret = append(ret, "\tjmp "+target)
+	var redirectorNames []string
+	for name := range redirectors {
+		redirectorNames = append(redirectorNames, name)
+	}
+	sort.Strings(redirectorNames)
+
+	for _, name := range redirectorNames {
+		ret = append(ret, ".type "+name+", @function")
+		ret = append(ret, name+":")
+		ret = append(ret, "\tjmp "+redirectors[name])
 	}
 
 	// Emit BSS accessor functions. Each is a single LEA followed by RET.