Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions sysvabi64/sysvabi64.rst
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ Change History
| 2025Q2 | 20\ :sup:`th` June 2024 | Require that ``PT_GNU_PROPERTY`` program header be |
| | | present in executables and shared-libraries if a |
| | | .note.gnu.property section is present. |
| | | - Update distance to GOT for small code-model |
+------------+------------------------------+-------------------------------------------------------+

References
Expand Down Expand Up @@ -700,7 +701,7 @@ along with the assumptions that the code model may make.
.. table:: Code Models

+--------+----------------+----------------+------------------------+
| Code | Max text | Max combined | Additional GOT |
| Code | Max text | Max combined | Additional GOT size |
| Model | segment size | span of text | restrictions |
| | | and data | |
| | | segments | |
Expand All @@ -716,10 +717,7 @@ along with the assumptions that the code model may make.
| | | +------------------------+
| | | | PIC: none |
+--------+----------------+----------------+------------------------+
| large | 2GiB | no restriction | max distance from text |
| | | | to GOT < 4 GiB |
| | | | |
| | | | |
| large | 2GiB | no restriction | none |
+--------+----------------+----------------+------------------------+

.. note::
Expand Down Expand Up @@ -750,23 +748,26 @@ along with the assumptions that the code model may make.
5. The text segment maximum size is limited to 2GiB by
R_AARCH64_PLT32 relocations from ``.eh_frame`` sections.

6. While designing the code models it was estimated that only 2.6%
6. The distance to the GOT from the text segment is limited to 2GiB
by the R_AARCH64_GOTPCREL32 relocations.

7. While designing the code models it was estimated that only 2.6%
of load modules (executables and dynamic shared objects) have a max
text segment size greater than 1MiB; the rest would all fit into the
tiny model. However to avoid build option changes, it is recommended
that the small model should be the default, with an explicit option
to select the tiny model.

7. Executables and shared objects may be linked dynamically with other
8. Executables and shared objects may be linked dynamically with other
shared objects which use a different code model.

8. Linking of relocatable objects of different code models is possible
9. Linking of relocatable objects of different code models is possible
as is linking of PIC/PIE and non-PIC relocatable objects. The result
of the combination is always the most limited model. For example the
combination of a tiny code model PIC object and small code model
non-PIC object is a tiny non-PIC executable.

9. The large code model is aimed at programs with large amounts of
10. The large code model is aimed at programs with large amounts of
read-write data, not large amounts or sparsely placed code.

Implementation of code models
Expand Down