By reading ELF header of a binary file in android system, I find that most executable files under /system/bin are ET_DYN
, i.e., shared libraries. For example, the /system/bin/ls, lsmod, kill
files are typed ET_DYN
. In my opinion, these files are executable, and should be ET_EXEC
type. So my question is: in android system, why executable files from Linux OS are compiled to ET_DYN
type?
Asked
Active
Viewed 334 times
2

shijun zhao
- 383
- 3
- 13
1 Answers
1
i.e., shared libraries
They are not: they are position-independent executables.

Employed Russian
- 199,314
- 34
- 295
- 362
-
Is there any way to distinguish executable files from shared libraries by ELF header? – shijun zhao Apr 11 '18 at 01:28
-
@shijunzhao No, there isn't (at least not for `PIE` executables). – Employed Russian Apr 11 '18 at 01:42
-
thanks for you reply. In android platform, I see that the interpreters for .so and exe are different, can I distinguish exe from .so by their interpreters? – shijun zhao Apr 12 '18 at 01:26