Bug 13945 - RUNPATH behaviour is not transitive
Summary: RUNPATH behaviour is not transitive
Status: NEW
Alias: None
Product: glibc
Classification: Unclassified
Component: dynamic-link (show other bugs)
Version: 2.15
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2012-04-04 19:55 UTC by Dimitri
Modified: 2014-06-25 11:22 UTC (History)
3 users (show)

See Also:
Last reconfirmed:
fweimer: security-


Note You need to log in before you can comment on or make changes to this bug.
Description Dimitri 2012-04-04 19:55:27 UTC
If only DT_RPATH is used, the DSO chain is traced up to the root (normally an executable), and thus DT_RPATH of the root module is honoured. With DT_RUNPATH, it is not; see _dl_map_object in elf/dl-load.c.

That's why if DT_RUNPATH is present, indirect DSO loading from a non-standard path won't work, for example, if using GModule from GLib. (Even if the correct DT_RPATH is present, it will be overridden and invalidated by DT_RUNPATH.)

GNOME bug #670477 is an example of such situation. In order to make shell extensions load, we need to make sure that the "--enable-new-dtags" ld flag is not used.

Comment 2 Ryan S. Arnold 2012-05-22 15:02:16 UTC
It's unfortunate that RPATH is supposedly deprecated in favor of DT_RUNPATH.  And DT_RUNPATH was created to allow LD_LIBRARY_PATH to override the -rpath setting, and yet setting LD_LIBRARY_PATH is widely vilified.  I guess this leaves changing ld.so.conf, but that takes root permission.

Roland will you comment please?