On Thu, Jun 29, 2023 at 08:53:55AM +0200, Ahmad Fatoum wrote: > Unless overridden by SORT*, LD will place sections matched by wildcards > in the order they were seen in the link. So far, this meant that > arch/ initcalls and device trees compiled into barebox proper, were > always last. > > For platforms with PBL or with only one device tree in barebox proper, > this didn't matter much, but when enabling the of_manipulation selftest, > a second device tree would be built into barebox on kvx, openrisc and > some MIPS. > > Because all directories appear before arch/, this had the effect that > on kvx, openrisc and some MIPS, __dtb_start would end up pointing at the > test's device tree instead of the board device tree breaking the build. > > Switching the affected platforms to use PBL would be one fix for the > issue, but there's a simple one: let's just move test/ after arch/. > > My preferred solution would've been to move arch/ at the first > beginning, but this may cause fallout for code that depended on specific > ordering of initcalls or other linker-defined lists. > > Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> > --- > v1 -> v2: > - move only test/ after arch/ to reduce chance of breakage > --- > Makefile | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > Applied, thanks Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |