use of com.oracle.svm.hosted.image.RelocatableBuffer.Info in project graal by oracle.
the class MethodPointerInvalidHandlerFeature method markRelocationSitesFromBuffer.
private void markRelocationSitesFromBuffer(RelocatableBuffer buffer, ProgbitsSectionImpl sectionImpl) {
for (Map.Entry<Integer, RelocatableBuffer.Info> entry : buffer.getSortedRelocations()) {
final int offset = entry.getKey();
final RelocatableBuffer.Info info = entry.getValue();
assert ConfigurationValues.getTarget().arch instanceof AArch64 || checkEmbeddedOffset(sectionImpl, offset, info);
// Figure out what kind of relocation site it is.
if (info.getTargetObject() instanceof CFunctionPointer) {
// References to functions are via relocations to the symbol for the function.
markFunctionRelocationSite(sectionImpl, offset, info);
} else {
// A data relocation.
if (sectionImpl.getElement() == textSection) {
// A wrinkle on relocations *from* the text section: they are *always* to
// constants (in the "constant partition" of the roDataSection).
markDataRelocationSiteFromText(buffer, sectionImpl, offset, info);
} else {
// Relocations from other sections go to the section containing the target.
// Pass along the information about the target.
final Object targetObject = info.getTargetObject();
final ObjectInfo targetObjectInfo = heap.getObjectInfo(targetObject);
markDataRelocationSite(sectionImpl, offset, info, targetObjectInfo);
}
}
}
}
Aggregations