Skip to content
Advertisement

Tag: rpath

-RPATH preference not working when executable run with SETUID set

Little bit of background: I have a execuatable which requires admin-privileges to run. This executable also has a runtime dependency on a custom dynamic lib. That dynamic lib has to be loaded from a custom path (and not from /usr/lib because a similar old version of this executable is present on which other libs may be referring to) which the

What are the recommended GNU linker options to specify $ORIGIN in RPATH?

Assume my platform is vanilla (non-embedded) x86-64 Linux using GNU build toolchain (GCC, etc.). To specify $ORIGIN in RPATH, I know about the linker option: -Wl,-rpath,’$$ORIGIN’. Today, I discovered another option: -Wl,-z,origin. Should I always include -Wl,-z,origin when using -Wl,-rpath,’$$ORIGIN’? Official GNU ld docs, say: Marks the object may contain $ORIGIN. Related, but different: https://stackoverflow.com/questions/33853271/what-are-the-recommended-gnu-linker-options-to-specify-rpath Answer I know about the

Advertisement