@@ -782,42 +782,13 @@ static int dl_iterate_phdr_cb(dl_phdr_info *info, size_t size, void *arg) {
782
782
return 0 ;
783
783
}
784
784
785
- static bool requiresProcmaps () {
786
- # if SANITIZER_ANDROID && __ANDROID_API__ <= 22
787
- // Fall back to /proc/maps if dl_iterate_phdr is unavailable or broken.
788
- // The runtime check allows the same library to work with
789
- // both K and L (and future) Android releases.
790
- return AndroidGetApiLevel () <= ANDROID_LOLLIPOP_MR1;
791
- # else
792
- return false ;
793
- # endif
794
- }
795
-
796
- static void procmapsInit (InternalMmapVectorNoCtor<LoadedModule> *modules) {
797
- MemoryMappingLayout memory_mapping (/* cache_enabled*/ true );
798
- memory_mapping.DumpListOfModules (modules);
799
- }
800
-
801
785
void ListOfModules::init () {
802
786
clearOrInit ();
803
- if (requiresProcmaps ()) {
804
- procmapsInit (&modules_);
805
- } else {
806
- DlIteratePhdrData data = {&modules_, true };
807
- dl_iterate_phdr (dl_iterate_phdr_cb, &data);
808
- }
787
+ DlIteratePhdrData data = {&modules_, true };
788
+ dl_iterate_phdr (dl_iterate_phdr_cb, &data);
809
789
}
810
790
811
- // When a custom loader is used, dl_iterate_phdr may not contain the full
812
- // list of modules. Allow callers to fall back to using procmaps.
813
- void ListOfModules::fallbackInit () {
814
- if (!requiresProcmaps ()) {
815
- clearOrInit ();
816
- procmapsInit (&modules_);
817
- } else {
818
- clear ();
819
- }
820
- }
791
+ void ListOfModules::fallbackInit () { clear (); }
821
792
822
793
// getrusage does not give us the current RSS, only the max RSS.
823
794
// Still, this is better than nothing if /proc/self/statm is not available
0 commit comments