summaryrefslogtreecommitdiff
path: root/py/persistentcode.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-08-28 17:03:08 +1000
committerDamien George <damien.p.george@gmail.com>2019-12-12 20:15:28 +1100
commitaad79adab7285cbe1c1b975fcd490542fd3ab85c (patch)
tree0d8a1a6661f1fdb32a77bc211f6123e0d929c0ea /py/persistentcode.h
parent27879844d24f276b0d15b27bd60c3a0391a9099e (diff)
tools/mpy_ld.py: Add new mpy_ld.py tool and associated build files.
This commit adds a new tool called mpy_ld.py which is essentially a linker that builds .mpy files directly from .o files. A new header file (dynruntime.h) and makefile fragment (dynruntime.mk) are also included which allow building .mpy files from C source code. Such .mpy files can then be dynamically imported as though they were a normal Python module, even though they are implemented in C. Converting .o files directly (rather than pre-linked .elf files) allows the resulting .mpy to be more efficient because it has more control over the relocations; for example it can skip PLT indirection. Doing it this way also allows supporting more architectures, such as Xtensa which has specific needs for position-independent code and the GOT. The tool supports targets of x86, x86-64, ARM Thumb and Xtensa (windowed and non-windowed). BSS, text and rodata sections are supported, with relocations to all internal sections and symbols, as well as relocations to some external symbols (defined by dynruntime.h), and linking of qstrs.
Diffstat (limited to 'py/persistentcode.h')
0 files changed, 0 insertions, 0 deletions