For libm, use a macro for aliasing symbols.

Change-Id: Ibd42ebc387c2bf3eba9aa96091770915b4b34184
diff --git a/libc/private/bionic_asm.h b/libc/private/bionic_asm.h
index d53ebba..5fca222c 100644
--- a/libc/private/bionic_asm.h
+++ b/libc/private/bionic_asm.h
@@ -57,4 +57,8 @@
     ENTRY(f); \
     .hidden f \
 
+#define ALIAS_SYMBOL(alias, original) \
+    .globl alias; \
+    .equ alias, original
+
 #endif /* _PRIVATE_BIONIC_ASM_H_ */
diff --git a/libm/arm/e_sqrt.S b/libm/arm/e_sqrt.S
index 669212f..17312f5 100644
--- a/libm/arm/e_sqrt.S
+++ b/libm/arm/e_sqrt.S
@@ -39,7 +39,4 @@
     bx          lr
 END(sqrt)
 
-#if LDBL_MANT_DIG == 53
-    .weak       sqrtl
-    .equ        sqrtl, sqrt
-#endif
+ALIAS_SYMBOL(sqrtl, sqrt);
diff --git a/libm/arm/s_floor.S b/libm/arm/s_floor.S
index 4405358..3af8f76 100644
--- a/libm/arm/s_floor.S
+++ b/libm/arm/s_floor.S
@@ -136,7 +136,4 @@
 
 END(floor)
 
-#if LDBL_MANT_DIG == 53
-        .weak           floorl
-        .equ            floorl,floor
-#endif
+ALIAS_SYMBOL(floorl, floor);
diff --git a/libm/arm64/lrint.S b/libm/arm64/lrint.S
index 69cc10c..d642759 100644
--- a/libm/arm64/lrint.S
+++ b/libm/arm64/lrint.S
@@ -29,8 +29,6 @@
 END(lrintf)
 
 // sizeof(long) and sizeof(long long) are the same for aarch64
-.weak llrint
-.equ llrint,lrint
+ALIAS_SYMBOL(llrint, lrint);
 
-.weak llrintf
-.equ llrintf,lrintf
+ALIAS_SYMBOL(llrintf, lrintf);
diff --git a/libm/x86/ceil.S b/libm/x86/ceil.S
index b992057..6302037 100644
--- a/libm/x86/ceil.S
+++ b/libm/x86/ceil.S
@@ -40,5 +40,4 @@
 	ret
 END(ceil)
 
-.globl ceill;
-.equ ceill, ceil;
+ALIAS_SYMBOL(ceill, ceil);
diff --git a/libm/x86/e_acos.S b/libm/x86/e_acos.S
index a429481..fa61853 100644
--- a/libm/x86/e_acos.S
+++ b/libm/x86/e_acos.S
@@ -388,8 +388,7 @@
 # -- End  acos
 
 # Start file scope ASM
-.weak acosl
-.equ acosl, acos
+ALIAS_SYMBOL(acosl, acos);
 # End file scope ASM
 	.section .rodata, "a"
 	.align 16
diff --git a/libm/x86/e_asin.S b/libm/x86/e_asin.S
index 99dfb68..5d7f331 100644
--- a/libm/x86/e_asin.S
+++ b/libm/x86/e_asin.S
@@ -466,8 +466,7 @@
 # -- End  asin
 
 # Start file scope ASM
-.weak asinl
-.equ asinl, asin
+ALIAS_SYMBOL(asinl, asin);
 # End file scope ASM
 	.section .rodata, "a"
 	.align 16
diff --git a/libm/x86/e_atan2.S b/libm/x86/e_atan2.S
index a6ad390..1efdf65 100644
--- a/libm/x86/e_atan2.S
+++ b/libm/x86/e_atan2.S
@@ -452,8 +452,7 @@
 # -- End  atan2
 
 # Start file scope ASM
-.weak atan2l
-.equ atan2l, atan2
+ALIAS_SYMBOL(atan2l, atan2);
 # End file scope ASM
 	.section .rodata, "a"
 	.align 16
