[llvm-commits] [llvm] r75828 - in /llvm/trunk/lib: CodeGen/ELF.h CodeGen/ELFCodeEmitter.cpp CodeGen/ELFWriter.cpp CodeGen/ELFWriter.h Target/X86/X86ELFWriterInfo.cpp
Bill Wendling
isanbard at gmail.com
Wed Jul 15 16:21:10 PDT 2009
Hi Bruno,
> --- llvm/trunk/lib/CodeGen/ELF.h (original)
> +++ llvm/trunk/lib/CodeGen/ELF.h Wed Jul 15 15:49:10 2009
> @@ -52,6 +52,70 @@
> EV_CURRENT = 1
> };
>
> + /// ELFSym - This struct contains information about each symbol that is
> + /// added to logical symbol table for the module. This is eventually
> + /// turned into a real symbol table in the file.
> + struct ELFSym {
> + // The global value this symbol matches. This should be null if the symbol
> + // is not a global value.
> + const GlobalValue *GV;
> +
> + // ELF specific fields
> + unsigned NameIdx; // Index in .strtab of name, once emitted.
> + uint64_t Value;
> + unsigned Size;
> + uint8_t Info;
> + uint8_t Other;
> + unsigned short SectionIdx;
> +
> + // Symbol index into the Symbol table
> + unsigned SymTabIdx;
> +
> + enum {
> + STB_LOCAL = 0,
> + STB_GLOBAL = 1,
> + STB_WEAK = 2
> + };
> +
> + enum {
> + STT_NOTYPE = 0,
> + STT_OBJECT = 1,
> + STT_FUNC = 2,
> + STT_SECTION = 3,
> + STT_FILE = 4
> + };
> +
Please comment what these enums are for.
> + // Emit a symbol for each section created until now, skip null section
> + for (unsigned i = 1, e = SectionList.size(); i < e; ++i) {
Please use iterators to go through this vector.
> + for (unsigned i=0, e=SectionList.size(); i < e; ++i) {
> + ELFSection &S = *SectionList[i];
>
Same here.
> + for (unsigned i = 0, e = SymbolList.size(); i < e; ++i) {
> + ELFSym &Sym = *SymbolList[i];
>
And here.
> + for (i = 0, e = SymbolList.size(); i < e; ++i) {
Ditto.
> + for (i = 0, e = OtherSyms.size(); i < e; ++i)
Same.
> + // Emit all the symbols to the symbol table.
> + for (unsigned i = 0, e = SymbolList.size(); i < e; ++i) {
Ditto.
> + for (unsigned i=0, e=SectionList.size(); i < e; ++i) {
Here.
> + // Adjust alignment of all section if needed, skip the null section.
> + for (unsigned i=1, e=SectionList.size(); i < e; ++i) {
Here.
> + for (unsigned i=0, e=SectionList.size(); i < e; ++i) {
Here.
Thanks!
-bw
More information about the llvm-commits
mailing list