Advertisement
Guest User

dlopen rpath test

a guest
Jun 6th, 2024
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | Source Code | 0 0
  1. #define _GNU_SOURCE
  2. #include <link.h>
  3. #include <dlfcn.h>
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6.  
  7. int main()
  8. {
  9.         void *hd = dlopen("libshaderc_shared.so.1", RTLD_NOW);
  10.         if(!hd)
  11.         {
  12.                 puts("Failed.");
  13.                 return 1;
  14.         }
  15.  
  16.         char path[4096];
  17.         dlinfo(hd, RTLD_DI_ORIGIN, &path);
  18.         puts(path);
  19.  
  20.         return 0;
  21. }
Tags: dlopen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement