I encountered this while trying to understand ELF (Executable and Linking Format).
Steps I followed
- Wrote a simple application.
main.ccontainingint main(int argc, char **argv){ return 0;} - Compiled in linux environment using gcc. (Done on intel laptop)
Simplest command possible
gcc main.c - Now when I run
a.out, it runs without any issue. So build is fine. - I used
readelftool to retrieve the ELF information, where in machine field is put asAdvanced Micro Devices X86-64. This part puzzled me.
So I checked the file header of a.out, it was as per ELF-64 specification (Value 64 - EM_X86_64).
Would anyone care to explain, why does the executable, built in 64 bit mode on linux, show machine type as AMD x86 64?
x, because I would have expected to see something likeyorz?" - jeffluntx86_64is Intel's/AMD's 64-bit architecture? Have you read en.wikipedia.org/wiki/X86-64? - Niklas B.