You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ARM] [Windows] Use IMAGE_SYM_CLASS_STATIC for private functions
For functions with private linkage, pick
IMAGE_SYM_CLASS_STATIC rather than IMAGE_SYM_CLASS_EXTERNAL;
GlobalValue::isInternalLinkage() only checks for
InternalLinkage, while GlobalValue::isLocalLinkage()
checks for both InternalLinkage and PrivateLinkage.
This matches what the AArch64 target does.
This activates a preexisting fix for the AArch64 target from
1e7f592, for the ARM target
as well.
When a relocation points at a symbol, one usually can convey
an offset to the symbol by encoding it as an immediate in
the instruction. However, for the ARM and AArch64 branch
instructions, the immediate stored in the instruction is
ignored by MS link.exe (and lld-link matches this aspect).
(It would be simple to extend lld-link to support it - but
such object files would be incompatible with MS link.exe.)
This was worked around by 1e7f592
by emitting symbols into the object file symbol table, for
temporary symbols that otherwise would have been omitted,
if they have the class IMAGE_SYM_CLASS_STATIC, in order to avoid
needing an offset in the relocated instruction.
This change gives the symbols generated from functions with the
IR level "private" linkage the right class, to activate that
workaround.
This fixes#100101,
fixing code generation for coroutines for Windows on ARM.
After the change in f786881,
coroutines generate a function with private linkage, and
calls to this function were previously broken for this target.
0 commit comments