Skip to content

Commit

Permalink
Fix definition of the PC24 relocation field
Browse files Browse the repository at this point in the history
The pc24 relocation field had a wrong definition.  It was described as if
it were right-aligned within a 2-byte aligned field of 4 bytes.  This is
wrong, and instead the field actually just consists of 3 bytes without an
alignment requirement.
  • Loading branch information
aarnez committed Nov 6, 2023
1 parent ca4da46 commit fb36b62
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lzsabi.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4108,11 +4108,11 @@ \subsection{Relocation Types}
|0 31|
+-------------------------------+
+-------+-------+-------+-------+
|0 |1 |2 |3 |
| | pc24 |
|0 7|8 31|
+-------+-----------------------+
+-------+-------+-------+
|0 |1 |2 |
| pc24 |
|0 23|
+-------+---------------+
+----+--+-------+-------+-------+
|0 | |1 |2 |3 |
Expand Down Expand Up @@ -4157,7 +4157,7 @@ \subsection{Relocation Types}
{0 64/quad64/}/8/{0,0},
{0 32/word32/}/4/{0,-1.3},
{0 32/pc32/}/4/{0,-2.6},
{0 8/ /,32/pc24/}/4/{0,-3.9},
{0 24/pc24/}/3/{0,-3.9},
{0 4/ /,24/mid20/, 32/ /}/4/{0,-5.2},
{0 16/half16/}/2/{0,-6.5},
{0 16/pc16/}/2/{44,-1.3},
Expand Down Expand Up @@ -4219,8 +4219,8 @@ \subsection{Relocation Types}
the left by 1 before it is used as a program counter relative
displacement (for example, the immediate field of a ``Load Address
Relative Long'' instruction).
\item[\texttt{pc24}] This specifies a 24-bit field contained within 4
consecutive bytes with 2-byte alignment. The signed value in this field
\item[\texttt{pc24}] This specifies a 24-bit field contained within 3
consecutive bytes with 1-byte alignment. The signed value in this field
is shifted to the left by 1 before it is used as a program counter
relative displacement (for example, the third immediate field of a
``Branch Prediction Relative Preload'' instruction).
Expand All @@ -4240,7 +4240,7 @@ \subsection{Relocation Types}
halfword with 2-byte alignment. The 12 bit unsigned value is the
displacement of a memory reference.
\item[\texttt{pc12}] This specifies a 12-bit field contained within a
halfword with 2-byte alignment. The signed value in this field is
halfword with 1-byte alignment. The signed value in this field is
shifted to the left by 1 before it is used as a program counter relative
displacement (for example, the second immediate field of a ``Branch
Prediction Relative Preload'' instruction).
Expand Down Expand Up @@ -4349,7 +4349,7 @@ \subsection{Relocation Types}
\texttt{R\_390\_PC32} & 5 & \texttt{word32} & $S + A - P$ \\
\texttt{R\_390\_GOT12} & 6 & \texttt{low12} & $O + A$ \\
\texttt{R\_390\_GOT32} & 7 & \texttt{word32} & $O + A$ \\
\texttt{R\_390\_PLT32} & 8 & \texttt{word32} & $L + A$ \\
\texttt{R\_390\_PLT32} & 8 & \texttt{word32} & $L + A - P$ \\
\texttt{R\_390\_COPY}\textsuperscript{ \dagger} & 9 & \emph{none} & \\
\texttt{R\_390\_GLOB\_DAT}\textsuperscript{ \dagger} & 10 & \texttt{quad64} & $S + A$ \\
\texttt{R\_390\_JMP\_SLOT}\textsuperscript{ \dagger} & 11 & \emph{none} & \\
Expand Down

0 comments on commit fb36b62

Please sign in to comment.