Skip to content

Commit 26d83d4

Browse files
authored
Merge pull request #85827 from gottesmm/pr-50a580749c0f00c1a29b7985f98b412538950dce
[mangling.rst] Add a more indepth discussion of what padding bytes are used for when encoding relative symbolic references into mangled names.
2 parents f50770e + da54f03 commit 26d83d4

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

docs/ABI/Mangling.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,17 @@ The following symbolic reference kinds are currently implemented:
113113
objective-c-protocol-relative-reference ::= '\x0C' .{4} // Reference points directly to a objective-c protcol reference
114114
#endif
115115

116-
A mangled name may also include ``\xFF`` bytes, which are only used for
117-
alignment padding. They do not affect what the mangled name references and can
118-
be skipped over and ignored.
116+
Mangled names that contain relative symbolic references may include ``\xFF``
117+
bytes for alignment padding purposes. These bytes do not affect what the mangled
118+
name references and can be skipped over and ignored.
119+
120+
DISCUSSION: A relative symbolic reference encodes a symbol by adding the offset
121+
integer value contained within the relative symbolic reference to the address in
122+
memory of the first byte of the relative symbolic reference. The addition of
123+
padding bytes is used to manipulate the location of that first byte so that the
124+
address of is already aligned in the same manner as the symbol that is
125+
ultimately referenced. Thus only an offset must be added to that address instead
126+
of also needing to consider alignment differences.
119127

120128
Globals
121129
~~~~~~~

0 commit comments

Comments
 (0)