bug-gmp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interfacing with assembly code


From: Ian Lance Taylor
Subject: Re: Interfacing with assembly code
Date: 17 May 2005 16:22:57 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

"Rob Lyman" <address@hidden> writes:

> I am using gcc package and want to combine C code with assembler.  Although
> I am aware that gcc can in fact assemble code, I am rather set in my ways
> and am more comfortable assembling code with NASM.  So my questions are two:
> 
> 1) Why would the gcc linker be unable to find a symbol called "readTSC" in
> an ELF file generated by NASM?  I am properly exporting the symbol name,
> according to the NASM docs.  (I also tried exporting it as "_readTSC".)

Try using nm and/or objdump -t to see what the ELF code sees in the
symbol table of your object file.  Note that the linker is not part of
gcc.  The GNU linker is part of the GNU binutils; for more information
see:
    http://sourceware.org/binutils/

> 2) Is the gcc compiler capable of generating an object file in Intel OMF/OBJ
> format?  What command line options are required to invoke this?

gcc just generates assembly code, and then invokes the assembler.  If
you want to generate OMF, you will need an assembler which can
interpret gcc's assembly output and generate OMF.  In this context the
-masm=intel option may be helpful.  (The GNU assembler does not
support OMF output, but gcc is regularly used with other assemblers.)

Ian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]