Author Topic: about f eif and o  (Read 6994 times)

Offline jishnu@123

  • Jr. Member
  • *
  • Posts: 3
about f eif and o
« on: January 06, 2015, 06:02:36 AM »
what is the keywords f and elf and o in the nasm program

Offline alexfru

  • Jr. Member
  • *
  • Posts: 17
Re: about f eif and o
« Reply #1 on: January 06, 2015, 06:28:57 AM »
eif or elf? And what are you talking about?

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: about f eif and o
« Reply #2 on: January 06, 2015, 06:43:57 AM »
They're not really "keywords". "-f" is the command line option which specifies the output format. "nasm -hf" for a complete list. "-f elf", equivalent to "-f elf32" is one of the supported output formats - "executable and linkable format" - used by Linux and BSD (and perhaps "etc."). ".o"  is the usual extension of such a linkable file.

Or perhaps you're seeing them in some other context?

Best,
Frank


Offline InfinitelyManic

  • Jr. Member
  • *
  • Posts: 6
  • Country: 00
  • x86-64 NASM on Linux
Re: about f eif and o
« Reply #3 on: February 18, 2015, 06:11:28 PM »
Example using nasm w/ gcc that results in 'prog' executable in Linux OS env

Code: [Select]
# nasm -felf64 -g -F stabs prog.asm && gcc prog.o -o prog

-f format Specifies the output file format. To see a list of valid output formats, use the -hf option.

valid output formats for -f are (`*' denotes default):
  * bin       flat-form binary files (e.g. DOS .COM, .SYS)
    ith       Intel hex
    srec      Motorola S-records
    aout      Linux a.out object files
    aoutb     NetBSD/FreeBSD a.out object files
    coff      COFF (i386) object files (e.g. DJGPP for DOS)
    elf32     ELF32 (i386) object files (e.g. Linux)
    elf64     ELF64 (x86_64) object files (e.g. Linux)
    as86      Linux as86 (bin86 version 0.3) object files
    obj       MS-DOS 16-bit/32-bit OMF object files
    win32     Microsoft Win32 (i386) object files
    win64     Microsoft Win64 (x86-64) object files
    rdf       Relocatable Dynamic Object File Format v2.0
    ieee      IEEE-695 (LADsoft variant) object file format
    macho32   NeXTstep/OpenStep/Rhapsody/Darwin/MacOS X (i386) object files
    macho64   NeXTstep/OpenStep/Rhapsody/Darwin/MacOS X (x86_64) object files
    dbg       Trace of all info passed to output stage
    elf       ELF (short name for ELF32)
    macho     MACHO (short name for MACHO32)
    win       WIN (short name for WIN32)

-g Causes nasm to generate debug information in selected format
-F format   select a debugging format
Code: [Select]
# nasm -f elf -y

valid debug formats for 'elf32' output format are ('*' denotes default):
    dwarf     ELF32 (i386) dwarf debug format for Linux/Unix
  * stabs     ELF32 (i386) stabs debug format for Linux/Unix