woodruffw / mollusc

Pure-Rust libraries for parsing, interpreting, and analyzing LLVM
MIT License
77 stars 6 forks source link

Parse the value symbol tables #27

Open woodruffw opened 2 years ago

woodruffw commented 2 years ago

Function mapping (#25) requires this, so I can't make meaningful progress on functions until this is done.

Just some notes to myself:

woodruffw commented 2 years ago

Also: module-level VSTs are parsed separately, via LLVM's parseGlobalValueSymbolTable. AFAICT, the only difference is that module-level VSTs can only contain VST_CODE_FNENTRY and none of the other codes.

Edit: More accurately, module-level VSTs are only parsed separately if there's also a module-level symbol table. When that table is present, VST_CODE_FNENTRY has the structure [valueid, offset] instead of [valueid, offset, namechar x N]. So these cases do probably need to be handled separately, at least at the parse level if not the model level.