]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
treewide: Convert macro and uses of __section(foo) to __section("foo")
authorMarek Behún <marek.behun@nic.cz>
Thu, 20 May 2021 11:23:52 +0000 (13:23 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 24 May 2021 18:21:30 +0000 (14:21 -0400)
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>
52 files changed:
arch/arm/cpu/arm926ejs/spear/spl.c
arch/arm/cpu/armv7/ls102xa/ls102xa_psci.c
arch/arm/cpu/armv8/spl_data.c
arch/arm/include/asm/secure.h
arch/arm/include/asm/setup.h
arch/arm/lib/sections.c
arch/arm/lib/spl.c
arch/arm/mach-at91/spl.c
arch/arm/mach-k3/am642_init.c
arch/arm/mach-k3/am6_init.c
arch/arm/mach-k3/j721e_init.c
arch/arm/mach-mvebu/mbus.c
arch/arm/mach-mvebu/timer.c
arch/arm/mach-nexell/clock.c
arch/arm/mach-nexell/timer.c
arch/arm/mach-socfpga/spl_a10.c
arch/arm/mach-sunxi/board.c
arch/arm/mach-tegra/board.c
arch/arm/mach-tegra/cboot.c
arch/mips/mach-jz47xx/jz4780/jz4780.c
arch/nds32/include/asm/setup.h
arch/powerpc/include/asm/cache.h
arch/riscv/cpu/cpu.c
arch/sandbox/include/asm/getopt.h
arch/sandbox/lib/sections.c
arch/x86/cpu/coreboot/timestamp.c
arch/x86/lib/coreboot/cb_sysinfo.c
arch/x86/lib/sections.c
arch/xtensa/cpu/cpu.c
board/bosch/shc/board.c
board/broadcom/bcmstb/bcmstb.c
board/samsung/arndale/arndale_spl.c
board/samsung/smdk5250/smdk5250_spl.c
board/samsung/smdk5420/smdk5420_spl.c
board/siemens/draco/board.c
board/xilinx/common/fru_ops.c
drivers/bios_emulator/biosemu.c
drivers/clk/kendryte/clk.c
drivers/firmware/psci.c
drivers/pinctrl/nxp/pinctrl-imx5.c
drivers/pinctrl/nxp/pinctrl-imx7.c
drivers/pinctrl/nxp/pinctrl-imx8m.c
drivers/power/pmic/pmic_tps62362.c
drivers/power/pmic/pmic_tps65217.c
drivers/power/pmic/pmic_tps65218.c
drivers/power/pmic/pmic_tps65910.c
drivers/serial/serial_pl01x.c
include/efi_loader.h
include/linker_lists.h
include/linux/compiler.h
include/linux/compiler_attributes.h
lib/trace.c

index 08b98a2d068357df75fc72cdf40561dd5d3ae4ba..b5b9945a87ff58c820d057825b5925aee89125d6 100644 (file)
@@ -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)
 {
index 4a4b3c6f2328d7e275efbaa6a98c4157d68a0e80..28a794520747209171bea2e81c078af78d6c34c2 100644 (file)
@@ -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
index 8fd986a67a219f5f96feb43230de358942a1c2d2..8f1231c86ebb20da3937b878b606fc2e355618c9 100644 (file)
@@ -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;
 
index 64e5582c1f2a87dfa1f31b347ed56903666a0a5d..c7b00be8e0b9cbcb3c3d2946020280c580862a3d 100644 (file)
@@ -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 }
index 3a4e902af146e3f00f3e4d84770d07e178d4c695..e0e2d7e36065ff890d14a9782dc9703c5fa41093 100644 (file)
@@ -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 }
 
index 3bb2d8468c7cc3b2d15dc1524148b155c5a37cf1..857879711c6a83574a12299501bb56e2687d3db8 100644 (file)
@@ -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
  * 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");
