EECS 370

Object file sections

Symbol table provides a mapping of symbols to addresses just like the one in your assembler. But it only contains things that: Might be needed by another file (globals and functions you define) You don’t have resolved (globals and functions others define that you need)

Relocation table holds addresses of instructions that need to be fixed up with updated addresses. It contains fields that tell you:

C’s static keyword

Instructions that need to be in the relocation table are anything that uses a symbol in the object file’s symbol table or instructions that use static variables. Few example types:

** Note: ** Statements that only declare variables do not translate to instructions in the binary. So there is nothing to relocate for such statements.

Where data goes