Home | History | Annotate | Download | only in src

Lines Matching refs:relocations

346     // relocations in the shared object.
348 // DT_RELSZ is the overall size of relocations. Adjust by hole size.
357 // of R_ARM_RELATIVE relocations, and DT_RELCOUNT is the count of
358 // relative relocations. So closing a hole on packing reduces
631 // Apply R_ARM_RELATIVE relocations to the file data to which they refer.
637 const std::vector<Elf32_Rel>& relocations) {
655 for (size_t i = 0; i < relocations.size(); ++i) {
656 const Elf32_Rel* relocation = &relocations[i];
689 // Pad relocations with a given number of R_ARM_NONE relocations.
691 std::vector<Elf32_Rel>* relocations) {
694 relocations->insert(relocations->end(), padding.begin(), padding.end());
697 // Adjust relocations so that the offset that they indicate will be correct
699 // relocations).
702 std::vector<Elf32_Rel>* relocations) {
703 for (size_t i = 0; i < relocations->size(); ++i) {
704 Elf32_Rel* relocation = &relocations->at(i);
726 // Convert data to a vector of Elf32 relocations.
728 std::vector<Elf32_Rel> relocations(
730 relocations_base + data->d_size / sizeof(relocations[0]));
735 // Filter relocations into those that are R_ARM_RELATIVE and others.
736 for (size_t i = 0; i < relocations.size(); ++i) {
737 const Elf32_Rel& relocation = relocations[i];
747 LOG("Total : %lu entries\n", relocations.size());
749 // If no relative relocations then we have nothing packable. Perhaps
752 LOG("ERROR: No R_ARM_RELATIVE relocations found (already packed?)\n");
756 // Unless padding, pre-apply R_ARM_RELATIVE relocations to account for the
773 LOG("Too few R_ARM_RELATIVE relocations to pack after alignment\n");
777 // Add R_ARM_NONE relocations to other_relocations to preserve alignment.
782 LOG("Alignment pad : %lu relocations\n", required);
784 // Apply relocations to all R_ARM_RELATIVE data to relocate it into the
787 // Relocate the relocations.
791 // If padding, add R_ARM_NONE relocations to other_relocations to make it
792 // the same size as the the original relocations we read in. This makes
794 const size_t required = relocations.size() - other_relocations.size();
799 // Pack R_ARM_RELATIVE relocations.
810 // If we have insufficient R_ARM_RELATIVE relocations to form a run then
813 LOG("Too few R_ARM_RELATIVE relocations to pack\n");
828 LOG("Packing R_ARM_RELATIVE relocations saves no space\n");
833 // relocations, then shrink it to size.
840 // R_ARM_RELATIVE relocations.
867 // Find packed R_ARM_RELATIVE relocations in .android.rel.dyn, unpack them,
889 LOG("ERROR: Packed R_ARM_RELATIVE relocations not found (not packed?)\n");
893 // Unpack the data to re-materialize the R_ARM_RELATIVE relocations.
906 // Interpret data as Elf32 relocations.
908 std::vector<Elf32_Rel> relocations(
910 relocations_base + data->d_size / sizeof(relocations[0]));
915 // Filter relocations to locate any that are R_ARM_NONE. These will occur
917 for (size_t i = 0; i < relocations.size(); ++i) {
918 const Elf32_Rel& relocation = relocations[i];
929 // hold as unpacked relative relocations, then this is a padded file.
932 // Unless padded, pre-apply R_ARM_RELATIVE relocations to account for the
946 // Apply relocations to all R_ARM_RELATIVE data to relocate it into the
949 // Relocate the relocations.
954 // Rewrite the current .rel.dyn section to be the R_ARM_RELATIVE relocations
955 // followed by other relocations. This is the usual order in which we find
958 relocations.assign(relative_relocations.begin(), relative_relocations.end());
959 relocations.insert(relocations.end(),
961 const void* section_data = &relocations[0];
962 const size_t bytes = relocations.size() * sizeof(relocations[0]);
963 LOG("Total : %lu entries\n", relocations.size());