@@ -480,6 +480,9 @@ void RuntimeDyldELF::resolveARMRelocation(const SectionEntry &Section,
480
480
*TargetPtr |= Value & 0xFFF ;
481
481
*TargetPtr |= ((Value >> 12 ) & 0xF ) << 16 ;
482
482
break ;
483
+ case ELF::R_ARM_REL32:
484
+ *TargetPtr += Value - FinalAddress;
485
+ break ;
483
486
// Write 24 bit relative value to the branch instruction.
484
487
case ELF::R_ARM_PC24: // Fall through.
485
488
case ELF::R_ARM_CALL: // Fall through.
@@ -1324,6 +1327,19 @@ relocation_iterator RuntimeDyldELF::processRelocationRef(
1324
1327
RelType, 0 );
1325
1328
Section.advanceStubOffset (getMaxStubSize ());
1326
1329
}
1330
+ } else if (RelType == ELF::R_ARM_GOT_PREL) {
1331
+ uint32_t GOTOffset = allocateGOTEntries (SectionID, 1 );
1332
+
1333
+ RelocationEntry GOTRE (SectionID, Offset, ELF::R_ARM_REL32, GOTOffset);
1334
+ addRelocationForSection (GOTRE, GOTSectionID);
1335
+
1336
+ // Fill in the value of the symbol we're targeting into the GOT
1337
+ RelocationEntry RE = computeGOTOffsetRE (SectionID, GOTOffset,
1338
+ Value.Offset , ELF::R_ARM_ABS32);
1339
+ if (Value.SymbolName )
1340
+ addRelocationForSymbol (RE, Value.SymbolName );
1341
+ else
1342
+ addRelocationForSection (RE, Value.SectionID );
1327
1343
} else {
1328
1344
uint32_t *Placeholder =
1329
1345
reinterpret_cast <uint32_t *>(computePlaceholderAddress (SectionID, Offset));
0 commit comments