Company
Date Published
Author
Arpad Borsos
Word count
1302
Language
English
Hacker News points
None

Summary

The Android operating system uses dynamic loading to load native libraries from APKs, which are saved directly in memory instead of being extracted to disk. This approach saves disk space but presents challenges when trying to query the list of loaded libraries. The `/proc/X/maps` format provides a way to parse and process ELF files, which contain virtual address mappings for executables and libraries. To support loading libraries from APKs, developers must find alternative methods to obtain the list of loaded libraries, as querying the dynamic loader is not possible on older Android systems. A new approach involves tracking readable mappings, file offsets, and gaps in between them, and processing ELF headers to extract library information. This solution still has unanswered questions and potential issues, but it addresses a common problem faced by developers working with native Android libraries.