open_issues/llvm: llvm 0a109de14d0ced95d99b9ec60d4ef9479d6404d3 (2013-02-08), clang...
[hurd-web.git] / hurd / translator / procfs / jkoenig / discussion.mdwn
index e71ea02..aded422 100644 (file)
@@ -218,6 +218,20 @@ Needed by glibc's `pldd` tool (commit
 [[!message-id "alpine.LFD.2.02.1110111111260.2016@akari"]].  Needed by glibc's
 `stdlib/tst-secure-getenv.c`.
 
+Is it generally possible to use something like the following instead?
+Disadvantage is that every program using this needs to be patched.
+
+    #include <dlfcn.h>
+    [...]
+    Dl_info DLInfo;
+    int err = dladdr(&main, &DLInfo);
+    if (err == 0)
+      [...]
+    /* Pathname of shared object that contains address: DLInfo.dli_fname.  */
+    /* Filter it through realpath.  */
+
+This is used in `[LLVM]/lib/Support/Unix/Path.inc`.
+
 
 # `/proc/[PID]/fd/`