News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

linux x86 vs windows x86 executable

Started by jack, January 29, 2018, 01:09:53 AM

Previous topic - Next topic

jack

does linux x86 handle cpu registers the same as windows x86, I mean is the ABI the same or different?

felipe

I think is different, because the stdcall convention in fact is not a standard one (as far as i know), it was created by microsoft . But probably is similar, maybe like a cdecl convention.
You should look in google too.  :P

aw27

Quote from: jack on January 29, 2018, 01:09:53 AM
does linux x86 handle cpu registers the same as windows x86, I mean is the ABI the same or different?
Typically, x86 Linux uses the GCC/cdecl calling convention, which is the same as cdecl under Windows except that the former requires the stack to be aligned to a 16-byte boundary before the call and the second to a 4-byte boundary.
Cdecl is also the default for current Windows C compilers. For API calls, normally Windows does not use cdecl but stdcall.
But ABI is more than the calling convention.

hutch--

Agner Fog has done work in this area and published it, in 32 bit the ABI was different from memory than with Unix based systems.

Look here.

http://agner.org/optimize/calling_conventions.pdf

jack

aw27 that's the kind of information I was after, thank you
thank you hutch for the reference