What do objdump -t and objdump -d show for an ELF file, and why is the symbol table so useful when you have no source code?
-t prints the symbol table: every named function and global variable with its address, size and section. -d disassembles the executable sections into assembly. Together they tell you what code exists and where it lives.
An ELF file is the linker's full output. Besides the machine code it usually keeps a symbol table that maps names to addresses, unless someone stripped it. xtensa-esp32-elf-objdump (the cross-toolchain's objdump, since the code is for the Xtensa CPU, not your laptop's x86) reads it:
-t(symbols): one line per symbol, with the address, flags such asFfor a function orOfor a data object, the section (.flash.text,.iram0.text,.rodata, …), the size and the name. Redirecting it to a.symfile lets yougrepit.-d(disassemble): every instruction in the code sections, grouped under the function names from the symbol table. Redirected to a.sfile it becomes a searchable map of the whole program, FreeRTOS and ESP-IDF included.
Why it matters: a large firmware image holds thousands of functions, most of them from the RTOS and libraries. Function names written by the application's developer stand out against that background and tell you where to look, which is why the first step in analysing unknown firmware is usually to read the symbols. It is also why release builds for products are often stripped of their symbol table.
Go deeper:
GNU Binutils — objdump — every option, including the
-tcolumn layout.Wikipedia — Executable and Linkable Format — sections, segments and the symbol table.