# [PATCH] Zend dlopen flag for new glibc

- Thread: https://externals.io/message/14424
- Original archive: https://news-web.php.net/php.internals/14424
- Started by Joe Orton on 2005-01-24T16:59:57+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #14424 — Joe Orton — 2005-01-24T16:59:57+00:00

URL: https://externals.io/message/14424#14424

[ping]

New versions of glibc support a RTLD_DEEPBIND flag to dlopen.  The
effect of this flag when loading a "foo.so" with undefined symbols is
that the search that symbol starts at foo.so and its dependencies
*before* the loading process' global symbol table.

This is an effective workaround for symbol namespace collisions between
various modules and the libraries on which they depend (where fixing the
respective modules or libraries is not possible e.g. due to API
constraints).

Index: Zend/zend.h
===================================================================
RCS file: /repository/ZendEngine2/zend.h,v
retrieving revision 1.268
diff -u -r1.268 zend.h
--- Zend/zend.h	10 Jan 2005 21:57:30 -0000	1.268
+++ Zend/zend.h	12 Jan 2005 11:34:03 -0000
@@ -104,6 +104,8 @@
 
 # if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
 #  define DL_LOAD(libname)			dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
+# elif defined(RTLD_DEEPBIND)
+#  define DL_LOAD(libname)			dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
 # else
 #  define DL_LOAD(libname)			dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
 # endif

---

## #14425 — Sascha Schumann — 2005-01-24T17:03:21+00:00

URL: https://externals.io/message/14424#14425 · In reply to: #14424

+1

     - Sascha



[snip]

---

## #14426 — Jani Taskinen — 2005-01-25T01:41:40+00:00

URL: https://externals.io/message/14424#14426 · In reply to: #14424

Just commit..

     --Jani




> [ping]
>
> New versions of glibc support a RTLD_DEEPBIND flag to dlopen.  The
> effect of this flag when loading a "foo.so" with undefined symbols is
> that the search that symbol starts at foo.so and its dependencies
> *before* the loading process' global symbol table.
>
> This is an effective workaround for symbol namespace collisions between
> various modules and the libraries on which they depend (where fixing the
> respective modules or libraries is not possible e.g. due to API
> constraints).
>
> Index: Zend/zend.h
> ===================================================================
> RCS file: /repository/ZendEngine2/zend.h,v
> retrieving revision 1.268
> diff -u -r1.268 zend.h
> --- Zend/zend.h	10 Jan 2005 21:57:30 -0000	1.268
> +++ Zend/zend.h	12 Jan 2005 11:34:03 -0000
> @@ -104,6 +104,8 @@
>
> # if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
> #  define DL_LOAD(libname)			dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
> +# elif defined(RTLD_DEEPBIND)
> +#  define DL_LOAD(libname)			dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
> # else
> #  define DL_LOAD(libname)			dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
> # endif

---

## #14429 — Joe Orton — 2005-01-25T09:01:34+00:00

URL: https://externals.io/message/14424#14429 · In reply to: #14426

>     Just commit..

I don't have Zend commit access, can someone do it for me?

> 
> 
> > […]
...

---

## #14431 — Jani Taskinen — 2005-01-25T13:09:00+00:00

URL: https://externals.io/message/14424#14431 · In reply to: #14429

Done.

     --Jani



> 
> > […]
>
> I don't have Zend commit access, can someone do it for me?
>
> > […]
> ...
