From 644a512e560147324ecf74ebce5e336bc57dd7bf Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Tue, 25 Aug 2020 16:00:44 -0700 Subject: symbols: Change implementation details of DECLARE_OPTIONAL_REGION() It seems that GCC's LTO doesn't like the way we implement DECLARE_OPTIONAL_REGION(). This patch changes it so that rather than having a normal DECLARE_REGION() in and then an extra DECLARE_OPTIONAL_REGION() in the C file using it, you just say DECLARE_OPTIONAL_REGION() directly in (in place and instead of the usual DECLARE_REGION()). This basically looks the same way in the resulting object file but somehow LTO seems to like it better. Signed-off-by: Julius Werner Change-Id: I6096207b311d70c8e9956cd9406bec45be04a4a2 Reviewed-on: https://review.coreboot.org/c/coreboot/+/44791 Tested-by: build bot (Jenkins) Reviewed-by: Jacob Garber Reviewed-by: Hung-Te Lin Reviewed-by: HAOUAS Elyes --- src/arch/arm/armv7/mmu.c | 3 --- src/arch/arm/tables.c | 2 -- 2 files changed, 5 deletions(-) (limited to 'src/arch/arm') diff --git a/src/arch/arm/armv7/mmu.c b/src/arch/arm/armv7/mmu.c index 51b4860768..66ce53392d 100644 --- a/src/arch/arm/armv7/mmu.c +++ b/src/arch/arm/armv7/mmu.c @@ -87,9 +87,6 @@ typedef uint32_t pte_t; static pte_t *const ttb_buff = (void *)_ttb; -/* Not all boards want to use subtables and declare them in memlayout.ld. */ -DECLARE_OPTIONAL_REGION(ttb_subtables); - static struct { pte_t value; const char *name; diff --git a/src/arch/arm/tables.c b/src/arch/arm/tables.c index 3b47a5bf0c..0c68fc7c51 100644 --- a/src/arch/arm/tables.c +++ b/src/arch/arm/tables.c @@ -11,8 +11,6 @@ void arch_write_tables(uintptr_t coreboot_table) void bootmem_arch_add_ranges(void) { - DECLARE_OPTIONAL_REGION(ttb_subtables); - bootmem_add_range((uintptr_t)_ttb, REGION_SIZE(ttb), BM_MEM_RAMSTAGE); bootmem_add_range((uintptr_t)_ttb_subtables, REGION_SIZE(ttb_subtables), BM_MEM_RAMSTAGE); -- cgit v1.2.3