aad79adab7
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. |
||
---|---|---|
.. | ||
.gitattributes | ||
.gitignore | ||
bootstrap_upip.sh | ||
build-stm-latest.sh | ||
cc1 | ||
check_code_size.sh | ||
codestats.sh | ||
dfu.py | ||
file2h.py | ||
gen-changelog.sh | ||
gen-cpydiff.py | ||
gendoc.py | ||
insert-usb-ids.py | ||
make-frozen.py | ||
makemanifest.py | ||
mpy_bin2res.py | ||
mpy_cross_all.py | ||
mpy_ld.py | ||
mpy-tool.py | ||
pyboard.py | ||
pydfu.py | ||
tinytest-codegen.py | ||
uf2conv.py | ||
upip_utarfile.py | ||
upip.py |