Hai,
I just had a problem with linking C and assembly in Linux. I use NASM, gcc and ld for my job. I have an assembly program which calls the C program with a call to main like
'call _main'
I want the program to start its execution from the assembly code and then switch to C. So I thought of setting the entry point in the assembly file. NASM provides a directive ..start: (a label which can be used to set the default entry point "start" which can be used by linker ld).
But unfortunately I found that this directive can be used only for creating DOS obj files and not for elf object files. Can I do this with NASM or should I have to switch to some other assembler for this purpose.
Help me please.
Ekanth
I just had a problem with linking C and assembly in Linux. I use NASM, gcc and ld for my job. I have an assembly program which calls the C program with a call to main like
'call _main'
I want the program to start its execution from the assembly code and then switch to C. So I thought of setting the entry point in the assembly file. NASM provides a directive ..start: (a label which can be used to set the default entry point "start" which can be used by linker ld).
But unfortunately I found that this directive can be used only for creating DOS obj files and not for elf object files. Can I do this with NASM or should I have to switch to some other assembler for this purpose.
Help me please.
Ekanth