x86 - There is a signature for a specific ABI in an ELF or binary file? -
I need to identify ABI which generates some binary, programmable, dynamic and static libraries.
I would like to ask that there is a property or a tag or string that I can see from an external device to see that the ABI was used to make that binary object. My objects are mostly x86 and ARM for LF, and I am also adding ABI for debugging purposes like DBARF.
EDIT: Like the magic bytes at the beginning of a file which is usually used to detect the file's file format.
There are several indicators that may exist in ELF files.
- Used to mark the
EI_OSABIarea - .
-
The code of "branding" is used in the reserved part of thee_indentarea (beginning 8th byte). - For ARM files, you have the information in the
EABIversion / variant, and the object file can also contain the.ARM.attributessection. - In the
.commentsection the compiler can have a name / version, but it is only informative - it is not used by OS to identify ABI, and usually ABI information is not mentioned. - The
.notesection can contain additional information that can point to the use of ABI.
In most cases, readelf will display the required information, although you will see some switches (like -A to .arm. Attributes section to display). I do not think there is anything to parse the .note.Abi-tag section so that you may have to do this manually.
For more information, see SysV ABI and ARM EAB Docs.