admin管理员组

文章数量:1310004

Have an existing .asm source module setup for the standard cdecl naming and calling convention that is built with yasm for an elf32 target. The .asm source can be used across different platforms and architectures.

The C function is declared with __attribute__((__cdecl__)), but the linker is still looking for the name without the leading underscore.

Turns out that gcc only changes the calling convention and not the name.

So two questions:

1 - Does yasm have an option to automatically strip leading underscores (_) for all the symbols that have them?

2 - Does gcc have an attribute or method to let it know the name needs an underscore.

FWIW, if you have a COFF or OMF .obj file, objconv can convert it and handle everything:

objconv -felf32 -nu source.obj target.o

TIA!!

本文标签: yasmusing gcc attribute((cdecl)) still results with ld quotundefined symbolquotStack Overflow