summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2021-05-20 13:23:52 +0200
committerTom Rini <trini@konsulko.com>2021-05-24 14:21:30 -0400
commit236f2ec43266cb4dabd320381498df6c9d80c82d (patch)
tree3e49eddacb53d4ed87a3417d1b861b2be18402e2 /arch
parent9ce799aaba104a1f0d36bf84caec4c807fa31baa (diff)
downloadu-boot-236f2ec43266cb4dabd320381498df6c9d80c82d.tar.gz
u-boot-236f2ec43266cb4dabd320381498df6c9d80c82d.tar.xz
u-boot-236f2ec43266cb4dabd320381498df6c9d80c82d.zip
treewide: Convert macro and uses of __section(foo) to __section("foo")
This commit does the same thing as Linux commit 33def8498fdd. Use a more generic form for __section that requires quotes to avoid complications with clang and gcc differences. Remove the quote operator # from compiler_attributes.h __section macro. Convert all unquoted __section(foo) uses to quoted __section("foo"). Also convert __attribute__((section("foo"))) uses to __section("foo") even if the __attribute__ has multiple list entry forms. Signed-off-by: Marek BehĂșn <marek.behun@nic.cz> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/arm926ejs/spear/spl.c2
-rw-r--r--arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c2
-rw-r--r--arch/arm/cpu/armv8/spl_data.c4
-rw-r--r--arch/arm/include/asm/secure.h6
-rw-r--r--arch/arm/include/asm/setup.h2
-rw-r--r--arch/arm/lib/sections.c31
-rw-r--r--arch/arm/lib/spl.c2
-rw-r--r--arch/arm/mach-at91/spl.c2
-rw-r--r--arch/arm/mach-k3/am642_init.c2
-rw-r--r--arch/arm/mach-k3/am6_init.c2
-rw-r--r--arch/arm/mach-k3/j721e_init.c4
-rw-r--r--arch/arm/mach-mvebu/mbus.c4
-rw-r--r--arch/arm/mach-mvebu/timer.c2
-rw-r--r--arch/arm/mach-nexell/clock.c6
-rw-r--r--arch/arm/mach-nexell/timer.c6
-rw-r--r--arch/arm/mach-socfpga/spl_a10.c2
-rw-r--r--arch/arm/mach-sunxi/board.c2
-rw-r--r--arch/arm/mach-tegra/board.c2
-rw-r--r--arch/arm/mach-tegra/cboot.c8
-rw-r--r--arch/mips/mach-jz47xx/jz4780/jz4780.c2
-rw-r--r--arch/nds32/include/asm/setup.h6
-rw-r--r--arch/powerpc/include/asm/cache.h4
-rw-r--r--arch/riscv/cpu/cpu.c4
-rw-r--r--arch/sandbox/include/asm/getopt.h2
-rw-r--r--arch/sandbox/lib/sections.c9
-rw-r--r--arch/x86/cpu/coreboot/timestamp.c2
-rw-r--r--arch/x86/lib/coreboot/cb_sysinfo.c2
-rw-r--r--arch/x86/lib/sections.c9
-rw-r--r--arch/xtensa/cpu/cpu.c2
29 files changed, 68 insertions, 65 deletions
diff --git a/arch/arm/cpu/arm926ejs/spear/spl.c b/arch/arm/cpu/arm926ejs/spear/spl.c
index 08b98a2d06..b5b9945a87 100644
--- a/arch/arm/cpu/arm926ejs/spear/spl.c
+++ b/arch/arm/cpu/arm926ejs/spear/spl.c
@@ -22,7 +22,7 @@
* The BSS cannot be used for this purpose because it will be zeroed after
* having stored the pointer, so force the location to the data section.
*/
-u32 bootrom_stash_sp __attribute__((section(".data")));
+u32 bootrom_stash_sp __section(".data");
static void ddr_clock_init(void)
{
diff --git a/arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c b/arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c
index 4a4b3c6f23..28a7945207 100644
--- a/arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c
+++ b/arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c
@@ -13,7 +13,7 @@
#include <fsl_immap.h>
#include "fsl_epu.h"
-#define __secure __attribute__((section("._secure.text")))
+#define __secure __section("._secure.text")
#define CCSR_GICD_CTLR 0x1000
#define CCSR_GICC_CTLR 0x2000
diff --git a/arch/arm/cpu/armv8/spl_data.c b/arch/arm/cpu/armv8/spl_data.c
index 8fd986a67a..8f1231c86e 100644
--- a/arch/arm/cpu/armv8/spl_data.c
+++ b/arch/arm/cpu/armv8/spl_data.c
@@ -6,8 +6,8 @@
#include <common.h>
#include <spl.h>
-char __data_save_start[0] __section(.__data_save_start);
-char __data_save_end[0] __section(.__data_save_end);
+char __data_save_start[0] __section(".__data_save_start");
+char __data_save_end[0] __section(".__data_save_end");
u32 cold_reboot_flag = 1;
diff --git a/arch/arm/include/asm/secure.h b/arch/arm/include/asm/secure.h
index 64e5582c1f..c7b00be8e0 100644
--- a/arch/arm/include/asm/secure.h
+++ b/arch/arm/include/asm/secure.h
@@ -4,8 +4,8 @@
#include <config.h>
#include <asm/global_data.h>
-#define __secure __attribute__ ((section ("._secure.text")))
-#define __secure_data __attribute__ ((section ("._secure.data")))
+#define __secure __section("._secure.text")
+#define __secure_data __section("._secure.data")
#ifndef __ASSEMBLY__
@@ -22,7 +22,7 @@ typedef struct secure_svc_tbl {
*/
#define DECLARE_SECURE_SVC(_name, _id, _fn) \
static const secure_svc_tbl_t __secure_svc_ ## _name \
- __attribute__((used, section("._secure_svc_tbl_entries"))) \
+ __used __section("._secure_svc_tbl_entries") \
= { \
.id = _id, \
.func = _fn }
diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index 3a4e902af1..e0e2d7e360 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -235,7 +235,7 @@ struct tagtable {
int (*parse)(const struct tag *);
};
-#define __tag __attribute__((unused, __section__(".taglist")))
+#define __tag __attribute__((unused)) __section(".taglist")
#define __tagtable(tag, fn) \
static struct tagtable __tagtable_##fn __tag = { tag, fn }
diff --git a/arch/arm/lib/sections.c b/arch/arm/lib/sections.c
index 3bb2d8468c..857879711c 100644
--- a/arch/arm/lib/sections.c
+++ b/arch/arm/lib/sections.c
@@ -2,6 +2,7 @@
/*
* Copyright 2013 Albert ARIBAUD <albert.u.boot@aribaud.net>
*/
+#include <linux/compiler.h>
/**
* These two symbols are declared in a C file so that the linker
@@ -18,18 +19,18 @@
* aliasing warnings.
*/
-char __bss_start[0] __attribute__((section(".__bss_start")));
-char __bss_end[0] __attribute__((section(".__bss_end")));
-char __image_copy_start[0] __attribute__((section(".__image_copy_start")));
-char __image_copy_end[0] __attribute__((section(".__image_copy_end")));
-char __rel_dyn_start[0] __attribute__((section(".__rel_dyn_start")));
-char __rel_dyn_end[0] __attribute__((section(".__rel_dyn_end")));
-char __secure_start[0] __attribute__((section(".__secure_start")));
-char __secure_end[0] __attribute__((section(".__secure_end")));
-char __secure_stack_start[0] __attribute__((section(".__secure_stack_start")));
-char __secure_stack_end[0] __attribute__((section(".__secure_stack_end")));
-char __efi_runtime_start[0] __attribute__((section(".__efi_runtime_start")));
-char __efi_runtime_stop[0] __attribute__((section(".__efi_runtime_stop")));
-char __efi_runtime_rel_start[0] __attribute__((section(".__efi_runtime_rel_start")));
-char __efi_runtime_rel_stop[0] __attribute__((section(".__efi_runtime_rel_stop")));
-char _end[0] __attribute__((section(".__end")));
+char __bss_start[0] __section(".__bss_start");
+char __bss_end[0] __section(".__bss_end");
+char __image_copy_start[0] __section(".__image_copy_start");
+char __image_copy_end[0] __section(".__image_copy_end");
+char __rel_dyn_start[0] __section(".__rel_dyn_start");
+char __rel_dyn_end[0] __section(".__rel_dyn_end");
+char __secure_start[0] __section(".__secure_start");
+char __secure_end[0] __section(".__secure_end");
+char __secure_stack_start[0] __section(".__secure_stack_start");
+char __secure_stack_end[0] __section(".__secure_stack_end");
+char __efi_runtime_start[0] __section(".__efi_runtime_start");
+char __efi_runtime_stop[0] __section(".__efi_runtime_stop");
+char __efi_runtime_rel_start[0] __section(".__efi_runtime_rel_start");
+char __efi_runtime_rel_stop[0] __section(".__efi_runtime_rel_stop");
+char _end[0] __section(".__end");
diff --git a/arch/arm/lib/spl.c b/arch/arm/lib/spl.c
index b2b54f28fc..8e2bdf3536 100644
--- a/arch/arm/lib/spl.c
+++ b/arch/arm/lib/spl.c
@@ -26,7 +26,7 @@ DECLARE_GLOBAL_DATA_PTR;
* WARNING: This is going away very soon. Don't use it and don't submit
* pafches that rely on it. The global_data area is set up in crt0.S.
*/
-gd_t gdata __attribute__ ((section(".data")));
+gd_t gdata __section(".data");
#endif
/*
diff --git a/arch/arm/mach-at91/spl.c b/arch/arm/mach-at91/spl.c
index 156150c89c..8d537998c9 100644
--- a/arch/arm/mach-at91/spl.c
+++ b/arch/arm/mach-at91/spl.c
@@ -26,7 +26,7 @@ void at91_disable_wdt(void)
#include <asm/arch/sama5_boot.h>
struct {
u32 r4;
-} bootrom_stash __attribute__((section(".data")));
+} bootrom_stash __section(".data");
u32 spl_boot_device(void)
{
diff --git a/arch/arm/mach-k3/am642_init.c b/arch/arm/mach-k3/am642_init.c
index 885f181d58..a433702b4e 100644
--- a/arch/arm/mach-k3/am642_init.c
+++ b/arch/arm/mach-k3/am642_init.c
@@ -44,7 +44,7 @@ static void ctrl_mmr_unlock(void)
* it to the .data section.
*/
u32 bootindex __section(".data");
-static struct rom_extended_boot_data bootdata __section(.data);
+static struct rom_extended_boot_data bootdata __section(".data");
static void store_boot_info_from_rom(void)
{
diff --git a/arch/arm/mach-k3/am6_init.c b/arch/arm/mach-k3/am6_init.c
index d78d2b8751..425b3f93c8 100644
--- a/arch/arm/mach-k3/am6_init.c
+++ b/arch/arm/mach-k3/am6_init.c
@@ -77,7 +77,7 @@ static void ctrl_mmr_unlock(void)
* but the .bss is cleared between writing and reading this variable, so move
* it to the .data section.
*/
-u32 bootindex __attribute__((section(".data")));
+u32 bootindex __section(".data");
static void store_boot_index_from_rom(void)
{
diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c
index 1a4f796e5e..76a04a9035 100644
--- a/arch/arm/mach-k3/j721e_init.c
+++ b/arch/arm/mach-k3/j721e_init.c
@@ -125,8 +125,8 @@ void k3_mmc_restart_clock(void)
* but the .bss is cleared between writing and reading this variable, so move
* it to the .data section.
*/
-u32 bootindex __attribute__((section(".data")));
-static struct rom_extended_boot_data bootdata __section(.data);
+u32 bootindex __section(".data");
+static struct rom_extended_boot_data bootdata __section(".data");
static void store_boot_info_from_rom(void)
{
diff --git a/arch/arm/mach-mvebu/mbus.c b/arch/arm/mach-mvebu/mbus.c
index f29abe5911..3b1b9f73eb 100644
--- a/arch/arm/mach-mvebu/mbus.c
+++ b/arch/arm/mach-mvebu/mbus.c
@@ -98,9 +98,9 @@ struct mvebu_mbus_soc_data {
};
struct mvebu_mbus_state mbus_state
- __attribute__ ((section(".data")));
+ __section(".data");
static struct mbus_dram_target_info mbus_dram_info
- __attribute__ ((section(".data")));
+ __section(".data");
/*
* Functions to manipulate the address decoding windows
diff --git a/arch/arm/mach-mvebu/timer.c b/arch/arm/mach-mvebu/timer.c
index 43b3ed15d0..557a378776 100644
--- a/arch/arm/mach-mvebu/timer.c
+++ b/arch/arm/mach-mvebu/timer.c
@@ -14,7 +14,7 @@
#define TIMER_LOAD_VAL 0xffffffff
-static int init_done __attribute__((section(".data"))) = 0;
+static int init_done __section(".data") = 0;
/*
* Timer initialization
diff --git a/arch/arm/mach-nexell/clock.c b/arch/arm/mach-nexell/clock.c
index a0ba2d8e0c..d5b46a87a1 100644
--- a/arch/arm/mach-nexell/clock.c
+++ b/arch/arm/mach-nexell/clock.c
@@ -99,7 +99,7 @@ static const char * const clk_core[] = {
* in board_init_f(), respectively! I.e. global variables can not be used!
*/
static struct clk_dev_peri clk_periphs[]
- __attribute__((section(".data"))) = {
+ __section(".data") = {
CLK_PERI_1S(DEV_NAME_TIMER, 0, CLK_ID_TIMER_0,
PHY_BASEADDR_CLKGEN14, (I_PLL_0_2)),
CLK_PERI_1S(DEV_NAME_TIMER, 1, CLK_ID_TIMER_1,
@@ -167,7 +167,7 @@ static struct clk_dev_peri clk_periphs[]
#define MAX_DIVIDER ((1 << 8) - 1) /* 256, align 2 */
static struct clk_dev st_clk_devs[CLK_DEVS_NUM]
- __attribute__((section(".data")));
+ __section(".data");
#define clk_dev_get(n) ((struct clk_dev *)&st_clk_devs[n])
#define clk_container(p) (container_of(p, struct clk_dev, clk))
@@ -196,7 +196,7 @@ struct _core_hz_ {
* in board_init_f(), respectively! I.e. global variables can not be used!
*/
/* core clock */
-static struct _core_hz_ core_hz __attribute__((section(".data")));
+static struct _core_hz_ core_hz __section(".data");
#define CORE_HZ_SIZE (sizeof(core_hz) / 4)
diff --git a/arch/arm/mach-nexell/timer.c b/arch/arm/mach-nexell/timer.c
index fecee67265..3b311fd22a 100644
--- a/arch/arm/mach-nexell/timer.c
+++ b/arch/arm/mach-nexell/timer.c
@@ -23,9 +23,9 @@
* Section ".data" must be used because BSS is not available before relocation,
* in board_init_f(), respectively! I.e. global variables can not be used!
*/
-static unsigned long timestamp __attribute__ ((section(".data")));
-static unsigned long lastdec __attribute__ ((section(".data")));
-static int timerinit __attribute__ ((section(".data")));
+static unsigned long timestamp __section(".data");
+static unsigned long lastdec __section(".data");
+static int timerinit __section(".data");
/* macro to hw timer tick config */
static long TIMER_FREQ = 1000000;
diff --git a/arch/arm/mach-socfpga/spl_a10.c b/arch/arm/mach-socfpga/spl_a10.c
index 92231b5ba3..b5f43f09d1 100644
--- a/arch/arm/mach-socfpga/spl_a10.c
+++ b/arch/arm/mach-socfpga/spl_a10.c
@@ -40,7 +40,7 @@ DECLARE_GLOBAL_DATA_PTR;
SOCFPGA_PHYS_OCRAM_SIZE - \
BOOTROM_SHARED_MEM_SIZE)
#define RST_STATUS_SHARED_ADDR (BOOTROM_SHARED_MEM_ADDR + 0x438)
-static u32 rst_mgr_status __section(.data);
+static u32 rst_mgr_status __section(".data");
/*
* Bootrom will clear the status register in reset manager and stores the
diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index 503538e26d..9b84132eda 100644
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -39,7 +39,7 @@ struct fel_stash {
uint32_t cr;
};
-struct fel_stash fel_stash __attribute__((section(".data")));
+struct fel_stash fel_stash __section(".data");
#ifdef CONFIG_ARM64
#include <asm/armv8/mmu.h>
diff --git a/arch/arm/mach-tegra/board.c b/arch/arm/mach-tegra/board.c
index 21852e2388..95d6555a0d 100644
--- a/arch/arm/mach-tegra/board.c
+++ b/arch/arm/mach-tegra/board.c
@@ -45,7 +45,7 @@ enum {
UART_COUNT = 5,
};
-static bool from_spl __attribute__ ((section(".data")));
+static bool from_spl __section(".data");
#ifndef CONFIG_SPL_BUILD
void save_boot_params(unsigned long r0, unsigned long r1, unsigned long r2,
diff --git a/arch/arm/mach-tegra/cboot.c b/arch/arm/mach-tegra/cboot.c
index bb46fb23ff..55eb819860 100644
--- a/arch/arm/mach-tegra/cboot.c
+++ b/arch/arm/mach-tegra/cboot.c
@@ -49,7 +49,7 @@ extern struct mm_region tegra_mem_map[];
*/
/* The number of valid entries in ram_banks[] */
-static int ram_bank_count __attribute__((section(".data")));
+static int ram_bank_count __section(".data");
/*
* The usable top-of-RAM for U-Boot. This is both:
@@ -57,15 +57,15 @@ static int ram_bank_count __attribute__((section(".data")));
* b) At the end of a region that has enough space to hold the relocated U-Boot
* and all other allocations made around it (stack, heap, page tables, etc.)
*/
-static u64 ram_top __attribute__((section(".data")));
+static u64 ram_top __section(".data");
/* The base address of the region of RAM that ends at ram_top */
-static u64 region_base __attribute__((section(".data")));
+static u64 region_base __section(".data");
/*
* Explicitly put this in the .data section because it is written before the
* .bss section is zeroed out but it needs to persist.
*/
-unsigned long cboot_boot_x0 __attribute__((section(".data")));
+unsigned long cboot_boot_x0 __section(".data");
void cboot_save_boot_params(unsigned long x0, unsigned long x1,
unsigned long x2, unsigned long x3)
diff --git a/arch/mips/mach-jz47xx/jz4780/jz4780.c b/arch/mips/mach-jz47xx/jz4780/jz4780.c
index 43f5651f83..fefba12873 100644
--- a/arch/mips/mach-jz47xx/jz4780/jz4780.c
+++ b/arch/mips/mach-jz47xx/jz4780/jz4780.c
@@ -23,7 +23,7 @@
#ifdef CONFIG_SPL_BUILD
/* Pointer to the global data structure for SPL */
DECLARE_GLOBAL_DATA_PTR;
-gd_t gdata __attribute__ ((section(".bss")));
+gd_t gdata __section(".bss");
void board_init_f(ulong dummy)
{
diff --git a/arch/nds32/include/asm/setup.h b/arch/nds32/include/asm/setup.h
index 8217bbf6fe..a7d52373c6 100644
--- a/arch/nds32/include/asm/setup.h
+++ b/arch/nds32/include/asm/setup.h
@@ -155,7 +155,7 @@ struct tagtable {
#ifdef __KERNEL__
-#define __tag __used __attribute__((__section__(".taglist")))
+#define __tag __used __section(".taglist")
#define __tagtable(tag, fn) \
static struct tagtable __tagtable_##fn __tag = { tag, fn }
@@ -182,8 +182,8 @@ struct early_params {
};
#define __early_param(name, fn) \
-static struct early_params __early_##fn __used \
-__attribute__((__section__("__early_param"))) = { name, fn }
+static struct early_params __early_##fn __used \
+__section("__early_param") = { name, fn }
#endif
#endif
diff --git a/arch/powerpc/include/asm/cache.h b/arch/powerpc/include/asm/cache.h
index 445a366807..ac8eeb4caa 100644
--- a/arch/powerpc/include/asm/cache.h
+++ b/arch/powerpc/include/asm/cache.h
@@ -41,8 +41,8 @@
#define __cacheline_aligned __attribute__((__aligned__(L1_CACHE_BYTES)))
#else
#define __cacheline_aligned \
- __attribute__((__aligned__(L1_CACHE_BYTES), \
- __section__(".data.cacheline_aligned")))
+ __attribute__((__aligned__(L1_CACHE_BYTES))) \
+ __section(".data.cacheline_aligned")
#endif
#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
diff --git a/arch/riscv/cpu/cpu.c b/arch/riscv/cpu/cpu.c
index 296e458db4..c894ac10b5 100644
--- a/arch/riscv/cpu/cpu.c
+++ b/arch/riscv/cpu/cpu.c
@@ -17,10 +17,10 @@
* before the bss section is available.
*/
#ifdef CONFIG_OF_PRIOR_STAGE
-phys_addr_t prior_stage_fdt_address __attribute__((section(".data")));
+phys_addr_t prior_stage_fdt_address __section(".data");
#endif
#ifndef CONFIG_XIP
-u32 hart_lottery __attribute__((section(".data"))) = 0;
+u32 hart_lottery __section(".data") = 0;
/*
* The main hart running U-Boot has acquired available_harts_lock until it has
diff --git a/arch/sandbox/include/asm/getopt.h b/arch/sandbox/include/asm/getopt.h
index 3048c2cc30..d2145ad6e2 100644
--- a/arch/sandbox/include/asm/getopt.h
+++ b/arch/sandbox/include/asm/getopt.h
@@ -44,7 +44,7 @@ struct sandbox_cmdline_option {
.callback = sandbox_cmdline_cb_##f, \
}; \
/* Ppointer to the struct in a special section for the linker script */ \
- static __attribute__((section(".u_boot_sandbox_getopt"), used)) \
+ static __used __section(".u_boot_sandbox_getopt") \
struct sandbox_cmdline_option \
*sandbox_cmdline_option_##f##_ptr = \
&sandbox_cmdline_option_##f
diff --git a/arch/sandbox/lib/sections.c b/arch/sandbox/lib/sections.c
index 697a8167dd..2559eeea38 100644
--- a/arch/sandbox/lib/sections.c
+++ b/arch/sandbox/lib/sections.c
@@ -3,10 +3,11 @@
* Copyright 2013 Albert ARIBAUD <albert.u.boot@aribaud.net>
*
*/
+#include <linux/compiler.h>
-char __efi_runtime_start[0] __attribute__((section(".__efi_runtime_start")));
-char __efi_runtime_stop[0] __attribute__((section(".__efi_runtime_stop")));
+char __efi_runtime_start[0] __section(".__efi_runtime_start");
+char __efi_runtime_stop[0] __section(".__efi_runtime_stop");
char __efi_runtime_rel_start[0]
- __attribute__((section(".__efi_runtime_rel_start")));
+ __section(".__efi_runtime_rel_start");
char __efi_runtime_rel_stop[0]
- __attribute__((section(".__efi_runtime_rel_stop")));
+ __section(".__efi_runtime_rel_stop");
diff --git a/arch/x86/cpu/coreboot/timestamp.c b/arch/x86/cpu/coreboot/timestamp.c
index 7f133cefae..3ad611a530 100644
--- a/arch/x86/cpu/coreboot/timestamp.c
+++ b/arch/x86/cpu/coreboot/timestamp.c
@@ -11,7 +11,7 @@
#include <asm/cb_sysinfo.h>
#include <linux/compiler.h>
-static struct timestamp_table *ts_table __attribute__((section(".data")));
+static struct timestamp_table *ts_table __section(".data");
void timestamp_init(void)
{
diff --git a/arch/x86/lib/coreboot/cb_sysinfo.c b/arch/x86/lib/coreboot/cb_sysinfo.c
index e2c65bfb1e..748fa4ee53 100644
--- a/arch/x86/lib/coreboot/cb_sysinfo.c
+++ b/arch/x86/lib/coreboot/cb_sysinfo.c
@@ -21,7 +21,7 @@ DECLARE_GLOBAL_DATA_PTR;
* with zeroes when transitioning from "ROM", which is really RAM, to other
* RAM.
*/
-struct sysinfo_t lib_sysinfo __attribute__((section(".data")));
+struct sysinfo_t lib_sysinfo __section(".data");
/*
* Some of this is x86 specific, and the rest of it is generic. Right now,
diff --git a/arch/x86/lib/sections.c b/arch/x86/lib/sections.c
index 8d1700776d..375029ead0 100644
--- a/arch/x86/lib/sections.c
+++ b/arch/x86/lib/sections.c
@@ -2,10 +2,11 @@
/*
* Copyright 2013 Albert ARIBAUD <albert.u.boot@aribaud.net>
*/
+#include <linux/compiler.h>
-char __efi_runtime_start[0] __attribute__((section(".__efi_runtime_start")));
-char __efi_runtime_stop[0] __attribute__((section(".__efi_runtime_stop")));
+char __efi_runtime_start[0] __section(".__efi_runtime_start");
+char __efi_runtime_stop[0] __section(".__efi_runtime_stop");
char __efi_runtime_rel_start[0]
- __attribute__((section(".__efi_runtime_rel_start")));
+ __section(".__efi_runtime_rel_start");
char __efi_runtime_rel_stop[0]
- __attribute__((section(".__efi_runtime_rel_stop")));
+ __section(".__efi_runtime_rel_stop");
diff --git a/arch/xtensa/cpu/cpu.c b/arch/xtensa/cpu/cpu.c
index 85d3464607..a09e103fc1 100644
--- a/arch/xtensa/cpu/cpu.c
+++ b/arch/xtensa/cpu/cpu.c
@@ -20,7 +20,7 @@
DECLARE_GLOBAL_DATA_PTR;
-gd_t *gd __attribute__((section(".data")));
+gd_t *gd __section(".data");
#if defined(CONFIG_DISPLAY_CPUINFO)
/*