int object_list_sections(void) {
LLVMMemoryBufferRef MB;
LLVMObjectFileRef O;
+ LLVMSectionIteratorRef sect;
char *msg = NULL;
if (LLVMCreateMemoryBufferWithSTDIN(&MB, &msg)) {
exit(1);
}
- LLVMSectionIteratorRef sect = LLVMGetSections(O);
+ sect = LLVMGetSections(O);
while (!LLVMIsSectionIteratorAtEnd(O, sect)) {
printf("'%s': @0x%08" PRIx64 " +%" PRIu64 "\n", LLVMGetSectionName(sect),
LLVMGetSectionAddress(sect), LLVMGetSectionSize(sect));
int object_list_symbols(void) {
LLVMMemoryBufferRef MB;
LLVMObjectFileRef O;
+ LLVMSectionIteratorRef sect;
+ LLVMSymbolIteratorRef sym;
char *msg = NULL;
if (LLVMCreateMemoryBufferWithSTDIN(&MB, &msg)) {
exit(1);
}
- LLVMSectionIteratorRef sect = LLVMGetSections(O);
- LLVMSymbolIteratorRef sym = LLVMGetSymbols(O);
+ sect = LLVMGetSections(O);
+ sym = LLVMGetSymbols(O);
while (!LLVMIsSymbolIteratorAtEnd(O, sym)) {
LLVMMoveToContainingSection(sect, sym);
- printf("%s @0x%08" PRIx64 "/0x%08" PRIx64 " +%" PRIu64 " (%s)\n",
- LLVMGetSymbolName(sym), LLVMGetSymbolAddress(sym),
- LLVMGetSymbolFileOffset(sym), LLVMGetSymbolSize(sym),
+ printf("%s @0x%08" PRIx64 " +%" PRIu64 " (%s)\n", LLVMGetSymbolName(sym),
+ LLVMGetSymbolAddress(sym), LLVMGetSymbolSize(sym),
LLVMGetSectionName(sect));
LLVMMoveToNextSymbol(sym);