1From eead8d5e9f3911243182311f16178c25c6ea03c4 Mon Sep 17 00:00:00 2001 2From: Waldemar Brodkorb <wbx@openadk.org> 3Date: Sat, 23 Mar 2024 07:23:45 +0100 4Subject: [PATCH] fix alignment for new-style ctors when using riscv64 5 6Recently uClibc-ng enabled UCLIBC_CTOR_DTOR for riscv64, so 7that f.e. C++ applications are running fine. As a side effect 8this breaks noMMU support. The problem is the alignment for 9the ctors in elf2flt. This patch fixes it. 10 11Tested with Qemu for ARM, M68k and Xtensa with no regressions. 12 13Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> 14Upstream: https://github.com/uclinux-dev/elf2flt/commit/eead8d5e9f3911243182311f16178c25c6ea03c4 15--- 16 elf2flt.ld.in | 2 +- 17 1 file changed, 1 insertion(+), 1 deletion(-) 18 19diff --git a/elf2flt.ld.in b/elf2flt.ld.in 20index a99c69e..230c382 100644 21--- a/elf2flt.ld.in 22+++ b/elf2flt.ld.in 23@@ -139,7 +139,7 @@ R_RODAT: *(.gnu.linkonce.r*) 24 @SYMBOL_PREFIX@_ssro_size = @SYMBOL_PREFIX@_essro - @SYMBOL_PREFIX@_ssro; 25 PROVIDE(@SYMBOL_PREFIX@_SDA2_BASE_ = @SYMBOL_PREFIX@_ssro + (@SYMBOL_PREFIX@_ssro_size / 2)); 26 27- . = ALIGN(4) ; 28+ . = ALIGN(8) ; 29 TOR: @SYMBOL_PREFIX@__CTOR_LIST__ = .; 30 TOR: LONG((@SYMBOL_PREFIX@__CTOR_END__ - @SYMBOL_PREFIX@__CTOR_LIST__) / 4 - 2) 31 SINGLE_LINK: /* gcc uses crtbegin.o to find the start of 32-- 332.30.2 34 35