Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?
share|improve this question
    
There's the now mostly obsolete a.out format (no longer used hence not in an answer). –  jw013 Aug 5 '11 at 21:50
add comment

2 Answers 2

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

share|improve this answer
add comment

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'
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.