[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v18 06/25] libtasn1: Use grub_divmod64() for division
From: |
Gary Lin |
Subject: |
[PATCH v18 06/25] libtasn1: Use grub_divmod64() for division |
Date: |
Fri, 28 Jun 2024 16:18:49 +0800 |
Replace a 64 bit division with a call to grub_divmod64, preventing
creation of __udivdi3 calls on 32 bit platforms.
Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Gary Lin <glin@suse.com>
---
...tasn1-Use-grub_divmod64-for-division.patch | 30 +++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644
grub-core/lib/libtasn1-patches/0004-libtasn1-Use-grub_divmod64-for-division.patch
diff --git
a/grub-core/lib/libtasn1-patches/0004-libtasn1-Use-grub_divmod64-for-division.patch
b/grub-core/lib/libtasn1-patches/0004-libtasn1-Use-grub_divmod64-for-division.patch
new file mode 100644
index 000000000..a8f41cd74
--- /dev/null
+++
b/grub-core/lib/libtasn1-patches/0004-libtasn1-Use-grub_divmod64-for-division.patch
@@ -0,0 +1,30 @@
+From 52ad4fb6a023f27fdcea490d8e4956ce3957b1f9 Mon Sep 17 00:00:00 2001
+From: Gary Lin <glin@suse.com>
+Date: Tue, 25 Jun 2024 16:32:50 +0800
+Subject: [PATCH 4/6] libtasn1: Use grub_divmod64() for division
+
+Replace a 64 bit division with a call to grub_divmod64, preventing
+creation of __udivdi3 calls on 32 bit platforms.
+
+Signed-off-by: Daniel Axtens <dja@axtens.net>
+Signed-off-by: Gary Lin <glin@suse.com>
+---
+ grub-core/lib/libtasn1-grub/lib/parser_aux.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/grub-core/lib/libtasn1-grub/lib/parser_aux.c
b/grub-core/lib/libtasn1-grub/lib/parser_aux.c
+index c05bd2339..e4e4c0556 100644
+--- a/grub-core/lib/libtasn1-grub/lib/parser_aux.c
++++ b/grub-core/lib/libtasn1-grub/lib/parser_aux.c
+@@ -632,7 +632,7 @@ _asn1_ltostr (int64_t v, char str[LTOSTR_MAX_SIZE])
+ count = 0;
+ do
+ {
+- d = val / 10;
++ d = grub_divmod64(val, 10, NULL);
+ r = val - d * 10;
+ temp[start + count] = '0' + (char) r;
+ count++;
+--
+2.35.3
+
--
2.35.3
- [PATCH v18 00/25] Automatic Disk Unlock with TPM2, Gary Lin, 2024/06/28
- [PATCH v18 01/25] posix_wrap: tweaks in preparation for libtasn1, Gary Lin, 2024/06/28
- [PATCH v18 04/25] libtasn1: use bound-checked _asn1_str_cat(), Gary Lin, 2024/06/28
- [PATCH v18 02/25] libtasn1: import libtasn1-4.19.0, Gary Lin, 2024/06/28
- [PATCH v18 06/25] libtasn1: Use grub_divmod64() for division,
Gary Lin <=
- [PATCH v18 03/25] libtasn1: disable code not needed in grub, Gary Lin, 2024/06/28
- [PATCH v18 05/25] libtasn1: adjust the header paths in libtasn1.h, Gary Lin, 2024/06/28
- [PATCH v18 07/25] libtasn1: fix the potential buffer overrun, Gary Lin, 2024/06/28
- [PATCH v18 08/25] asn1_test: changes for grub compatibility, Gary Lin, 2024/06/28
- [PATCH v18 09/25] libtasn1: compile into asn1 module, Gary Lin, 2024/06/28
- [PATCH v18 10/25] asn1_test: test module for libtasn1, Gary Lin, 2024/06/28
- [PATCH v18 11/25] libtasn1: Add the documentation, Gary Lin, 2024/06/28
- [PATCH v18 12/25] key_protector: Add key protectors framework, Gary Lin, 2024/06/28