From 323a50cbca4cd7e7165e199e9492579d709526af Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Wed, 3 Jun 2020 14:19:52 -0500 Subject: [PATCH] Changes to relocs per Alan Modra; move/rewrite code alignment Signed-off-by: Bill Schmidt --- specification/ch_2.xml | 29 ++++++----- specification/ch_3.xml | 114 ++++++++++++++++++++++++++++------------- 2 files changed, 93 insertions(+), 50 deletions(-) diff --git a/specification/ch_2.xml b/specification/ch_2.xml index aac3d75..42cc986 100644 --- a/specification/ch_2.xml +++ b/specification/ch_2.xml @@ -4080,6 +4080,21 @@ xml:id="dbdoclet.50655240_pgfId-1156194"> all be on 4-byte (integer) boundaries. +
+ Code Alignment + + Functions must be aligned on at least a 4-byte boundary. + + + If a function contains any prefixed (8-byte) instructions, + functions should preferably be aligned on at least a 64-byte + boundary. In ISA 3.1, executing a prefixed instruction that + crosses a 64-byte boundary will cause a SIGILL that must be + handled by the kernel. Compilers and assemblers can avoid + this if functions are aligned on a 64-byte boundary. + +
@@ -6637,20 +6652,6 @@ s6 - 72 (stored)
-
- Code Alignment - - Functions must be aligned on at least a 4-byte boundary. - - - If a function contains any prefixed (8-byte) instructions, - functions must be aligned on at least a 64-byte boundary. - This is necessary so that compilers and assemblers can avoid - placing a prefixed instruction so that it crosses a 64-byte - boundary. - -
Tail-Call Optimization diff --git a/specification/ch_3.xml b/specification/ch_3.xml index 98a239b..40588bb 100644 --- a/specification/ch_3.xml +++ b/specification/ch_3.xml @@ -2837,12 +2837,18 @@ my_func: Allocates two contiguous entries in the GOT to hold a tls_index structure, with values dtpmod and dtprel, and - computes the offset from .TOC. of the first entry. - If n is the offset computed: - GOT[n] = dtpmod - GOT[n + 1] = dtprel - The call to __tls_get_addr ( ) happens as: - __tls_get_addr ((tls_index *) &GOT[n]) + computes the offset + from .TOC.address of the first + entry. + If n is the offset + computed: + GOT[n] = dtpmod + GOT[n + 1] = dtprel + The call to + __tls_get_addr ( ) happens as: + __tls_get_addr + ((tls_index *) &GOT[n]) @@ -2852,12 +2858,27 @@ my_func: Allocates two contiguous entries in the GOT to hold a tls_index structure, with values dtpmod and zero, and computes - the offset from .TOC. of the first entry. - If n is the offset computed: - GOT[n] = dtpmod - GOT[n + 1] = 0 - The call to __tls_get_addr ( ) happens as: - __tls_get_addr ((tls_index *) &GOT[n]) + the offset from + .TOC.address of the first + entry. + If n is the offset + computed: + GOT[n] = dtpmod + GOT[n + 1] = 0 + The call to + __tls_get_addr ( ) happens as: + __tls_get_addr + ((tls_index *) &GOT[n]) + + + + + @got@dtprel + + + Allocates an entry in the GOT with value dtprel, + and computes the address of the entry. @@ -2866,10 +2887,15 @@ my_func: Allocates an entry in the GOT with value tprel, and - computes the offset from .TOC. of the entry. - If n is the offset computed: - GOT[n] = tprel - The value of tprel is loaded into a register from the + computes the offset + from .TOC.address of the + entry. + If n is the offset + computed: + GOT[n] = tprel + The value of tprel is + loaded into a register from the location (GOT + n) to be used in an r2 form instruction. @@ -3997,7 +4023,8 @@ my_func: half16* - @got@tlsgd + @got@tlsgd – + .TOC. @@ -4011,7 +4038,8 @@ my_func: half16 - #lo(@got@tlsgd) + #lo(@got@tlsgd – + .TOC.) @@ -4025,7 +4053,8 @@ my_func: half16* - #hi(@got@tlsgd) + #hi(@got@tlsgd – + .TOC.) @@ -4039,7 +4068,8 @@ my_func: half16* - #ha(@got@tlsgd) + #ha(@got@tlsgd – + .TOC.) @@ -4053,7 +4083,8 @@ my_func: half16* - @got@tlsld + @got@tlsld – + .TOC. @@ -4067,7 +4098,8 @@ my_func: half16 - #lo(@got@tlsld) + #lo(@got@tlsld – + .TOC.) @@ -4081,7 +4113,8 @@ my_func: half16* - #hi(@got@tlsld) + #hi(@got@tlsld – + .TOC.) @@ -4095,7 +4128,8 @@ my_func: half16* - #ha(@got@tlsld) + #ha(@got@tlsld – + .TOC.) @@ -4109,7 +4143,8 @@ my_func: half16ds* - @got@tprel + @got@tprel – + .TOC. @@ -4123,7 +4158,8 @@ my_func: half16ds - #lo(@got@tprel) + #lo(@got@tprel – + .TOC.) @@ -4137,7 +4173,8 @@ my_func: half16* - #hi(@got@tprel) + #hi(@got@tprel – + .TOC.) @@ -4151,7 +4188,8 @@ my_func: half16* - #ha(@got@tprel) + #ha(@got@tprel – + .TOC.) @@ -4165,7 +4203,8 @@ my_func: half16ds* - @got@dtprel + @got@dtprel – + .TOC. @@ -4179,7 +4218,8 @@ my_func: half16ds - #lo(@got@dtprel) + #lo(@got@dtprel – + .TOC.) @@ -4193,7 +4233,8 @@ my_func: half16* - #hi(@got@dtprel) + #hi(@got@dtprel – + .TOC.) @@ -4207,7 +4248,8 @@ my_func: half16* - #ha(@got@dtprel) + #ha(@got@dtprel – + .TOC.) @@ -4916,7 +4958,7 @@ my_func: prefix34* - @got@tlsgd + @got@tlsgd – P @@ -4930,7 +4972,7 @@ my_func: prefix34* - @got@tlsld + @got@tlsld – P @@ -4944,7 +4986,7 @@ my_func: prefix34* - @got@tprel + @got@tprel – P @@ -4958,7 +5000,7 @@ my_func: prefix34* - @got@dtprel + @got@dtprel – P