Ejemplo n.º 1
0
int object_list_sections(void) {
  LLVMMemoryBufferRef MB;
  LLVMObjectFileRef O;
  LLVMSectionIteratorRef sect;
  char *msg = NULL;

  if (LLVMCreateMemoryBufferWithSTDIN(&MB, &msg)) {
    fprintf(stderr, "Error reading file: %s\n", msg);
    exit(1);
  }

  O = LLVMCreateObjectFile(MB);
  if (!O) {
    fprintf(stderr, "Error reading object\n");
    exit(1);
  }

  sect = LLVMGetSections(O);
  while (!LLVMIsSectionIteratorAtEnd(O, sect)) {
    printf("'%s': @0x%08" PRIx64 " +%" PRIu64 "\n", LLVMGetSectionName(sect),
           LLVMGetSectionAddress(sect), LLVMGetSectionSize(sect));

    LLVMMoveToNextSection(sect);
  }

  LLVMDisposeSectionIterator(sect);

  LLVMDisposeObjectFile(O);

  return 0;
}
Ejemplo n.º 2
0
SWIGEXPORT jint JNICALL Java_org_jllvm_bindings_ObjectJNI_LLVMIsSectionIteratorAtEnd(JNIEnv *jenv, jclass jcls, jlong jarg1, jlong jarg2) {
  jint jresult = 0 ;
  LLVMObjectFileRef arg1 = (LLVMObjectFileRef) 0 ;
  LLVMSectionIteratorRef arg2 = (LLVMSectionIteratorRef) 0 ;
  LLVMBool result;
  
  (void)jenv;
  (void)jcls;
  arg1 = *(LLVMObjectFileRef *)&jarg1; 
  arg2 = *(LLVMSectionIteratorRef *)&jarg2; 
  result = (LLVMBool)LLVMIsSectionIteratorAtEnd(arg1,arg2);
  jresult = (jint)result; 
  return jresult;
}
Ejemplo n.º 3
0
LLVMPY_IsSectionIteratorAtEnd(LLVMObjectFileRef O, LLVMSectionIteratorRef SI)
{
  return LLVMIsSectionIteratorAtEnd(O, SI);
}