diff --git a/libm/x86/e_cosh.S b/libm/x86/e_cosh.S
index 6942028..ecea8f4 100644
--- a/libm/x86/e_cosh.S
+++ b/libm/x86/e_cosh.S
@@ -272,8 +272,7 @@
 # -- End  cosh
 
 # Start file scope ASM
-.weak coshl
-.equ coshl, cosh
+ALIAS_SYMBOL(coshl, cosh);
 # End file scope ASM
 	.section .rodata, "a"
 	.align 16
diff --git a/libm/x86/e_exp.S b/libm/x86/e_exp.S
index c4fbe47..eab619d 100644
--- a/libm/x86/e_exp.S
+++ b/libm/x86/e_exp.S
@@ -257,8 +257,7 @@
 # -- End  exp
 
 # Start file scope ASM
-.weak expl
-.equ expl, exp
+ALIAS_SYMBOL(expl, exp);
 # End file scope ASM
 	.section .rodata, "a"
 	.align 16
diff --git a/libm/x86/e_hypot.S b/libm/x86/e_hypot.S
index aa6ab64..6a143e5 100644
--- a/libm/x86/e_hypot.S
+++ b/libm/x86/e_hypot.S
@@ -199,8 +199,7 @@
 # -- End  hypot
 
 # Start file scope ASM
-.weak hypotl
-.equ hypotl, hypot
+ALIAS_SYMBOL(hypotl, hypot);
 # End file scope ASM
 	.section .rodata, "a"
 	.align 16
diff --git a/libm/x86/e_log.S b/libm/x86/e_log.S
index b5df1ea..a6181ca 100644
--- a/libm/x86/e_log.S
+++ b/libm/x86/e_log.S
@@ -231,8 +231,7 @@
 # -- End  log
 
 # Start file scope ASM
-.weak logl
-.equ logl, log
+ALIAS_SYMBOL(logl, log);
 # End file scope ASM
 	.section .rodata, "a"
 	.align 16
diff --git a/libm/x86/e_log10.S b/libm/x86/e_log10.S
index d34829c..09b2952 100644
--- a/libm/x86/e_log10.S
+++ b/libm/x86/e_log10.S
@@ -242,8 +242,7 @@
 # -- End  log10
 
 # Start file scope ASM
-.weak log10l
-.equ log10l, log10
+ALIAS_SYMBOL(log10l, log10);
 # End file scope ASM
 	.section .rodata, "a"
 	.align 16
diff --git a/libm/x86/e_sinh.S b/libm/x86/e_sinh.S
index 9d28a31..d6b04b5 100644
--- a/libm/x86/e_sinh.S
+++ b/libm/x86/e_sinh.S
@@ -324,8 +324,7 @@
 # -- End  sinh
 
 # Start file scope ASM
-.weak sinhl
-.equ sinhl, sinh
+ALIAS_SYMBOL(sinhl, sinh);
 # End file scope ASM
 	.section .rodata, "a"
 	.align 16
diff --git a/libm/x86/floor.S b/libm/x86/floor.S
index 2b815f3..b859736 100644
--- a/libm/x86/floor.S
+++ b/libm/x86/floor.S
@@ -40,5 +40,4 @@
 	ret
 END(floor)
 
-.globl floorl;
-.equ floorl, floor;
+ALIAS_SYMBOL(floorl, floor);
diff --git a/libm/x86/s_atan.S b/libm/x86/s_atan.S
index 67d8c02..c4413f1 100644
--- a/libm/x86/s_atan.S
+++ b/libm/x86/s_atan.S
@@ -245,8 +245,7 @@
 # -- End  atan
 
 # Start file scope ASM
-.weak atanl
-.equ atanl, atan
+ALIAS_SYMBOL(atanl, atan);
 # End file scope ASM
 	.section .rodata, "a"
 	.align 16
diff --git a/libm/x86/s_cbrt.S b/libm/x86/s_cbrt.S
index d065de2..0c98c99 100644
--- a/libm/x86/s_cbrt.S
+++ b/libm/x86/s_cbrt.S
@@ -225,8 +225,7 @@
 # -- End  cbrt
 
 # Start file scope ASM
