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 <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/7357
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Tested-by: build bot (Jenkins)
This commit is contained in:
Patrick Georgi 2014-11-08 13:16:46 +01:00 committed by Patrick Georgi
parent 5560188849
commit 27cf24727c
1 changed files with 1 additions and 1 deletions

View File

@ -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