Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is default C calling convention on 32 bit Linux and 64 bit Linux (Intel desktop CPU)?

Tags:

c

linux

gcc

What is default calling convention for a static function say:

static void PrintHelloWorld(char* s) { }

under

Linux:

#36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

and with

gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 Linux ubuntu 3.2.0-23-generic
like image 773
Lunar Mushrooms Avatar asked Dec 27 '22 23:12

Lunar Mushrooms


1 Answers

Under the architecture and compiler you have listed (Linux x86_64), the calling convention described in the System V AMD64 ABI is used.

Under Linux i386, the calling convention described in the System V i386 ABI is used.

like image 90
Mike Kwan Avatar answered Mar 01 '23 22:03

Mike Kwan