-.weak cbrtl
-.equ cbrtl, cbrt
+ALIAS_SYMBOL(cbrtl, cbrt);
 # End file scope ASM
 	.section .rodata, "a"
 	.align 16
diff --git a/libm/x86/s_cos.S b/libm/x86/s_cos.S
index 0f5d570..fd5ef5d 100644
--- a/libm/x86/s_cos.S
+++ b/libm/x86/s_cos.S
@@ -314,8 +314,7 @@
 # -- End  cos
 
 # Start file scope ASM
-.weak cosl
-.equ cosl, cos
+ALIAS_SYMBOL(cosl, cos);
 # End file scope ASM
 	.section .rodata, "a"
 	.align 16
diff --git a/libm/x86/s_expm1.S b/libm/x86/s_expm1.S
index 58819ef..1f21cde 100644
--- a/libm/x86/s_expm1.S
+++ b/libm/x86/s_expm1.S
@@ -365,8 +365,7 @@
 # -- End  expm1
 
 # Start file scope ASM
-.weak expm1l
-.equ expm1l, expm1
+ALIAS_SYMBOL(exmp1l, exmp1);
 # End file scope ASM
 	.section .rodata, "a"
 	.align 16
diff --git a/libm/x86/s_log1p.S b/libm/x86/s_log1p.S
index 76fb826..7a6d845 100644
--- a/libm/x86/s_log1p.S
+++ b/libm/x86/s_log1p.S
@@ -266,8 +266,7 @@
 # -- End  log1p
 
 # Start file scope ASM
-.weak log1pl
-.equ log1pl, log1p
+ALIAS_SYMBOL(log1pl, log1p);
 # End file scope ASM
 	.section .rodata, "a"
 	.align 16
diff --git a/libm/x86/s_sin.S b/libm/x86/s_sin.S
index a0578be..1e6cbd4 100644
--- a/libm/x86/s_sin.S
+++ b/libm/x86/s_sin.S
@@ -321,8 +321,7 @@
 # -- End  sin
 
 # Start file scope ASM
-.weak sinl
-.equ sinl, sin
+ALIAS_SYMBOL(sinl, sin);
 # End file scope ASM
 	.section .rodata, "a"
 	.align 16
diff --git a/libm/x86/s_tan.S b/libm/x86/s_tan.S
index 621c94a..3ee2107 100644
--- a/libm/x86/s_tan.S
+++ b/libm/x86/s_tan.S
@@ -284,8 +284,7 @@
 # -- End  tan
 
 # Start file scope ASM
-.weak tanl
-.equ tanl, tan
+ALIAS_SYMBOL(tanl, tan);
 # End file scope ASM
 	.section .rodata, "a"
 	.align 16
diff --git a/libm/x86/s_tanh.S b/libm/x86/s_tanh.S
index 3975fa9..737bcbb 100644
--- a/libm/x86/s_tanh.S
+++ b/libm/x86/s_tanh.S
@@ -278,8 +278,7 @@
 # -- End  tanh
 
 # Start file scope ASM
-.weak tanhl
-.equ tanhl, tanh
+ALIAS_SYMBOL(tanhl, tanh);
 # End file scope ASM
 	.section .rodata, "a"
 	.align 16
diff --git a/libm/x86/sqrt.S b/libm/x86/sqrt.S
index 3e459ce..c9d434d 100644
--- a/libm/x86/sqrt.S
+++ b/libm/x86/sqrt.S
@@ -40,5 +40,4 @@
 	ret
 END(sqrt)
 
-.globl sqrtl;
-.equ sqrtl, sqrt;
+ALIAS_SYMBOL(sqrtl, sqrt);
diff --git a/libm/x86/trunc.S b/libm/x86/trunc.S
index 2f21e88..da9d5fb 100644
--- a/libm/x86/trunc.S
+++ b/libm/x86/trunc.S
@@ -40,5 +40,4 @@
 	ret
 END(trunc)
 
-.globl truncl;
-.equ truncl, trunc;
+ALIAS_SYMBOL(truncl, trunc);