/* * Apply RELR relocations. * * RELR is a compressed format for storing relative relocations. The * encoded sequence of entries looks like: * [ AAAAAAAA BBBBBBB1 BBBBBBB1 ... AAAAAAAA BBBBBB1 ... ] * * i.e. start with an address, followed by any number of bitmaps. The * address entry encodes 1 relocation. The subsequent bitmap entries * encode up to 63 relocations each, at subsequent offsets following * the last address entry. * * The bitmap entries must have 1 in the least significant bit. The * assumption here is that an address cannot have 1 in lsb. Odd * addresses are not supported. Any odd addresses are stored in the * RELA section, which is handled above. * * With the exception of the least significant bit, each bit in the * bitmap corresponds with a machine word that follows the base address * word, and the bit value indicates whether or not a relocation needs * to be applied to it. The second least significant bit represents the * machine word immediately following the initial address, and each bit * that follows represents the next word, in linear order. As such, a * single bitmap can encode up to 63 relocations in a 64-bit object.
*/ for (const u64 *relr = relr_start; relr < relr_end; relr++) { if ((*relr & 1) == 0) {
place = (u64 *)(*relr + offset);
*place++ += offset;
} else { for (u64 *p = place, r = *relr >> 1; r; p++, r >>= 1) if (r & 1)
*p += offset;
place += 63;
}
}
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.