Alright, as far as I know ET_EXEC is used to indicate that the file is an executable whereas ET_DYN indicates that the file is a shared library. So to be sure I wrote a simple program in C, the problem however is that readelf -h is yielding the following:
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
.
.
.
I thought this had something to do with the compiler I used so I did the same with some utilities in /bin but unfortunately got the same results. So here's the question: Why is readelf identifying executables as shared libraries?
Why is readelf identifying executables as shared libraries?
Because it is (a special kind of) shared library. See also this answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With