__CTOR_END__ not at the end of .init_array for the EPOS Library Architecture
The previous linkage order had link_libs
after LINK_OBJL
, which caused some global constructors to appear after __CTOR_END__
in the .init_array
section of the final executable. With this, some objects were not being constructed at all [recall __do_global_ctors_aux
begins at __CTOR_END__-1
and proceeds backwards].
We propose to fix the problem by redefining link_libs
as follows:
link_libs="$link_libs $LINK_OBJL"
Note that, for this to work, LIB/system_$MMOD.o
must be moved from the beginning of LINK_OBJL_LIBRARY
to the end of LINK_OBJN_LIBRARY
.