Fix the error `cannot find section .dynamic` when needed_libraries is called on a static ELF executable.