From 27cf24727c26874cbe61734d01074f6da077d1b9 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Sat, 8 Nov 2014 13:16:46 +0100 Subject: car globals: add "used" attribute Otherwise clang feels free to optimize away that variable (somewhat) and revive it in a different form inside .bss. They probably have the language lawyery excuse for why that's perfectly legal, so let's play it safe. (relevant URL, sorry ron: http://llvm.org/bugs/show_bug.cgi?id=9520) Change-Id: I603312ceea7207088dd29453cc8fb8f48c31af21 Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/7357 Reviewed-by: Edward O'Callaghan Tested-by: build bot (Jenkins) --- src/arch/x86/include/arch/early_variables.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/arch') diff --git a/src/arch/x86/include/arch/early_variables.h b/src/arch/x86/include/arch/early_variables.h index ea57d89de8..c850a8427d 100644 --- a/src/arch/x86/include/arch/early_variables.h +++ b/src/arch/x86/include/arch/early_variables.h @@ -23,7 +23,7 @@ #ifdef __PRE_RAM__ asm(".section .car.global_data,\"w\",@nobits"); asm(".previous"); -#define CAR_GLOBAL __attribute__((section(".car.global_data"))) +#define CAR_GLOBAL __attribute__((used,section(".car.global_data"))) #else #define CAR_GLOBAL #endif -- cgit v1.2.3