From 949130d80e367daa68a59462ddb159a984ebca1f Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Thu, 27 Jun 2019 14:24:22 +0200 Subject: [PATCH] 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. --- repos/base/src/lib/ldso/main.cc | 6 +----- repos/os/src/test/block/client/main.cc | 3 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/repos/base/src/lib/ldso/main.cc b/repos/base/src/lib/ldso/main.cc index ba353838b..bc7490dbb 100644 --- a/repos/base/src/lib/ldso/main.cc +++ b/repos/base/src/lib/ldso/main.cc @@ -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(); } diff --git a/repos/os/src/test/block/client/main.cc b/repos/os/src/test/block/client/main.cc index d1b8fcffe..41224fd18 100644 --- a/repos/os/src/test/block/client/main.cc +++ b/repos/os/src/test/block/client/main.cc @@ -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 {