File: object-file.rst

package info (click to toggle)
llvmlite 0.46.0-0.1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,140 kB
  • sloc: python: 13,605; cpp: 3,192; makefile: 185; sh: 168
file content (72 lines) | stat: -rw-r--r-- 1,735 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
===========
Object file
===========

.. currentmodule:: 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
:meth:`ExecutionEngine.add_object_file` to make the symbols available
to the JIT.

The ObjectFileRef class
------------------------

.. class:: ObjectFileRef

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

    * .. classmethod:: from_data(data):

        Create an instance of ObjectFileRef from the provided binary data.

    * .. classmethod:: from_path(path):

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

    * .. method:: sections:

        Return an iterator to the sections objects consisting of the
        instance of :class:`SectionIteratorRef`

The SectionIteratorRef class
----------------------------

.. class:: SectionIteratorRef
    A wrapper around the section class which provides information like
    section name, type and size, etc.

    * .. method:: name():

        Get section name.

    * .. method:: is_text():

        Returns true when section is of type text.

    * .. method:: size():

        Get section size.

    * .. method:: address():

        Get section address.

    * .. method:: data():

        Get section contents.

    * .. method:: is_end(object_file):

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

        * object_file: an instance of :class:`ObjectFileRef`

    * .. method:: next():

        Get the next section instance.