[vlc-devel] [PATCH] handle the underscore prefix for some ARM ABI in arm_neon

David Geldreich david.geldreich at free.fr
Fri Apr 20 23:03:08 CEST 2012


Hello Rafael,

Le 20 avr. 2012 à 22:15, Rafaël Carré a écrit :
> Le 2012-04-20 12:16, David Geldreich a écrit :
>> use a gcc extension (also supported by clang/llvm) which symbol is
>> associated with function
> 
> Can you explain what it does?

Normally if you put a declaration :

extern void f(void);

a call to f() will access symbol f or _f depending of the ABI. As far as I know, the ARM ABI defines the way you pass parameters, which registers you should save/restore, but, as far as I understand it, the function naming seems to be left to the "OS" ABI.

using 'extern void f(void) asm("f");', the symbol f will always be used regardless of the ABI.

It could be "compared" as the way you avoid C++ mangling to call a C funcion by using :
extern "C" void f(void);

In vlc/modules/arm_neon, all functions are declared without the underscore.

In your example, you could use : extern void f(void) asm("foo"); to see the difference.

Regards.

PS: Remi, thanks for the merge.





More information about the vlc-devel mailing list