[PATCH v2] Look for ModuleData only in appropriate library

Adam Jackson ajax at redhat.com
Mon Jul 2 10:01:20 PDT 2012


On 6/28/12 11:17 AM, Michal Srb wrote:
> LoaderSymbol calls dlsym with RTLD_DEFAULT pseudo handle making it search in
> every loaded library. In addition glibc adds NODELETE flag to the library
> containing the symbol.
>
> It's used in doLoadModule to locate<modulename>ModuleData symbol, the
> module's library gets the flag and is kept in memory even after it is
> unloaded.
>
> This patch adds LoaderSymbolFromModule function that looks for symbol only in
> library specified by handle. That way the NODELETE flag isn't added.
>
> This glibc behavior doesn't seem to be documented, but even if other
> implementations differ, there is no reason to search ModuleData symbol outside
> the module's library.
>
> Signed-off-by: Michal Srb <msrb at suse.com>
> Reviewed-by: Daniel Stone <daniel at fooishbar.org>
>
> v2: Switch LoaderSymbolFromModule arguments order.
>      Correct description.

Reviewed-by: Adam Jackson <ajax at redhat.com>

- ajax



More information about the xorg-devel mailing list