LLVM ELF generation questions

I am trying to learn how the ELF output generation works within LLVM. Specifically, I am trying to understand how the symbol table gets populated.

I have not had much luck finding documentation regarding this process, and trying to look through the source code has made me much more confused at this point.

Is there any overview documentation that exists?

Thanks,

Al Dorrington

Software Engineer Sr

Lockheed Martin, Mission Systems and Training

I am trying to learn how the ELF output generation works within LLVM.
Specifically, I am trying to understand how the symbol table gets populated.

I have not had much luck finding documentation regarding this process, and
trying to look through the source code has made me much more confused at
this point.

Is there any overview documentation that exists?

AFAIK there are two primary places in LLVM that create ELF.

One is inside the code generator and is part of MC; probably you can dive
in at <http://llvm.org/docs/doxygen/html/ELFObjectWriter_8cpp_source.html&gt;
in particular ELFObjectWriter::WriteSymbolTable. Searching for "llvm MC"
for lots of relatively good overview documentation for the MC library
generically. AFAIK, there is no "overview" documentation regarding the
actual ELF emission process; you will need to read the source code and/or
ask questions on the mailing list.

The other part is LLD's output routines which assembles the ELF file from
it's internal "atom" representation. There is no documentation for this ELF
emission process either AFAIK. You will need to use the source code.

One other place that creates ELF, but which is probably not going to be
very helpful to you, is llvm/tools/yaml2obj/yaml2elf.cpp, but that is
mostly a testing tool and is still in a pretty rudimentary state.

-- Sean Silva