Remove warning exec_static_constructors() warning

The warning falsely detected cases where shared objects where loaded before
exec_static_constructors() was called as unneeded even in cases were the
binary itself contained static globals.

The commit also removes one redundant call to exec_static_constructors()
from the block tester.
This commit is contained in:
Christian Helmuth 2019-06-27 14:24:22 +02:00
parent 4c8369ab1b
commit 949130d80e
2 changed files with 1 additions and 8 deletions

View File

@ -391,7 +391,7 @@ struct Linker::Binary : private Root_object, public Elf_object
{
Init::list()->exec_static_constructors();
/* call static construtors and register destructors */
/* call static constructors and register destructors */
Func * const ctors_start = (Func *)lookup_symbol("_ctors_start");
Func * const ctors_end = (Func *)lookup_symbol("_ctors_end");
for (Func * ctor = ctors_end; ctor != ctors_start; (*--ctor)());
@ -677,10 +677,6 @@ void Genode::init_ldso_phdr(Env &env)
void Genode::exec_static_constructors()
{
if (!binary_ptr->static_construction_pending())
warning("Don't call Genode::Env::exec_static_constructors() "
"in components without static globals");
binary_ptr->finish_static_construction();
}

View File

@ -386,9 +386,6 @@ void perform(Genode::Env &env, Genode::Heap &heap, unsigned timeo_ms = 0)
void Component::construct(Genode::Env &env)
{
/* XXX execute constructors of global statics */
env.exec_static_constructors();
using namespace Genode;
try {