summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2019-12-19 10:01:01 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-12-20 16:11:44 +0100
commitd5f8bd9c503e0a17ef071eec50c537cc82a7956c (patch)
treecce2d2ad4db5ed950502e4b0eee5744e055c4ad7
parent5aa9c60f9e884c6e954fad511a14d3f3119c9570 (diff)
downloadbarebox-d5f8bd9c503e0a17ef071eec50c537cc82a7956c.tar.gz
barebox-d5f8bd9c503e0a17ef071eec50c537cc82a7956c.tar.xz
lds: align RO_DATA_SECTION members
When using the RO_DATA_SECTION macro, all the individual components are put into the rodata section. As they now end up in the same section there is no alignment enforced between them anymore. This leads to unaligned start pointers when any of the components have a unaligned size. Enforce some alignment between them. Fixes: c5d38e920101 (lds: Add and use RO_DATA_SECTION macro) Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--include/asm-generic/barebox.lds.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/asm-generic/barebox.lds.h b/include/asm-generic/barebox.lds.h
index 68b78a13a9..138e9405a1 100644
--- a/include/asm-generic/barebox.lds.h
+++ b/include/asm-generic/barebox.lds.h
@@ -16,6 +16,7 @@
#endif
#define BAREBOX_INITCALLS \
+ STRUCT_ALIGN(); \
__barebox_initcalls_start = .; \
KEEP(*(.initcall.0)) \
KEEP(*(.initcall.1)) \
@@ -35,6 +36,7 @@
__barebox_initcalls_end = .;
#define BAREBOX_EXITCALLS \
+ STRUCT_ALIGN(); \
__barebox_exitcalls_start = .; \
KEEP(*(.exitcall.0)) \
KEEP(*(.exitcall.1)) \
@@ -46,37 +48,44 @@
__barebox_exitcalls_end = .;
#define BAREBOX_CMDS \
+ STRUCT_ALIGN(); \
__barebox_cmd_start = .; \
KEEP(*(SORT_BY_NAME(.barebox_cmd*))) \
__barebox_cmd_end = .;
#define BAREBOX_RATP_CMDS \
+ STRUCT_ALIGN(); \
__barebox_ratp_cmd_start = .; \
KEEP(*(SORT_BY_NAME(.barebox_ratp_cmd*))) \
__barebox_ratp_cmd_end = .;
#define BAREBOX_SYMS \
+ STRUCT_ALIGN(); \
__usymtab_start = .; \
KEEP(*(__usymtab)) \
__usymtab_end = .;
#define BAREBOX_MAGICVARS \
+ STRUCT_ALIGN(); \
__barebox_magicvar_start = .; \
KEEP(*(SORT_BY_NAME(.barebox_magicvar*))) \
__barebox_magicvar_end = .;
#define BAREBOX_CLK_TABLE \
+ STRUCT_ALIGN(); \
__clk_of_table_start = .; \
KEEP(*(.__clk_of_table)); \
KEEP(*(.__clk_of_table_end)); \
__clk_of_table_end = .;
#define BAREBOX_DTB \
+ STRUCT_ALIGN(); \
__dtb_start = .; \
KEEP(*(.dtb.rodata.*)); \
__dtb_end = .;
#define BAREBOX_IMD \
+ STRUCT_ALIGN(); \
KEEP(*(.barebox_imd_start)) \
KEEP(*(.barebox_imd_1*)) \
*(.barebox_imd_0*) \
@@ -84,6 +93,7 @@
#ifdef CONFIG_PCI
#define BAREBOX_PCI_FIXUP \
+ STRUCT_ALIGN(); \
__start_pci_fixups_early = .; \
KEEP(*(.pci_fixup_early)) \
__end_pci_fixups_early = .; \
@@ -98,6 +108,7 @@
#endif
#define BAREBOX_RSA_KEYS \
+ STRUCT_ALIGN(); \
__rsa_keys_start = .; \
KEEP(*(.rsa_keys.rodata.*)); \
__rsa_keys_end = .; \