Remove more dead code for ELF file. `writable` is always false. `program_header_only` is always true except for in some tests. The code that obtains information through ElfFile with `program_header_only=true` in tests are replaced by code that uses libelf. Bug: 377474232 Bug: 6527146 Test: art/test.py --host -g Change-Id: Icc9b4dbae612a90f54b50e090e191fad0a19f709