2013-04-24 Niels Möller <nisse@lysator.liu.se>
+ * x86_64/memxor.asm: Added nettle_ prefix to symbols.
+ * arm/memxor.asm: Likewise.
+
+ * testsuite/symbols-test: Don't allow memxor functions without
+ nettle prefix,
+
+ * memxor.h (memxor3): Added name mangling to add "nettle_" prefix
+ to memxor and memxor3 symbols.
+
* Makefile.in (nettle_OBJS): Deleted $(LIBOBJS), and also deleted
LIBOBJS substitution.
(nettle_SOURCES): Added memxor.c, to include it in the library
C memxor(uint8_t *dst, const uint8_t *src, size_t n)
.align 4
-PROLOGUE(memxor)
+PROLOGUE(nettle_memxor)
cmp N, #0
beq .Lmemxor_done
beq .Lmemxor_done
b .Lmemxor_bytes
-EPILOGUE(memxor)
+EPILOGUE(nettle_memxor)
define(<DST>, <r0>)
define(<AP>, <r1>)
C memxor3(uint8_t *dst, const uint8_t *a, const uint8_t *b, size_t n)
.align 2
-PROLOGUE(memxor3)
+PROLOGUE(nettle_memxor3)
cmp N, #0
beq .Lmemxor3_ret
add AP, AP, ACNT, lsr #3
add BP, BP, BCNT, lsr #3
b .Lmemxor3_bytes
-EPILOGUE(memxor3)
+EPILOGUE(nettle_memxor3)
extern "C" {
#endif
+/* Name mangling */
+#define memxor nettle_memxor
+#define memxor3 nettle_memxor3
+
uint8_t *memxor(uint8_t *dst, const uint8_t *src, size_t n);
uint8_t *memxor3(uint8_t *dst, const uint8_t *a, const uint8_t *b, size_t n);
# code.
( $NM -g ../libnettle.a || $NM ../libnettle.a ) \
- | grep ' [DRT] ' | egrep -v '( |^)\.?_?(_?nettle_|memxor)|get_pc_thunk' \
+ | grep ' [DRT] ' | egrep -v '( |^)\.?_?(_?nettle_)|get_pc_thunk' \
| sort -k3 > test1.out
if [ -s test1.out ] ; then
C %rdi %rsi %rdx
ALIGN(16)
-PROLOGUE(memxor)
+PROLOGUE(nettle_memxor)
W64_ENTRY(3, 0)
mov %rdx, %r10
mov %rdi, %rdx
jmp .Lmemxor3_entry
-EPILOGUE(memxor)
+EPILOGUE(nettle_memxor)
C memxor3(uint8_t *dst, const uint8_t *a, const uint8_t *b, size_t n)
C %rdi %rsi %rdx %rcx
ALIGN(16)
-PROLOGUE(memxor3)
+PROLOGUE(nettle_memxor3)
W64_ENTRY(4, 0)
C %cl needed for shift count, so move away N
mov %rcx, N
>)
-EPILOGUE(memxor3)
+EPILOGUE(nettle_memxor3)