From 0c4bbda16abae83b5365a1ddd50625f54586b147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?okhowang=28=E7=8E=8B=E6=B2=9B=E6=96=87=29?= Date: Wed, 24 Jun 2020 16:02:10 +0800 Subject: [PATCH] Use local labels in padlock.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #3451 Signed-off-by: okhowang(王沛文) --- ChangeLog.d/bugfix_PR3452.txt | 3 +++ library/padlock.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 ChangeLog.d/bugfix_PR3452.txt diff --git a/ChangeLog.d/bugfix_PR3452.txt b/ChangeLog.d/bugfix_PR3452.txt new file mode 100644 index 000000000..acf593eb8 --- /dev/null +++ b/ChangeLog.d/bugfix_PR3452.txt @@ -0,0 +1,3 @@ +Bugfix + * Use local labels in mbedtls_padlock_has_support() to fix an invalid symbol redefinition if the function is inlined. + Reported in #3451 and fix contributed in #3452 by okhowang. diff --git a/library/padlock.c b/library/padlock.c index 887a386e8..96463b90b 100644 --- a/library/padlock.c +++ b/library/padlock.c @@ -54,10 +54,10 @@ int mbedtls_padlock_has_support( int feature ) "cpuid \n\t" "cmpl $0xC0000001, %%eax \n\t" "movl $0, %%edx \n\t" - "jb unsupported \n\t" + "jb 1f \n\t" "movl $0xC0000001, %%eax \n\t" "cpuid \n\t" - "unsupported: \n\t" + "1: \n\t" "movl %%edx, %1 \n\t" "movl %2, %%ebx \n\t" : "=m" (ebx), "=m" (edx)