index b2b54f28fc4b3298a14cddc556c155b9e0209c2a..8e2bdf35365692deae4e33d7f254b87ea1f48e14 100644 (file)
@@ -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
 
 /*
index 156150c89c8b5222cbfd7c409993afea2d4565eb..8d537998c984fa858498117048fe05e5a9ae79f7 100644 (file)
@@ -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)
 {
index 885f181d5842006c03f0e8bf8063fc9cda48e4f8..a433702b4e3031e3902b76b69573be861a4d62ba 100644 (file)
@@ -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)
 {
index d78d2b87519c96cb8b876adb4a2baad3d6ecaf3f..425b3f93c865b6addf7807b583d014a3762fd0ac 100644 (file)
@@ -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)
 {
index 1a4f796e5efa6924cd5ed77f596f03f4d03557bb..76a04a9035d6691739d606926b3d60330ca94a0f 100644 (file)
@@ -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)
 {
index f29abe591109c95f985d2e97a7004c88da3cee34..3b1b9f73ebf6c017f2262c76ec65e54281894de3 100644 (file)
@@ -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
index 43b3ed15d07448b9460b0b264deeac7b5f0a86db..557a378776d75caf57d0f978fe380615c94ed4fc 100644 (file)
@@ -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
index a0ba2d8e0cf81596d6892be384d1a0983e64b817..d5b46a87a188e5f2739d05d73e1f0d2d1c43c229 100644 (file)
@@ -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)
 
index fecee67265cb9211c0bcc4d4ad294f6d610431d6..3b311fd22a56f627dd80d7a05ea9d34d6550a5af 100644 (file)
@@ -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;
index 92231b5ba3c6a4ae5f2ad07fd1a7d5be425273ec..b5f43f09d190d735f01e29299b1c9f0ccc0aa65b 100644 (file)
@@ -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
index 503538e26d369b7c5a85aafddf7b8b584028eb5d..9b84132eda665b8859e4dfd3c27e38ce3ac4ceb3 100644 (file)
@@ -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>
index 21852e2388f7dffcbfea4767f799bfdb6f7ed885..95d6555a0d25a74becd0fe0338c8a0e3633df7cb 100644 (file)
@@ -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,
index bb46fb23ff79d1ea2045b69a5c0861d09f13d3c4..55eb81986048da4c80c3bc2a4799c3729d4d5458 100644 (file)
@@ -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)
index 43f5651f832661567429d133e7592fd349267e1f..fefba12873b8914e1b031527304eedc9e08b5559 100644 (file)
@@ -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)
 {
index 8217bbf6fe0ec146e7e0b3c544070ae6493c88c4..a7d52373c66d461f94c6731c6aa71192f02fa14c 100644 (file)
@@ -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
index 445a366807db9d6b061d37907fdcc54fae035b73..ac8eeb4caa5ab391cbf0bd9d4c518265d9f2f5b8 100644 (file)
@@ -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__)
index 296e458db4fe77f93ac9bb7318f95288e65589de..c894ac10b536a1de6691925c6a0ca2f7fbb613c0 100644 (file)
  * 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
index 3048c2cc30ba9bac1f6013df9f82a23ad347084f..d2145ad6e2d89a4f14a0cefa6035dfe93e767c1b 100644 (file)
@@ -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
index 697a8167ddf5ae2d82742c84074e28d762ed1eec..2559eeea38beca905fec70f5adb92cd9616b007c 100644 (file)
@@ -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");
index 7f133cefae343606c61f89ccff0a7caef028b6b2..3ad611a530c429d77fa02268fd382b23f5752aa7 100644 (file)
@@ -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)
 {
index e2c65bfb1eed73177c9eb41147ce5d09ba03dae9..748fa4ee53bbd02c132dfa2668e250a50e95cdf0 100644 (file)
@@ -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,
index 8d1700776d02aaa91734131402dcefc260273259..375029ead09397e8388b5d7874d7405ad1b88536 100644 (file)
@@ -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");
index 85d3464607df67fb7043163a96853bbeba673ea5..a09e103fc1d61d54c1100c560bc9d4194670482a 100644 (file)
@@ -20,7 +20,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-gd_t *gd __attribute__((section(".data")));
+gd_t *gd __section(".data");
 
 #if defined(CONFIG_DISPLAY_CPUINFO)
 /*
index e893781887283da1705dbf6aead099f306f220b4..86356e387512e3c783bd594618851a531be4a717 100644 (file)
@@ -45,7 +45,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static struct shc_eeprom __attribute__((section(".data"))) header;
+static struct shc_eeprom __section(".data") header;
 static int shc_eeprom_valid;
 
 /*
index ee0a341077cd22bb5fe1f43b2499b9c264a59f81..076ac9414418659f045853cae3795e872c4ca94e 100644 (file)
@@ -22,7 +22,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define BCMSTB_DATA_SECTION __attribute__((section(".data")))
+#define BCMSTB_DATA_SECTION __section(".data")
 
 struct bcmstb_boot_parameters bcmstb_boot_parameters BCMSTB_DATA_SECTION;
 
index baa5048335334b39e88879a6ce4558c70ddb0209..6ad0273e0495f01e4bf13e76d6e1bffbdedc4863 100644 (file)
@@ -10,7 +10,7 @@
 
 /* Parameters of early board initialization in SPL */
 static struct spl_machine_param machine_param
