Object file

The object file is an abstraction of LLVM representation of the static object code files. This class provides methods to examine the contents of the object files. It also can be passed as parameter to ExecutionEngine.add_object_file() to make the symbols available to the JIT.

The ObjectFileRef class

class llvmlite.binding.ObjectFileRef

A wrapper around LLVM object file. The following methods and properties are available:

  • from_data(data):

    Create an instance of ObjectFileRef from the provided binary data.

  • from_path(path):

    Create an instance of ObjectFileRef from the supplied filesystem path. Raises IOError if the path does not exist.

  • sections:

    Return an iterator to the sections objects consisting of the instance of SectionIteratorRef

The SectionIteratorRef class

class llvmlite.binding.SectionIteratorRef
A wrapper around the section class which provides information like
section name, type and size, etc.
  • name():

    Get section name.

  • is_text():

    Returns true when section is of type text.

  • size():

    Get section size.

  • address():

    Get section address.

  • data():

    Get section contents.

  • is_end(object_file):

    Return true if the section iterator is the last element of the object_file.

  • next():

    Get the next section instance.