<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">From 4bdd5ffde6386f2bb36b7144a8b02103c22c1038 Mon Sep 17 00:00:00 2001<br>From: Min Chen <<a href="mailto:chenm003@163.com">chenm003@163.com</a>><br>Date: Thu, 5 Dec 2024 22:32:27 -0800<br>Subject: [PATCH 2/3] Fix shared link issue (R_X86_64_PC32)<br><br>---<br> source/common/x86/cpu-a.asm | 7 +++++++<br> source/common/x86/pixel-util8.asm | 18 +++++++++++++++++-<br> 2 files changed, 24 insertions(+), 1 deletion(-)<br><br>diff --git a/source/common/x86/cpu-a.asm b/source/common/x86/cpu-a.asm<br>index 0930e142b..747b921f7 100644<br>--- a/source/common/x86/cpu-a.asm<br>+++ b/source/common/x86/cpu-a.asm<br>@@ -174,7 +174,14 @@ cglobal safe_intel_cpu_indicator_init<br> sub rsp, 32 ; shadow space<br> %endif<br> and rsp, ~31<br>+%if WIN64<br>+ lea rax, [intel_cpu_indicator_init]<br>+ call rax<br>+%elif UNIX64<br>+ call [rel intel_cpu_indicator_init wrt ..plt]<br>+%else<br> call intel_cpu_indicator_init<br>+%endif<br> leave<br> %if ARCH_X86_64<br> pop r14<br>diff --git a/source/common/x86/pixel-util8.asm b/source/common/x86/pixel-util8.asm<br>index 3f8c6be35..6ad2852d3 100644<br>--- a/source/common/x86/pixel-util8.asm<br>+++ b/source/common/x86/pixel-util8.asm<br>@@ -8484,7 +8484,13 @@ cglobal costCoeffNxN, 6,11,6<br> ; r4 - nonZero<br> ; r5 - scanFlagMask<br> ; r6 - sum<br>+<br>+%if UNIX64<br>+ mov r0, [private_prefix %+ _entropyStateBits wrt ..gotpc]<br>+%else<br> lea r0, [private_prefix %+ _entropyStateBits]<br>+ ;mov r0, private_prefix %+ _entropyStateBits<br>+%endif<br> mov r1, r6mp<br> xor r6d, r6d<br> xor r4d, r4d<br>@@ -8664,7 +8670,12 @@ cglobal costCoeffNxN, 6,10,5<br> ; r6 - sum<br> ; {r3,r4} - ctxSig[15-0]<br> ; r8m - (numNonZero != 0) || (subPosBase == 0)<br>+%if UNIX64<br>+ mov r0, [private_prefix %+ _entropyStateBits wrt ..gotpc]<br>+%else<br> lea r0, [private_prefix %+ _entropyStateBits]<br>+ ;mov r0, private_prefix %+ _entropyStateBits<br>+%endif<br> mov r1, r6mp<br> xor r6d, r6d<br> xor r8d, r8d<br>@@ -8903,7 +8914,12 @@ cglobal costC1C2Flag, 4,12,2<br> or r11d, 0x100 ; default value setting to 8<br> bsf r11d, r11d<br> <br>- lea r5, [private_prefix %+ _entropyStateBits]<br>+%if UNIX64<br>+ mov r5, [private_prefix %+ _entropyStateBits wrt ..gotpc]<br>+%else<br>+ lea r5, [private_prefix %+ _entropyStateBits]<br>+ ;mov r5, private_prefix %+ _entropyStateBits<br>+%endif<br> xor r6d, r6d<br> mov r4d, 0xFFFFFFF9<br> <br>-- <br>2.35.1.windows.2<br><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Dec 13, 2024 at 8:03 AM Pavan Tarun Chakka Venkata <<a href="mailto:pavan.tarun@multicorewareinc.com">pavan.tarun@multicorewareinc.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">From 4bdd5ffde6386f2bb36b7144a8b02103c22c1038 Mon Sep 17 00:00:00 2001<br>From: Test <<a href="mailto:test@test.com" target="_blank">test@test.com</a>><br>Date: Thu, 5 Dec 2024 22:32:27 -0800<br>Subject: [PATCH 2/3] Fix shared link issue (R_X86_64_PC32)<br><br>---<br> source/common/x86/cpu-a.asm | 7 +++++++<br> source/common/x86/pixel-util8.asm | 18 +++++++++++++++++-<br> 2 files changed, 24 insertions(+), 1 deletion(-)<br><br>diff --git a/source/common/x86/cpu-a.asm b/source/common/x86/cpu-a.asm<br>index 0930e142b..747b921f7 100644<br>--- a/source/common/x86/cpu-a.asm<br>+++ b/source/common/x86/cpu-a.asm<br>@@ -174,7 +174,14 @@ cglobal safe_intel_cpu_indicator_init<br> sub rsp, 32 ; shadow space<br> %endif<br> and rsp, ~31<br>+%if WIN64<br>+ lea rax, [intel_cpu_indicator_init]<br>+ call rax<br>+%elif UNIX64<br>+ call [rel intel_cpu_indicator_init wrt ..plt]<br>+%else<br> call intel_cpu_indicator_init<br>+%endif<br> leave<br> %if ARCH_X86_64<br> pop r14<br>diff --git a/source/common/x86/pixel-util8.asm b/source/common/x86/pixel-util8.asm<br>index 3f8c6be35..6ad2852d3 100644<br>--- a/source/common/x86/pixel-util8.asm<br>+++ b/source/common/x86/pixel-util8.asm<br>@@ -8484,7 +8484,13 @@ cglobal costCoeffNxN, 6,11,6<br> ; r4 - nonZero<br> ; r5 - scanFlagMask<br> ; r6 - sum<br>+<br>+%if UNIX64<br>+ mov r0, [private_prefix %+ _entropyStateBits wrt ..gotpc]<br>+%else<br> lea r0, [private_prefix %+ _entropyStateBits]<br>+ ;mov r0, private_prefix %+ _entropyStateBits<br>+%endif<br> mov r1, r6mp<br> xor r6d, r6d<br> xor r4d, r4d<br>@@ -8664,7 +8670,12 @@ cglobal costCoeffNxN, 6,10,5<br> ; r6 - sum<br> ; {r3,r4} - ctxSig[15-0]<br> ; r8m - (numNonZero != 0) || (subPosBase == 0)<br>+%if UNIX64<br>+ mov r0, [private_prefix %+ _entropyStateBits wrt ..gotpc]<br>+%else<br> lea r0, [private_prefix %+ _entropyStateBits]<br>+ ;mov r0, private_prefix %+ _entropyStateBits<br>+%endif<br> mov r1, r6mp<br> xor r6d, r6d<br> xor r8d, r8d<br>@@ -8903,7 +8914,12 @@ cglobal costC1C2Flag, 4,12,2<br> or r11d, 0x100 ; default value setting to 8<br> bsf r11d, r11d<br> <br>- lea r5, [private_prefix %+ _entropyStateBits]<br>+%if UNIX64<br>+ mov r5, [private_prefix %+ _entropyStateBits wrt ..gotpc]<br>+%else<br>+ lea r5, [private_prefix %+ _entropyStateBits]<br>+ ;mov r5, private_prefix %+ _entropyStateBits<br>+%endif<br> xor r6d, r6d<br> mov r4d, 0xFFFFFFF9<br> <br>-- <br>2.35.1.windows.2<br><br></div></div>
</blockquote></div>