distinguish shared objects from position independent executables

前端 未结 2 996
终归单人心
终归单人心 2020-12-16 05:08

I\'m looking for a fast way to check if a ELF binary is a shared object or a position independent executable. I think a can do that by checking the contained symbols / funct

2条回答
  •  情话喂你
    2020-12-16 05:46

    Try the elfutils and the included program eh-readelf:

    eh-readelf --file-header $ELFFILE
    

    showw you the file header and what kind of file it is:

    ...
    Typ:                               EXEC (Executable file)
    ...
    

    or

    Typ:                               DYN (Shared object file)
    

    In combination with a little sed line you should get the results you want.

提交回复
热议问题