Symbols and Symbol Tables

-The following is the format for each entry in the .symbtab:
Pasted image 20260424181746.png
Fig: ELF symbol table entry. The type and binding fields are 4 bits each.

Explanations:
-int name: the symbol's actual string name's offset in .strtab section
- char type/binding: 4 bits each for type of symbol (function or data) and local or global classification.
- char reserved: unused??
- short section: index of symbol's section withing section header table
- long value: offset of the symbol location if in Relocatable Object Files or absolute address if it's in Executable Object Files
- long size: the object's size in byte
NOTE for short section: There are three special pseudo section with no - entries in section header table:
- ABS: for symbols that need not be relocated.
- UNDEF: for undefined symbols referenced here for defined elsewhere.
- COMMON: for unitialized data objects that's not yet allocated.

Powered by Forestry.md