Skip to content

Commit da54f03

Browse files
committed
Add a more indepth discussion of what padding bytes are used for when encoding relative symbolic references into mangled names.
1 parent 6d4c516 commit da54f03

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)