-               __attribute__((section(".machine_param"))) = {
+               __section(".machine_param") = {
        .signature      = SIGNATURE,
        .version        = 1,
        .params         = "vmubfasirM",
index eb25dfc0a0315f52af86c5ba7051f9275e8063d8..b0ef34dd6aa9fb33936fb929f7d49715fb2dafcd 100644 (file)
@@ -12,7 +12,7 @@
 
 /* Parameters of early board initialization in SPL */
 static struct spl_machine_param machine_param
-               __attribute__((section(".machine_param"))) = {
+               __section(".machine_param") = {
        .signature      = SIGNATURE,
        .version        = 1,
        .params         = "vmubfasirM",
index 72748ec0897b58daa95009e97bb01b5a8ea1be83..84126f5608c70877670d44e977f73f69bc067598 100644 (file)
@@ -12,7 +12,7 @@
 
 /* Parameters of early board initialization in SPL */
 static struct spl_machine_param machine_param
-               __attribute__((section(".machine_param"))) = {
+               __section(".machine_param") = {
        .signature      = SIGNATURE,
        .version        = 1,
        .params         = "vmubfasirM",
index b512bdbfabf46c44b01f4ad6ef4b2e5bf687f242..01fdfb5cb4de0911a0493bb61efab1eeeff481b5 100644 (file)
@@ -41,7 +41,7 @@
 #include <nand.h>
 
 #ifdef CONFIG_SPL_BUILD
-static struct draco_baseboard_id __attribute__((section(".data"))) settings;
+static struct draco_baseboard_id __section(".data") settings;
 
 #if DDR_PLL_FREQ == 303
 #if !defined(CONFIG_TARGET_ETAMIN)
index 44f0913f2eb776a5861aa01b6934fc640b6ee48a..6ed63bb7ee111103bc34f620425db1d1e4b57af3 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "fru.h"
 
-struct fru_table fru_data __section(.data);
+struct fru_table fru_data __section(".data");
 
 static u16 fru_cal_area_len(u8 len)
 {
index 9d4f07c074d33d1e3ad52a5a09164822188004a9..82befbae66f7b54b4fa23e86bf8f57635d61501e 100644 (file)
@@ -50,7 +50,7 @@
 #include "biosemui.h"
 
 BE_sysEnv _BE_env = {{0}};
-static X86EMU_memFuncs _BE_mem __attribute__((section(GOT2_TYPE))) = {
+static X86EMU_memFuncs _BE_mem __section(GOT2_TYPE) = {
        BE_rdb,
        BE_rdw,
        BE_rdl,
@@ -59,7 +59,7 @@ static X86EMU_memFuncs _BE_mem __attribute__((section(GOT2_TYPE))) = {
        BE_wrl,
        };
 
-static X86EMU_pioFuncs _BE_pio __attribute__((section(GOT2_TYPE))) = {
+static X86EMU_pioFuncs _BE_pio __section(GOT2_TYPE) = {
        BE_inb,
        BE_inw,
        BE_inl,
index 2d6ac03693a5a402b84b34a0f1de34540698e70d..41c712e03f1c1c462d113450df5cb87e95e5780c 100644 (file)
@@ -347,7 +347,7 @@ static const struct k210_comp_params k210_comps[] = {
 #undef COMP_NOMUX_ID
 #undef COMP_LIST
 
-static struct clk *k210_bypass_children __section(.data);
+static struct clk *k210_bypass_children __section(".data");
 
 /* Helper functions to create sub-clocks */
 static struct clk_mux *k210_create_mux(const struct k210_mux_params *params,
@@ -473,7 +473,7 @@ cleanup_mux:
        return comp;
 }
 
-static bool __section(.data) probed;
+static bool __section(".data") probed;
 
 /* reset probed so we will probe again post-relocation */
 static int k210_clk_bind(struct udevice *dev)
index 6755e74e3f88d1056ee055dd7a949503f99854d1..89cb7d88e5b3ea0d060ffac74008150ed2042b3d 100644 (file)
@@ -42,7 +42,7 @@
 #if CONFIG_IS_ENABLED(EFI_LOADER)
 int __efi_runtime_data psci_method;
 #else
-int psci_method __attribute__ ((section(".data")));
+int psci_method __section(".data");
 #endif
 
 unsigned long __efi_runtime invoke_psci_fn
index 71e0c94c96e31812b9488724e4ff394fa0ea41fe..b32b748cfc63cb95a6b7d12bb3fe29e3ecf7d7e3 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "pinctrl-imx.h"
 
-static struct imx_pinctrl_soc_info imx5_pinctrl_soc_info __attribute__((section(".data")));
+static struct imx_pinctrl_soc_info imx5_pinctrl_soc_info __section(".data");
 
 static int imx5_pinctrl_probe(struct udevice *dev)
 {
index 8301413ac7edfa07ec2117d77a47dc15bbe3a595..77ddb8e0b9d515ce80a19ce38d5d39509bf88113 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "pinctrl-imx.h"
 
-static struct imx_pinctrl_soc_info imx7_pinctrl_soc_info __attribute__((section(".data")));
+static struct imx_pinctrl_soc_info imx7_pinctrl_soc_info __section(".data");
 
 static struct imx_pinctrl_soc_info imx7_lpsr_pinctrl_soc_info = {
        .flags = ZERO_OFFSET_VALID,
index 99c6d014d6cd8af8f701413ebdce41a798cc4ed2..6ea66a080b26f94a30e5e68f80e95fdddecb7c76 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "pinctrl-imx.h"
 
-static struct imx_pinctrl_soc_info imx8mq_pinctrl_soc_info __attribute__((section(".data")));
+static struct imx_pinctrl_soc_info imx8mq_pinctrl_soc_info __section(".data");
 
 static int imx8mq_pinctrl_probe(struct udevice *dev)
 {
index 76fd14db59d531c42cdc452275ec713cd65b5281..59190d6f672cb5f4b6bbf86e72b87dcf2ac4b299 100644 (file)
@@ -11,7 +11,7 @@
 #include <power/tps62362.h>
 
 #if CONFIG_IS_ENABLED(DM_I2C)
-struct udevice *tps62362_dev __attribute__((section(".data"))) = NULL;
+struct udevice *tps62362_dev __section(".data") = NULL;
 #endif
 
 /**
index 54b5bed99ad9f0ff5aed2e31c262664037ff8b0e..c7f532df4d57dc685d5876723d1cdf6aaa6e47bc 100644 (file)
@@ -8,7 +8,7 @@
 #include <i2c.h>
 #include <power/tps65217.h>
 
-struct udevice *tps65217_dev __attribute__((section(".data"))) = NULL;
+struct udevice *tps65217_dev __section(".data") = NULL;
 
 /**
  * tps65217_reg_read() - Generic function that can read a TPS65217 register
index f8bae4545c40c1798a68b9cc45a58bca63e2b922..6717490180413e03bbfb82689fbf44ca8734cfcb 100644 (file)
@@ -86,7 +86,7 @@ int tps65218_reg_write(uchar prot_level, uchar dest_reg, uchar dest_val,
        return 0;
 }
 #else
-struct udevice *tps65218_dev __attribute__((section(".data"))) = NULL;
+struct udevice *tps65218_dev __section(".data") = NULL;
 
 int tps65218_reg_read(uchar dest_reg, uchar *dest_val)
 {
index 84a58c28d8f02319c8c439f2c17e88d630010b91..fcd0a654a889835d3f07aae84a3e0c99f9757b78 100644 (file)
@@ -8,7 +8,7 @@
 #include <i2c.h>
 #include <power/tps65910.h>
 
-struct udevice *tps65910_dev __attribute__((section(".data"))) = NULL;
+struct udevice *tps65910_dev __section(".data") = NULL;
 
 static inline int tps65910_read_reg(int addr, uchar *buf)
 {
index 4f9de0da767f54c16cf3edefce38bf25af45206b..5283d5ed118ee3c279b6c06951430d427e18bd74 100644 (file)
@@ -30,8 +30,8 @@ DECLARE_GLOBAL_DATA_PTR;
 #ifndef CONFIG_DM_SERIAL
 
 static volatile unsigned char *const port[] = CONFIG_PL01x_PORTS;
-static enum pl01x_type pl01x_type __attribute__ ((section(".data")));
-static struct pl01x_regs *base_regs __attribute__ ((section(".data")));
+static enum pl01x_type pl01x_type __section(".data");
+static struct pl01x_regs *base_regs __section(".data");
 #define NUM_PORTS (sizeof(port)/sizeof(port[0]))
 
 #endif
index de1a496a97263d8a5cd180cc91f7c260e6118395..ce9b2388c544d2d38afced43954c7372ecbcc882 100644 (file)
@@ -682,8 +682,8 @@ ssize_t efi_dp_check_length(const struct efi_device_path *dp,
  * Use these to indicate that your code / data should go into the EFI runtime
  * section and thus still be available when the OS is running
  */
-#define __efi_runtime_data __attribute__ ((section (".data.efi_runtime")))
-#define __efi_runtime __attribute__ ((section (".text.efi_runtime")))
+#define __efi_runtime_data __section(".data.efi_runtime")
+#define __efi_runtime __section(".text.efi_runtime")
 
 /* Indicate supported runtime services */
 efi_status_t efi_init_runtime_supported(void);
index 2fea54c8343d2f6555ba8fca1ba46b13c6692e27..0575164ce4c8723c73cd3e699e1febbc0e1dc158 100644 (file)
@@ -69,8 +69,8 @@
  */
 #define ll_entry_declare(_type, _name, _list)                          \
        _type _u_boot_list_2_##_list##_2_##_name __aligned(4)           \
-                       __attribute__((unused                         \
-                       section(".u_boot_list_2_"#_list"_2_"#_name)))
+                       __attribute__((unused))                         \
+                       __section(".u_boot_list_2_"#_list"_2_"#_name)
 
 /**
  * ll_entry_declare_list() - Declare a list of link-generated array entries
@@ -92,8 +92,8 @@
  */
 #define ll_entry_declare_list(_type, _name, _list)                     \
        _type _u_boot_list_2_##_list##_2_##_name[] __aligned(4)         \
-                       __attribute__((unused                         \
-                       section(".u_boot_list_2_"#_list"_2_"#_name)))
+                       __attribute__((unused))                         \
+                       __section(".u_boot_list_2_"#_list"_2_"#_name)
 
 /*
  * We need a 0-byte-size type for iterator symbols, and the compiler
 #define ll_entry_start(_type, _list)                                   \
 ({                                                                     \
        static char start[0] __aligned(CONFIG_LINKER_LIST_ALIGN)        \
-               __attribute__((unused                                 \
-               section(".u_boot_list_2_"#_list"_1")));                 \
+               __attribute__((unused))                                 \
+               __section(".u_boot_list_2_"#_list"_1");                 \
        (_type *)&start;                                                \
 })
 
  */
 #define ll_entry_end(_type, _list)                                     \
 ({                                                                     \
-       static char end[0] __aligned(4) __attribute__((unused         \
-               section(".u_boot_list_2_"#_list"_3")));                 \
+       static char end[0] __aligned(4) __attribute__((unused))         \
+               __section(".u_boot_list_2_"#_list"_3");                 \
        (_type *)&end;                                                  \
 })
 /**
  */
 #define ll_start(_type)                                                        \
 ({                                                                     \
-       static char start[0] __aligned(4) __attribute__((unused       \
-               section(".u_boot_list_1")));                            \
+       static char start[0] __aligned(4) __attribute__((unused))       \
+               __section(".u_boot_list_1");                            \
        (_type *)&start;                                                \
 })
 
  */
 #define ll_end(_type)                                                  \
 ({                                                                     \
-       static char end[0] __aligned(4) __attribute__((unused         \
-               section(".u_boot_list_3")));                            \
+       static char end[0] __aligned(4) __attribute__((unused))         \
+               __section(".u_boot_list_3");                            \
        (_type *)&end;                                                  \
 })
 
index 5e3b3c08e917d562f896df263249a1b55f1abcab..82a8a4ede983364e8857bce33d7670a97a8b83dd 100644 (file)
@@ -24,7 +24,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
                        long ______r;                                   \
                        static struct ftrace_likely_data                \
                                __aligned(4)                            \
-                               __section(_ftrace_annotated_branch)     \
+                               __section("_ftrace_annotated_branch")   \
                                ______f = {                             \
                                .data.func = __func__,                  \
                                .data.file = __FILE__,                  \
@@ -60,7 +60,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
 #define __trace_if_value(cond) ({                      \
        static struct ftrace_branch_data                \
                __aligned(4)                            \
-               __section(_ftrace_branch)               \
+               __section("_ftrace_branch")             \
                __if_trace = {                          \
                        .func = __func__,               \
                        .file = __FILE__,               \
@@ -118,7 +118,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
        ".popsection\n\t"
 
 /* Annotate a C jump table to allow objtool to follow the code flow */
-#define __annotate_jump_table __section(.rodata..c_jump_table)
+#define __annotate_jump_table __section(".rodata..c_jump_table")
 
 #else
 #define annotate_reachable()
@@ -294,7 +294,7 @@ unsigned long read_word_at_a_time(const void *addr)
  * visible to the compiler.
  */
 #define __ADDRESSABLE(sym) \
-       static void * __section(.discard.addressable) __used \
+       static void * __section(".discard.addressable") __used \
                __PASTE(__addressable_##sym, __LINE__) = (void *)&sym;
 
 /**
index cdf016596659a3f06d27dd58fb79916ade5a378a..44c9a08d734620b0ad23706d92aef10daaffdf3d 100644 (file)
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-section-variable-attribute
  * clang: https://clang.llvm.org/docs/AttributeReference.html#section-declspec-allocate
  */
-#define __section(S)                    __attribute__((__section__(#S)))
+#define __section(S)                    __attribute__((__section__(S)))
 
 /*
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-unused-function-attribute
index 9e34b19537551af169be4b3f1ed67ab596fcf528..505a31806ce7b3d905989452026b951e25be13b2 100644 (file)
@@ -13,8 +13,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static char trace_enabled __attribute__((section(".data")));
-static char trace_inited __attribute__((section(".data")));
+static char trace_enabled __section(".data");
+static char trace_inited __section(".data");
 
 /* The header block at the start of the trace memory area */
 struct trace_hdr {