Skip to content

Commit 8328d6d

Browse files
dcpleunggalak
authored andcommitted
linker: nios2: align rodata section
During testing with sorting section by alignment with qemu_nios2, if rodata section is not aligned on 4-byte boundary and its size not of multiple of 4, it would never boot correctly. So align the rodata here. This is in preparation to enable the linker option to sort sections by alignment. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
1 parent bbe6fa0 commit 8328d6d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/arch/nios2/linker.ld

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ SECTIONS
141141

142142
SECTION_PROLOGUE(_RODATA_SECTION_NAME,,)
143143
{
144+
. = ALIGN(4);
145+
144146
*(.rodata)
145147
*(".rodata.*")
146148
*(.gnu.linkonce.r.*)
@@ -154,6 +156,7 @@ SECTIONS
154156
#include <custom-rodata.ld>
155157
#endif
156158

159+
. = ALIGN(4);
157160
} GROUP_LINK_IN(ROMABLE_REGION)
158161

159162
_image_rom_end = .;

0 commit comments

Comments
 (0)