Skip to content

Commit

Permalink
fix alignment for new-style ctors when using riscv64
Browse files Browse the repository at this point in the history
Recently uClibc-ng enabled UCLIBC_CTOR_DTOR for riscv64, so
that f.e. C++ applications are running fine. As a side effect
this breaks noMMU support. The problem is the alignment for
the ctors in elf2flt. This patch fixes it.

Tested with Qemu for ARM, M68k and Xtensa with no regressions.
  • Loading branch information
wbx-github authored and gregungerer committed Mar 26, 2024
1 parent 44e34cb commit eead8d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion elf2flt.ld.in
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ R_RODAT: *(.gnu.linkonce.r*)
@SYMBOL_PREFIX@_ssro_size = @SYMBOL_PREFIX@_essro - @SYMBOL_PREFIX@_ssro;
PROVIDE(@SYMBOL_PREFIX@_SDA2_BASE_ = @SYMBOL_PREFIX@_ssro + (@SYMBOL_PREFIX@_ssro_size / 2));

. = ALIGN(4) ;
. = ALIGN(8) ;
TOR: @SYMBOL_PREFIX@__CTOR_LIST__ = .;
TOR: LONG((@SYMBOL_PREFIX@__CTOR_END__ - @SYMBOL_PREFIX@__CTOR_LIST__) / 4 - 2)
SINGLE_LINK: /* gcc uses crtbegin.o to find the start of
Expand Down

0 comments on commit eead8d5

Please sign in to comment.