Commit af0bf827 authored by Kunshan Wang's avatar Kunshan Wang

Auto-resolve "reasonable" uptr fields.

parent d8109778
...@@ -1055,13 +1055,24 @@ of creating boot image is not atomic. Both concurrent modifications of the ...@@ -1055,13 +1055,24 @@ of creating boot image is not atomic. Both concurrent modifications of the
memory reachable from the white-listed global cells, and concurrent bundle memory reachable from the white-listed global cells, and concurrent bundle
loading, have undefined behaviours. loading, have undefined behaviours.
Fields of ``uptr<T>`` types are subject to relocation. If the value of a
``uptr<T>`` field happens to be the address of a field of a Mu global cell, the
destination will be preserved so that when the boot image is loaded, the
``uptr<T>`` field will still point to the same field it pointed to before boot
image building. Otherwise the content of the ``uptr<T>`` field is intact.
``sym_fields`` and ``sym_strings`` are two arrays, and the lengths of both are ``sym_fields`` and ``sym_strings`` are two arrays, and the lengths of both are
``nsyms``. The two arrays, zipped, form a list of IRef-string pairs. The IRef ``nsyms``. These parameters are reserved and have no effect.
must refer to a field of a global cell in the boot image. The string is a symbol
(in the native linker's sense) which is placed at the field. The linker/loader NOTE: They are reserved for adding symbols into the boot image. These
will be able to resolve the symbol to the address of the field of the global symbols can be resolved by the dynamic loader.
cell. (NOTE: global cells are always pinned and have constant addresses after
loaded.) In the intended use, the two arrays, zipped, form a list of IRef-string
pairs. The IRef must refer to a field of a global cell in the boot image.
The string is a symbol (in the native linker's sense) which is placed at the
field. The linker/loader will be able to resolve the symbol to the address
of the field of the global cell. (NOTE: global cells are always pinned and
have constant addresses after loaded.)
``reloc_fields``, ``reloc_strings`` are also two arrays, and the length of both ``reloc_fields``, ``reloc_strings`` are also two arrays, and the length of both
are ``nrelocs``. These two arrays form a list of IRef-string pairs, too. The are ``nrelocs``. These two arrays form a list of IRef-string pairs, too. The
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment