Hello Luca,
I am not sure whether dlopen'ing an executable (and not a shared lib) is
a supported feature of uClibc-ng...
Man page of dlopen says it is for opening "shared lib".
There has been a discussion on glibc bug tracker to widen the scope of
dlopen and allow it to open executables ... but it seems Ulrich Drepper
refused it, and then the discussion was revived and it still does not
seem to hold a strong consensus. See
https://sourceware.org/bugzilla/show_bug.cgi?id=11754
I didn't try, but I am guessing here that if it works, it is by accident.
opening and mapping an ET_EXEC is needed indeed in the case of
"standalone" (dynamic loader run as an executable and loading another
executable given as argument).
And the function used to do this, is also the one used by dlopen() to
map the shared libs.
I guess you are refering to
https://elixir.bootlin.com/uclibc-ng/latest/source/ldso/ldso/dl-elf.c#L596
_dl_load_elf_shared_library is indeed used to load the ET_EXEC in the
"ld.so used as an executable" from there:
https://elixir.bootlin.com/uclibc-ng/latest/source/ldso/ldso/ldso.c#L601
And it is also called from
https://elixir.bootlin.com/uclibc-ng/latest/source/ldso/ldso/dl-elf.c#L200
Which is itself called from dlopen:
https://elixir.bootlin.com/uclibc-ng/latest/source/ldso/libdl/libdl.c#L372
So it seems the same function is used in 2 different contexts and that
leads to the support of ET_EXEC which is valid in one context ... but
I'm not sure it is valid in the other one (directly loading an ET_EXEC
with dlopen).
I hope this is clear.
Maybe someone else can give a hint whether my guess is correct or not?
Rich ? Waldemar ?
Cheers,
Yann
Le 31/05/2019 à 14:15, Luca Lindhorst a écrit :
Hello,
I noticed that the define "__LDSO_STANDALONE_SUPPORT__" does not just
prevents you from calling a binary via ld e.g. '/lib/ld-uClibc.so
my-binary', but also prevents programs from loading a binary via
dlopen. Is this intended? If so the name is at least confusing.
Greetings
Luca Lindhorst
-- Unsere Aussagen koennen Irrtuemer und Missverstaendnisse enthalten.
Bitte pruefen Sie die Aussagen fuer Ihren Fall, bevor Sie
Entscheidungen auf Grundlage dieser Aussagen treffen.
Wiesemann & Theis GmbH, Porschestr. 12, D-42279 Wuppertal
Geschaeftsfuehrer: Dipl.-Ing. Ruediger Theis
Registergericht: Amtsgericht Wuppertal, HRB 6377 Infos zum
Datenschutz:
http://www.wut.de/datenschutz
Tel. +49-202/2680-0, Fax +49-202/2680-265,
http://www.wut.de
_______________________________________________
devel mailing list
devel(a)uclibc-ng.org
https://mailman.uclibc-ng.org/cgi-bin/mailman/listinfo/devel