Commit 759bbb3e authored by Niels Möller's avatar Niels Möller

Added nettle_ prefix to memxor symbols.

parent 6223175f
2013-04-24 Niels Möller <nisse@lysator.liu.se> 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 * Makefile.in (nettle_OBJS): Deleted $(LIBOBJS), and also deleted
LIBOBJS substitution. LIBOBJS substitution.
(nettle_SOURCES): Added memxor.c, to include it in the library (nettle_SOURCES): Added memxor.c, to include it in the library
......
...@@ -41,7 +41,7 @@ define(<TNC>, <r12>) ...@@ -41,7 +41,7 @@ define(<TNC>, <r12>)
C memxor(uint8_t *dst, const uint8_t *src, size_t n) C memxor(uint8_t *dst, const uint8_t *src, size_t n)
.align 4 .align 4
PROLOGUE(memxor) PROLOGUE(nettle_memxor)
cmp N, #0 cmp N, #0
beq .Lmemxor_done beq .Lmemxor_done
...@@ -214,7 +214,7 @@ PROLOGUE(memxor) ...@@ -214,7 +214,7 @@ PROLOGUE(memxor)
beq .Lmemxor_done beq .Lmemxor_done
b .Lmemxor_bytes b .Lmemxor_bytes
EPILOGUE(memxor) EPILOGUE(nettle_memxor)
define(<DST>, <r0>) define(<DST>, <r0>)
define(<AP>, <r1>) define(<AP>, <r1>)
...@@ -231,7 +231,7 @@ define(<BTNC>, <r12>) ...@@ -231,7 +231,7 @@ define(<BTNC>, <r12>)
C memxor3(uint8_t *dst, const uint8_t *a, const uint8_t *b, size_t n) C memxor3(uint8_t *dst, const uint8_t *a, const uint8_t *b, size_t n)
.align 2 .align 2
PROLOGUE(memxor3) PROLOGUE(nettle_memxor3)
cmp N, #0 cmp N, #0
beq .Lmemxor3_ret beq .Lmemxor3_ret
...@@ -485,4 +485,4 @@ PROLOGUE(memxor3) ...@@ -485,4 +485,4 @@ PROLOGUE(memxor3)
add AP, AP, ACNT, lsr #3 add AP, AP, ACNT, lsr #3
add BP, BP, BCNT, lsr #3 add BP, BP, BCNT, lsr #3
b .Lmemxor3_bytes b .Lmemxor3_bytes
EPILOGUE(memxor3) EPILOGUE(nettle_memxor3)
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
extern "C" { extern "C" {
#endif #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 *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); uint8_t *memxor3(uint8_t *dst, const uint8_t *a, const uint8_t *b, size_t n);
......
...@@ -17,7 +17,7 @@ fi ...@@ -17,7 +17,7 @@ fi
# code. # code.
( $NM -g ../libnettle.a || $NM ../libnettle.a ) \ ( $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 | sort -k3 > test1.out
if [ -s test1.out ] ; then if [ -s test1.out ] ; then
......
...@@ -38,18 +38,18 @@ define(<USE_SSE2>, <no>) ...@@ -38,18 +38,18 @@ define(<USE_SSE2>, <no>)
C %rdi %rsi %rdx C %rdi %rsi %rdx
ALIGN(16) ALIGN(16)
PROLOGUE(memxor) PROLOGUE(nettle_memxor)
W64_ENTRY(3, 0) W64_ENTRY(3, 0)
mov %rdx, %r10 mov %rdx, %r10
mov %rdi, %rdx mov %rdi, %rdx
jmp .Lmemxor3_entry 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 memxor3(uint8_t *dst, const uint8_t *a, const uint8_t *b, size_t n)
C %rdi %rsi %rdx %rcx C %rdi %rsi %rdx %rcx
ALIGN(16) ALIGN(16)
PROLOGUE(memxor3) PROLOGUE(nettle_memxor3)
W64_ENTRY(4, 0) W64_ENTRY(4, 0)
C %cl needed for shift count, so move away N C %cl needed for shift count, so move away N
mov %rcx, N mov %rcx, N
...@@ -258,4 +258,4 @@ ifelse(USE_SSE2, yes, < ...@@ -258,4 +258,4 @@ ifelse(USE_SSE2, yes, <
>) >)
EPILOGUE(memxor3) EPILOGUE(nettle_memxor3)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment