mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-13 22:58:50 +00:00
Thumb's forced-PC-alignment requirement applies to the _total_ displacement, not just to the fragment relative
portion. While the fragment boundary is usually already aligned, it is possible for it not to be, which would lead to a non-aligned final displacement. llvm-svn: 122091
This commit is contained in:
parent
c2c6ebd82a
commit
900ac27338
@ -254,12 +254,12 @@ bool MCAssembler::EvaluateFixup(const MCAsmLayout &Layout,
|
||||
"FKF_IsAlignedDownTo32Bits is only allowed on PC-relative fixups!");
|
||||
|
||||
if (IsPCRel) {
|
||||
uint32_t Offset = Fixup.getOffset();
|
||||
uint32_t Offset = Layout.getFragmentOffset(DF) + Fixup.getOffset();
|
||||
|
||||
// A number of ARM fixups in Thumb mode require that the effective PC
|
||||
// address be determined as the 32-bit aligned version of the actual offset.
|
||||
if (ShouldAlignPC) Offset &= ~0x3;
|
||||
Value -= Layout.getFragmentOffset(DF) + Offset;
|
||||
Value -= Offset;
|
||||
}
|
||||
|
||||
// ARM fixups based from a thumb function address need to have the low
|
||||
|
Loading…
Reference in New Issue
Block a user