-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot dynamically load position-independent executable #9
Comments
The reason is that since glibc 2.30, it's no longer possible to So to fix this, we need to split up the LD_PRELOAD library and the main executable. |
Fixed in 8e10ef2. |
Thanks for working on this, but it's still not working:
|
|
Another idea:
Edit: nope again. I did this simple workaround, to make regex match, but still I have no idea, why it's not working for me. diff --git a/src/ip2unix.cc b/src/ip2unix.cc
index f8a0ac6..c319a38 100644
--- a/src/ip2unix.cc
+++ b/src/ip2unix.cc
@@ -13,7 +13,7 @@
extern char **environ;
-extern "C" const char *__ip2unix__(void);
+extern "C" const char *__ip2unix__(int);
static std::optional<std::string> get_preload_libpath(void)
{
@@ -33,7 +33,7 @@ static bool run_preload(std::vector<Rule> &rules, char *argv[])
char *buf, *preload;
std::optional<std::string> libpath;
- libversion = __ip2unix__();
+ libversion = __ip2unix__(0);
if (!(libpath = get_preload_libpath())) {
return false;
diff --git a/src/preload.cc b/src/preload.cc
index 4104953..8660bbe 100644
--- a/src/preload.cc
+++ b/src/preload.cc
@@ -68,7 +68,7 @@ static void init_rules(void)
g_rules = std::make_shared<std::vector<Rule>>(rules.value());
}
-extern "C" const char *WRAP_SYM(__ip2unix__)(void)
+extern "C" const char* WRAP_SYM(__ip2unix__)(int i)
{
return VERSION;
} |
Got any idea why there are different addresses
|
I got it! |
I'm using openSUSE Tumbleweed (rolling release distro). It currently has gcc 9.3.1 and glibc 2.31.
I successfully built ip2unix version 2.1.1, but I get this error, when trying to use it:
The text was updated successfully, but these errors were encountered: