Linker Namespace

Linker namespace is a mechanism to control the shared library search path and the permission to open the libraries in a directory.

Framework processes

Default namespace

Search paths and permitted paths:

  1. /system/lib[64]
  2. /vendor/lib[64] # Deprecated in Android O (for legacy modules only)

SP-HAL namespace

Search paths and permitted paths:

  1. /vendor/lib[64]/egl
  2. /vendor/lib[64]/hw
  3. /vendor/lib[64]

Shared libraries imported from other namespaces:

  • Exported by default namespace:
    • LL-NDK: libc.so, libm.so, libdl.so, libstdc++.so, liblog.so, libz.so
    • SP-NDK: libEGL.so, libGLESv1_CM.so, libGLESv2.so, libnativewindow.so, libsync.so, libvndksupport.so
  • Exported by vndk namespace: android.hardware.renderscript@1.0.so, android.hardware.graphics.allocator@2.0.so, android.hardware.graphics.mapper@2.0.so, android.hardware.graphics.common@1.0.so, libhwbinder.so, libbase.so, libcutils.so, libhardware.so, libhidlbase.so, libhidltransport.so, libutils.so, libc++.so
  • Exported by rs namespace: libRS_internal.so

VNDK (VNDK-SP) namespace

Search paths:

  1. /vendor/lib[64]/vndk-sp
  2. /system/lib[64]/vndk-sp
  3. /vendor/lib[64]

Permitted paths:

  • /vendor/lib[64]/vndk-sp
  • /system/lib[64]/vndk-sp
  • /vendor/lib[64]
  • /vendor/lib[64]/hw
  • /vendor/lib[64]/egl

Shared libraries imported from other namespaces:

  • Exported by default namespace:
    • LL-NDK: libc.so, libm.so, libdl.so, libstdc++.so, liblog.so, libz.so
    • SP-NDK: libEGL.so, libnativewindow.so, libsync.so, libvndksupport.so

RS namespace

This special namespace allows libRS_internal.so to use libmediandk.so, which is not accessible from either SP-HAL namespace or VNDK-SP namespace (this is a relaxation in Android O).

Search paths:

  1. /vendor/lib[64]/vndk-sp
  2. /system/lib[64]/vndk-sp
  3. /vendor/lib[64]

Permitted paths:

  • /vendor/lib[64]/vndk-sp
  • /system/lib[64]/vndk-sp
  • /vendor/lib[64]
  • /data # Shared libraries JIT-compiled by RS CPU reference implementation

Shared libraries imported from other namespaces:

  • Exported by default namespace
    • LL-NDK: libc.so, libm.so, libdl.so, libstdc++.so, liblog.so
    • SP-NDK: libEGL.so, libGLESv1_CM.so, libGLESv2.so, libnativewindow.so, libsync.so, libvndksupport.so
    • Other Lib: libmediandk.so, libui.so
  • Exported by vndk namespace: android.hardware.renderscript@1.0.so, android.hardware.graphics.allocator@2.0.so, android.hardware.graphics.mapper@2.0.so, android.hardware.graphics.common@1.0.so, libhwbinder.so, libbase.so, libcutils.so, libhardware.so, libhidlbase.so, libhidltransport.so, libutils.so, libc++.so

Vendor processes

Default linker namespace

Search paths and permitted paths:

  1. /vendor/lib[64]
  2. /vendor/lib[64]/vndk-sp
  3. /system/lib[64]/vndk-sp
  4. /system/lib[64] # For degenerated VNDK libraries