Object Files in LLVM
Object Files in LLVM
Normalization
Serialization MC
System Support
2010 LLVM Developers' Meeting 11/4/2010
Architecture
Layered
Low Level: Serialization
Base library that reads and writes
Depends only on the LLVM System and Support libraries
No interpretation is performed at this point
Provides symbols, sections, segments, and relocations
eg. In ELF the relocation section shows up here, even though
other object files store relocations differently
Useful for tools like objdump and nm
Elf32_Rel *reloc =
(Elf32_Rel*)read_binary_data(location_of_relocation_entry);
printf("Reloc{ addr: %p, info: %u }",
(void*)(reloc->r_offset),
unsigned(reloc->r_info));
2010 LLVM Developers' Meeting 11/4/2010
Performance
I added object file support to llvm-nm and tested it
vs binutils-nm.
2x faster on Linux
~30x faster on Windows (vs. nm via MinGW)