Calling Conventions: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Line 74:
==Name Mangling==
 
In some object formats ([[a.out]]), the name of a C function is automagically mangled by prepending it with an underscore ('"_'"). Thus, to call a C function <tt>foo()</tt> in assembly with such a format, you must define it as <tt>extern _foo</tt> instead of <tt>extern foo</tt>. This requirement does not apply to most modern formats such as [[COFF]], [[PE]], and [[ELF]].
 
C++ name mangling is much more severe, as the C++ compiler encodes the type information from the parameter list into the symbol. (This is what enables function overloading in C++ in the first place.) The binutilsBinutils package contains the tool <tt>c++filt</tt> that can be used to determine the correct mangled name.
 
==Registers==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu