Skip to content

Latest commit

 

History

History
72 lines (43 loc) · 1.69 KB

object-file.rst

File metadata and controls

72 lines (43 loc) · 1.69 KB

Object file

llvmlite.binding

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

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

  • 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.

    • object_file: an instance of ObjectFileRef
  • next():

    Get the next section instance.