Closed m-hilgendorf closed 1 year ago
non-breaking
I think right now what you do is check the e_type
of the Elf header for ET_DYN
. However, ET_DYN
only implies the object is dynamic, not if it is a library. The field name is a bit misleading in that sense, it might make more to expose the type directly through an enum (including the other variants of e_type).
released in 0.7.0, thank you so much for your patience!
PIE executables (either static or dynamically linked) erroneously report
is_lib == true
, due to the fact that they havee_type == ET_DYN
in their elf headers.To distinguish you have to check if the DT_FLAGS_1 was set in the dynamics section.
The part that I'm not sure about is
lazy_parse
, which can't detect if something is a library or not.