bitwiseworks / libc

LIBC Next (kLIBC fork)
9 stars 4 forks source link

Implement dladdr #104

Open dmik opened 3 years ago

dmik commented 3 years ago

This is a Linux way for doing what DosQueryModFromEIP does, see its man here.

Faced its usage in Qt 5.15.2 in QLibraryInfo (qlibrararyinfo.cpp) to support relocatable Qt installations.

Should be rather trivial to implement but doesn't make sense to add a new LIBCn export for just one single case. We will do that once encounter it the second time.

Once done, direct DosQueryModFromEIP usage in Qt should be eliminated.

dmik commented 3 years ago

The relevant lines in QLibraryInfo are these:

https://github.com/bitwiseworks/qtbase-os2/blob/05b27c0ccf92393f5ec9f140cde22a01ac5790da/src/corelib/global/qlibraryinfo.cpp#L580

There is also Chromium code that uses dladdr and has to use DosQueryModFromEIP for the time being:

https://github.com/bitwiseworks/qtwebengine-chromium-os2/blob/c96eaea5b1d1100769924faf25e8fd244fc46ab0/chromium/third_party/angle/src/common/system_utils_posix.cpp#L65