I believe that there is (or at least was) already dl_iterate_phdr,
and that for some reason this was added to get the list of classes
without actually loading
the object file? If that path still exists, its perhaps possible this
series of issues, is people using this API,
and calling frameworkClasses without causing the loading shared object.
It seems an important part of the process is to determine if the listed classes
in are implemented elsewhere (eg., in a framework). These scripts determine
this by checking the output for no for class names having a “U” next to them,
in which case they are such “elsewhere” classes.
Do the methods you are proposing inform on whether classes are implemented “in
this module” versus “elsewhere”?