Quiz Entry - updated: 2026.07.07
What does the assembler produce and how can you examine it?
A relocatable object file (.o) — the binary machine code, not yet linked or assigned final addresses.
* A relocatable object holds an ELF header, machine code, symbol table, and relocation info but no C runtime yet, and can be inspected with objdump, readelf, and nm. *
# Produces p24.pp.o
$ gcc -c p24.pp.s
# View as hexadecimal
$ hexdump -x p24.pp.o
Example hexdump output:
0000000 457f 464c 0102 0001 0000 0000 0000 0000
0000010 0001 003e 0001 0000 0000 0000 0000 0000
...
0000070 f845 c031 05c7 efec ffff 0000 8948 23eb
The object file contains:
- ELF header (identifies file format)
- Machine code (actual binary instructions)
- Symbol table (function/variable names)
- Relocation information (addresses to fix during linking)
Go deeper:
Executable and Linkable Format (Wikipedia) — the ELF relocatable (ET_REL) object files an assembler emits and the readelf/objdump tools that inspect them.
Object file (Wikipedia) — the sections (text, data, BSS, relocation, symbols) inside a relocatable object and why it isn't yet executable.