From df29f1ba6f4f81dbae704f1ab97c9f3044d3b930 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Sat, 18 Jan 2014 16:38:12 +0100 Subject: CAR_GLOBAL: Define section details once Improve clang compatibility by dropping an opaque hack The section attribute was only ever meant for specifying section names, not their properties - otherwise they would have provided section(name,attribute,class) instead of only section(name). The hack to add attribute and class to the name, and commenting out the "real" definitions inserted by the compiler (see the terminating "#"), is refused by clang developers. This is a cleaner implementation in that the section is first declared with its properties, then used later-on, expecting that later conflicting declarations are ignored. It can still break in two ways: 1. The assembler or linker could complain about a section declared in two different ways. 2. The assembler could just use the latest declaration, not the first, to determine the section's properties. I won't sort these out unless they actually happen. Change-Id: I4640b0fc397b301102dde6dc3ea1a078ce9edf1c Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/4716 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Aaron Durbin --- src/arch/x86/include/arch/early_variables.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (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 ba7df97059..ea1a133ae0 100644 --- a/src/arch/x86/include/arch/early_variables.h +++ b/src/arch/x86/include/arch/early_variables.h @@ -21,8 +21,12 @@ #define ARCH_EARLY_VARIABLES_H #ifdef __PRE_RAM__ -#define CAR_GLOBAL __attribute__((section(".car.global_data,\"w\",@nobits#"))) -#define CAR_CBMEM __attribute__((section(".car.cbmem_console,\"w\",@nobits#"))) +asm(".section .car.global_data,\"w\",@nobits"); +asm(".previous"); +asm(".section .car.cbmem_console,\"w\",@nobits"); +asm(".previous"); +#define CAR_GLOBAL __attribute__((section(".car.global_data"))) +#define CAR_CBMEM __attribute__((section(".car.cbmem_console"))) #else #define CAR_GLOBAL #define CAR_CBMEM -- cgit v1.2.3