4

I was wondering what are some formats of object files in Linux?

There are two types of object files that I know:

  1. executable, which has ELF format
  2. object files that are generated by gcc after compilation but before linkage.

    what is the format of such object files?

    Or are they also ELF format but with some different sub-formats than executables?

    Is the job of a linker to convert the format of this type of object files into the format of executables?

  3. Are there other types of object files?
1
  • There's the now mostly obsolete a.out format (no longer used hence not in an answer).
    – jw013
    Aug 5, 2011 at 21:50

2 Answers 2

1

Core dumps are also object files, of a sort, and usually in ELF format, too. Running this program will probably produce a file named "core":

int
main(int ac, char **av)
{
        char *p = 0;
        *p = 'a';
        return 0;
}

My file command says:

core: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style, from './dump'
1
1

Yes! They are also ELF. They are referred to as ELF object files.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .