|
|
4e0e09 |
From 9985cbbf4073ce9d0beec66bf702db9123758852 Mon Sep 17 00:00:00 2001
|
|
|
4e0e09 |
From: Peter Jones <pjones@redhat.com>
|
|
|
4e0e09 |
Date: Wed, 29 May 2019 10:11:24 -0400
|
|
|
4e0e09 |
Subject: [PATCH 21/63] Fix up efi_guid_cmp()'s alignment problem a different
|
|
|
4e0e09 |
way
|
|
|
4e0e09 |
|
|
|
4e0e09 |
With the prior fix for efi_guid_cmp()'s alignment issue, abicheck shows:
|
|
|
4e0e09 |
|
|
|
4e0e09 |
1 function with some indirect sub-type change:
|
|
|
4e0e09 |
|
|
|
4e0e09 |
[C]'function int efi_guid_cmp(void* const, void* const)' at <built-in>:34:1 has some indirect sub-type changes:
|
|
|
4e0e09 |
parameter 1 of type 'void* const' changed:
|
|
|
4e0e09 |
entity changed from 'void* const' to 'const efi_guid_t*'
|
|
|
4e0e09 |
type size hasn't changed
|
|
|
4e0e09 |
parameter 2 of type 'void* const' changed:
|
|
|
4e0e09 |
entity changed from 'void* const' to 'const efi_guid_t*'
|
|
|
4e0e09 |
type size hasn't changed
|
|
|
4e0e09 |
|
|
|
4e0e09 |
While this isn't a meaningful ABI difference in terms of linking, it is
|
|
|
4e0e09 |
definitely worse than having the type actually specified.
|
|
|
4e0e09 |
|
|
|
4e0e09 |
This patch changes the type back to the previous type, but also changes
|
|
|
4e0e09 |
the typedef to require a 1-byte alignment. This will guarantee that all
|
|
|
4e0e09 |
new builds of efi_guid_cmp() and related code have code generated in a
|
|
|
4e0e09 |
way that's compatible with any alignment, thus alleviating the issue.
|
|
|
4e0e09 |
|
|
|
4e0e09 |
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
|
4e0e09 |
---
|
|
|
4e0e09 |
src/guid.c | 2 +-
|
|
|
4e0e09 |
src/include/efivar/efivar.h | 4 ++--
|
|
|
4e0e09 |
2 files changed, 3 insertions(+), 3 deletions(-)
|
|
|
4e0e09 |
|
|
|
4e0e09 |
diff --git a/src/guid.c b/src/guid.c
|
|
|
4e0e09 |
index 3156b3b7c60..306c9ff8287 100644
|
|
|
4e0e09 |
--- a/src/guid.c
|
|
|
4e0e09 |
+++ b/src/guid.c
|
|
|
4e0e09 |
@@ -31,7 +31,7 @@
|
|
|
4e0e09 |
extern const efi_guid_t efi_guid_zero;
|
|
|
4e0e09 |
|
|
|
4e0e09 |
int NONNULL(1, 2) PUBLIC
|
|
|
4e0e09 |
-efi_guid_cmp(const void * const a, const void * const b)
|
|
|
4e0e09 |
+efi_guid_cmp(const efi_guid_t *a, const efi_guid_t *b)
|
|
|
4e0e09 |
{
|
|
|
4e0e09 |
return memcmp(a, b, sizeof (efi_guid_t));
|
|
|
4e0e09 |
}
|
|
|
4e0e09 |
diff --git a/src/include/efivar/efivar.h b/src/include/efivar/efivar.h
|
|
|
4e0e09 |
index ff95cb10791..11d9a9d7b78 100644
|
|
|
4e0e09 |
--- a/src/include/efivar/efivar.h
|
|
|
4e0e09 |
+++ b/src/include/efivar/efivar.h
|
|
|
4e0e09 |
@@ -37,7 +37,7 @@ typedef struct {
|
|
|
4e0e09 |
uint16_t c;
|
|
|
4e0e09 |
uint16_t d;
|
|
|
4e0e09 |
uint8_t e[6];
|
|
|
4e0e09 |
-} efi_guid_t;
|
|
|
4e0e09 |
+} efi_guid_t __attribute__((__aligned__(1)));
|
|
|
4e0e09 |
|
|
|
4e0e09 |
typedef struct {
|
|
|
4e0e09 |
uint8_t addr[4];
|
|
|
4e0e09 |
@@ -128,7 +128,7 @@ extern int efi_symbol_to_guid(const char *symbol, efi_guid_t *guid)
|
|
|
4e0e09 |
|
|
|
4e0e09 |
extern int efi_guid_is_zero(const efi_guid_t *guid);
|
|
|
4e0e09 |
extern int efi_guid_is_empty(const efi_guid_t *guid);
|
|
|
4e0e09 |
-extern int efi_guid_cmp(const void * const a, const void * const b);
|
|
|
4e0e09 |
+extern int efi_guid_cmp(const efi_guid_t *a, const efi_guid_t *b);
|
|
|
4e0e09 |
|
|
|
4e0e09 |
/* import / export functions */
|
|
|
4e0e09 |
typedef struct efi_variable efi_variable_t;
|
|
|
4e0e09 |
--
|
|
|
4e0e09 |
2.26.2
|
|
|
4e0e09 |
|