3 ms·
Thank you! This will be very useful. Yes, for C/C++ one needs: * ISA manual * ELF (generic ABI, psABI (e.g. x86-64-psABI), OSABI) * DWARF * Floating-point * La
by MaskRay 2y ago
Thank you! This will be very useful. Yes, for C/C++ one needs:
* ISA manual
* ELF (generic ABI, psABI (e.g. x86-64-psABI), OSABI)
* DWARF
* Floating-point
* Language standards
* Itanium C++ ABI
and probably a few other stuff.
> it seems like my failure to find the most up-to-date specification is simply because one doesn't exist.
While the up-to-date specification is unavailable, hopefully it is not too bad because all essential features have been completed as of 2001:)
RELR is a linker and loader feature, not on the compiler side.
Compressed debug sections are a pretty natural extension.
- jcranmer 2y agoI file things like linkers, loaders, and debuggers into the same bucket as compilers, so all of the ELF extensions are interesting to me, even if compilers directly don't interact with them. I'm also interested in things like the loader-debugger rendezvous interface. Basically any document anyone who touches any project in llvm-project might need to read. And then there are things like the layout of .gcc_except_table, which are undocumented except for random blog posts.
- WalterBright 2y ago> there are things like the layout of .gcc_except_table, which are undocumented except for random blog posts. The way I dealt with it was write an ELF dumper for the tables, and then run various C++ code snippets through g++ and look at how the tables were constructed.
- gumby 2y agoYou could just have called objdump — that’s what it’s for.
- WalterBright 2y agoI like mine better :-/ The same executable will also detect and dump Elf, Mach, MScoff, and OMF object files. Besides, one doesn't learn anything about how to decode the format by using an existing tool that presents it in decoded form.
- matt_d 2y agoIn case this is of interest, here's an attempt at gathering the references, including random blog posts (as well as articles, documentation, papers, software, and talks), on these topics: - assembly & ISA (instruction set architecture): - Arm: https://github.com/MattPD/cpplinks/blob/master/assembly.arm.md https://github.com/MattPD/cpplinks/blob/master/assembly.arm.... - RISC-V: https://github.com/MattPD/cpplinks/blob/master/assembly.riscv.md https://github.com/MattPD/cpplinks/blob/master/assembly.risc... - x86: https://github.com/MattPD/cpplinks/blob/master/assembly.x86.md https://github.com/MattPD/cpplinks/blob/master/assembly.x86.... - debugging: https://github.com/MattPD/cpplinks/blob/master/debugging.md https://github.com/MattPD/cpplinks/blob/master/debugging.md - debugging: tracing: https://github.com/MattPD/cpplinks/blob/master/debugging.tracing.md https://github.com/MattPD/cpplinks/blob/master/debugging.tra... - executable and object file formats (ELF, Mach-O, PE); debugging data formats (DWARF, PDB): https://github.com/MattPD/cpplinks/blob/master/executables.md https://github.com/MattPD/cpplinks/blob/master/executables.m... - linking and loading: https://github.com/MattPD/cpplinks/blob/master/executables.linking_loading.md https://github.com/MattPD/cpplinks/blob/master/executables.l... - compilers: https://github.com/MattPD/cpplinks/blob/master/compilers.md https://github.com/MattPD/cpplinks/blob/master/compilers.md - compilers correctness: https://github.com/MattPD/cpplinks/blob/master/compilers.correctness.md https://github.com/MattPD/cpplinks/blob/master/compilers.cor...
- gumby 2y ago> even if compilers directly don't interact with them Essentially they do as they put directives into the asm files to put things in specific sections, to define certain symbol visibility etc all of which depend on the object file format (e.g. a classic BSD a.out file, using a format I called “a.out” in BFD, can’t represent most of that). So the compiler does need to know. And the assembler absolutely needs to know since it generates object files! So yes an a.out file can be an ELF file (always is on Linux) or could be an “a.out” file. Sorry! In retrospect I should have called that format “bsd”.