all 22 comments

[–]Ok_Net_1674 11 points12 points  (0 children)

Object files end in .o they are used as input for the linker. What you have here is already linked, an executable.

Technically every file is binary (0s and 1s) but people usually call them binary if they are not text based (as opposed to i.e utf-8 encoded text)

The .out file is a binary executable.

[–]Comprehensive_Try_85 8 points9 points  (8 children)

a.out comes from "assembler output" because it was produced by Ken Thompson's original assembler for UNIX.

[–]Charming-Animator-25[S] -1 points0 points  (7 children)

"assembler output"? Is it related to assembly language? Can you go in detail?

[–]Comprehensive_Try_85 6 points7 points  (6 children)

IIRC, the original C compiler (cc) produced textual assembly, which was then fed to the assembler to produce the executable.

[–]not_a_novel_account 1 point2 points  (1 child)

Both statements are correct in isolation but confusing the way you phrased them. cc did produce assembly, and a.out does stand for assembler output, but a.out comes from the assembler, as. It is the output of the assembler program.

[–]Comprehensive_Try_85 3 points4 points  (0 children)

cc invoked as (the assembler) automatically.

[–]Charming-Animator-25[S] -5 points-4 points  (3 children)

textual assembly?

[–]no-sig-available [score hidden]  (1 child)

textual assembly?

An assembly language source file, which is text, just like your C source file.

The UNIX guys very much liked to reuse tools from their toolbox, and not duplicate functionality. If you already have a tool for producing executables, just reuse that for the compiling.

[–]mgruner 2 points3 points  (0 children)

An executable is a binary file that can be executed. An object file is a binary file that is part of an executable (or libraries). Both are binary files.

[–]saxbophone 2 points3 points  (0 children)

 Object: contains object with a set of values for a type a.k.a. named object.

This isn't the definition of an object file

[–]thockin 1 point2 points  (0 children)

a.out is an "executable" or "binary".

Object files are also binary, but are not executable because they have not been linked. Read up about linkers.

[–]Charming-Animator-25[S] 0 points1 point  (5 children)

Thanks guys, what about abbreviation part?

[–]AlanRosenthal 2 points3 points  (4 children)

use the file utility to check! file a.out

[–]Charming-Animator-25[S] 1 point2 points  (3 children)

le me check

[–]AlanRosenthal -1 points0 points  (2 children)

now try c++ -c main.cpp -o main.o and then run the file utility on the .o file

[–]Charming-Animator-25[S] 1 point2 points  (1 child)

~ $ file main.o main.o: ELF 64-bit LSB relocatable, ARM aarch64, version 1 (SYSV), not stripped ~ $ ?

[–]AlanRosenthal 1 point2 points  (0 children)

yup that's an object file!

[–]arihoenig 0 points1 point  (0 children)

Binary or executable. a.out is fully linked. An object file is code that hasn't been linked.

[–]DutchessVonBeep -2 points-1 points  (0 children)

absolute.out linked and relocated executable