Commit 7a25747571987687cdd7ab0a7fd5ce91a9cf122e

Guillem Jover 2014-07-19T16:49:55

build: Add weak_alias definition

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/sha2.c b/src/sha2.c
index 26b2052..b4f72e5 100644
--- a/src/sha2.c
+++ b/src/sha2.c
@@ -39,6 +39,12 @@
 #include <string.h>
 #include <sha2.h>
 
+#define _C_LABEL_STRING(x)	x
+
+#define	__weak_alias(alias,sym)						\
+	__asm(".weak " _C_LABEL_STRING(#alias) "\n"			\
+		_C_LABEL_STRING(#alias) " = " _C_LABEL_STRING(#sym));
+
 /*
  * UNROLLED TRANSFORM LOOP NOTE:
  * You can define SHA2_UNROLL_TRANSFORM to use the unrolled transform