aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2021-05-20 13:24:00 +0200
committerTom Rini <trini@konsulko.com>2021-05-24 14:21:30 -0400
commit98e55f97afc2a212185804e2c1130bebe980db73 (patch)
tree8d90b95bf8535624d1365ae7ba31f02791a02d50 /lib
parentead698acbc3077eab5b209276a512ddc7fefb6b8 (diff)
downloadu-boot-98e55f97afc2a212185804e2c1130bebe980db73.zip
u-boot-98e55f97afc2a212185804e2c1130bebe980db73.tar.gz
u-boot-98e55f97afc2a212185804e2c1130bebe980db73.tar.bz2
lib: crc32: put the crc_table variable into efi_runtime_rodata section
When compiling with LTO, the compiler fails with an error saying that `crc_table` causes a section type conflict with `efi_var_buf`. This is because both are declared to be in the same section (via macro `__efi_runtime_data`), but one is const while the other is not. Put this variable into the section .rodata.efi_runtime, instead of .data.efi_runtime, via macro __efi_runtime_rodata. Signed-off-by: Marek BehĂșn <marek.behun@nic.cz> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Heinrich Schuchardt <xypron.gpk@gmx.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/crc32.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/crc32.c b/lib/crc32.c
index e9be3bf..f2acc10 100644
--- a/lib/crc32.c
+++ b/lib/crc32.c
@@ -26,6 +26,7 @@
#ifdef USE_HOSTCC
#define __efi_runtime
#define __efi_runtime_data
+#define __efi_runtime_rodata
#endif
#define tole(x) cpu_to_le32(x)
@@ -88,7 +89,7 @@ static void __efi_runtime make_crc_table(void)
* Table of CRC-32's of all single-byte values (made by make_crc_table)
*/
-static const uint32_t __efi_runtime_data crc_table[256] = {
+static const uint32_t __efi_runtime_rodata crc_table[256] = {
tole(0x00000000L), tole(0x77073096L), tole(0xee0e612cL), tole(0x990951baL),
tole(0x076dc419L), tole(0x706af48fL), tole(0xe963a535L), tole(0x9e6495a3L),
tole(0x0edb8832L), tole(0x79dcb8a4L), tole(0xe0d5e91eL), tole(0x97d2d988L),