int fd;
char *rp;
+ /* Constructors in other libraries can call this function before
+ * br_init has been called. Detect this and call br_init to avoid a
+ * crash.
+ */
+ if (glibc_open == NULL)
+ br_init ();
+
rp = br_path (pathname);
if (rp)
br_log ("open %s\n", rp);
int r;
char *rp;
+ /* Constructors in other libraries can call this function before
+ * br_init has been called. Detect this and call br_init to avoid a
+ * crash.
+ */
+ if (glibc_open == NULL)
+ br_init ();
+
rp = br_path (filename);
if (rp)
br_log ("execve %s\n", rp);
static void
br_init (void)
{
- void *dl;
+ _Atomic static void *dl;
+
+ if (dl != NULL) return;
dl = dlopen ("/lib64/" LIBC_SO, RTLD_LAZY|RTLD_LOCAL);
if (dl == NULL) // Try '/lib/' also