pppd: Enable plugin support in pppd
This patch makes it possible for pppd to load plugins in Android. Next
changes were made:
1. Link pppd with libdl library, which allows dynamic loading of shared
libraries.
2. Use -rdynamic to export all pppd symbols in dynamic symbol table,
so that plugins can link their undefined symbols against pppd.
3. Change plugins search path in pppd to:
- /system/lib/ (on 32-bit systems)
- /system/lib64/ (on 64-bit systems)
Last change was done for two reasons:
1. Fix plugin loading on 64-bit architectures
On ARM64 pppd will try to load 32-bit plugins (.so) files from /lib,
which leads to this kind of errors:
E pppd : dlopen failed:
"/system/lib/pppd/2.4.7/pppol2tp-android.so"
is 32-bit instead of 64 bit
E pppd : Couldn't load plugin pppol2tp-android.so
To overcome this issue let's make pppd look for plugins in lib/ or
in lib64/ directory based on __LP64__ definition.
2. Search for plugins in /system/${LIB}
Bionic loader allows us to dlopen() libraries only from
/system/${LIB} root directory (as specified in ld.config.txt, see
"default" linker namespace). When using upstream pppd location, which
is /system/${LIB}/pppd/2.4.7/, next error occurs in logcat, when pppd
is trying to load some plugin:
pppd : dlopen failed: library
"/system/lib64/pppd/2.4.7/pppol2tp-android.so"
needed or dlopened by "/system/bin/pppd" is not accessible for the
namespace "(default)"
Make pppd look only in /system/${LIB} root directory to fix this
issue.
Change-Id: I13c8c30337b1307911bdafa711afa1c3c34e99a6
Signed-off-by:
Sam Protsenko <semen.protsenko@linaro.org>
Loading
Please sign in to comment