From 759bbb3e2736d5f0c87b08804d5025711fa2b2af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Wed, 24 Apr 2013 22:43:40 +0200 Subject: [PATCH] Added nettle_ prefix to memxor symbols. --- ChangeLog | 9 +++++++++ arm/memxor.asm | 8 ++++---- memxor.h | 4 ++++ testsuite/symbols-test | 2 +- x86_64/memxor.asm | 8 ++++---- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index d53197fd..cd6583a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2013-04-24 Niels Möller + * 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 diff --git a/arm/memxor.asm b/arm/memxor.asm index 33f672c6..b69e2f43 100644 --- a/arm/memxor.asm +++ b/arm/memxor.asm @@ -41,7 +41,7 @@ define(, ) 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 @@ -214,7 +214,7 @@ PROLOGUE(memxor) beq .Lmemxor_done b .Lmemxor_bytes -EPILOGUE(memxor) +EPILOGUE(nettle_memxor) define(, ) define(, ) @@ -231,7 +231,7 @@ define(, ) 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 @@ -485,4 +485,4 @@ PROLOGUE(memxor3) add AP, AP, ACNT, lsr #3 add BP, BP, BCNT, lsr #3 b .Lmemxor3_bytes -EPILOGUE(memxor3) +EPILOGUE(nettle_memxor3) diff --git a/memxor.h b/memxor.h index c9e563d4..2a6545ce 100644 --- a/memxor.h +++ b/memxor.h @@ -12,6 +12,10 @@ 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); diff --git a/testsuite/symbols-test b/testsuite/symbols-test index ec8f4918..4a97c25e 100755 --- a/testsuite/symbols-test +++ b/testsuite/symbols-test @@ -17,7 +17,7 @@ fi # 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 diff --git a/x86_64/memxor.asm b/x86_64/memxor.asm index b22a4721..2ac9df97 100644 --- a/x86_64/memxor.asm +++ b/x86_64/memxor.asm @@ -38,18 +38,18 @@ define(, ) 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 @@ -258,4 +258,4 @@ ifelse(USE_SSE2, yes, < >) -EPILOGUE(memxor3) +EPILOGUE(nettle_memxor3) -- GitLab