[BOLT] Fix rodata load simplification pass

Summary:
If the target address has a runtime relocation against it, do not
perform the load simplification.

(cherry picked from FBD29091939)
This commit is contained in:
Maksim Panchenko 2021-06-13 15:37:31 -07:00
parent f7f0a571d7
commit 1efadeedf2
1 changed files with 2 additions and 1 deletions

View File

@ -1097,7 +1097,8 @@ bool SimplifyRODataLoads::simplifyRODataLoads(
if (!DataSection || !DataSection->isReadOnly())
continue;
if (BC.getRelocationAt(TargetAddress))
if (BC.getRelocationAt(TargetAddress) ||
BC.getDynamicRelocationAt(TargetAddress))
continue;
uint32_t Offset = TargetAddress - DataSection->getAddress();