Skip to content

Instantly share code, notes, and snippets.

@azat
Created December 31, 2022 22:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azat/3b5f2ae6011bef2ae86392cea7789eb7 to your computer and use it in GitHub Desktop.
Save azat/3b5f2ae6011bef2ae86392cea7789eb7 to your computer and use it in GitHub Desktop.
different behavior of dlsym since glibc 2.36
#define _GNU_SOURCE
#include <dlfcn.h>
#include <stdio.h>
int main()
{
void *p = dlsym(RTLD_NEXT, "__pthread_mutex_lock");
printf("__pthread_mutex_lock: %p (via RTLD_NEXT)\n", p);
return 0;
}
libc 2.35: __pthread_mutex_lock: 0x7ffff7e27f70 (via RTLD_NEXT)
libc 2.36: __pthread_mutex_lock: (nil) (via RTLD_NEXT)
@azat
Copy link
Author

azat commented Dec 31, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment