Home | History | Annotate | Download | only in linker

Lines Matching defs:oat_dex_file

633   for (const OatDexFile& oat_dex_file : oat_dex_files_) {
634 locations.push_back(oat_dex_file.GetLocation());
910 for (const OatDexFile& oat_dex_file : writer_->oat_dex_files_) {
911 num_classes += oat_dex_file.class_offsets_.size();
2253 for (OatDexFile& oat_dex_file : oat_dex_files_) {
2254 DCHECK_EQ(oat_dex_file.class_offsets_offset_, 0u);
2255 if (!oat_dex_file.class_offsets_.empty()) {
2258 oat_dex_file.class_offsets_offset_ = offset;
2259 offset += oat_dex_file.GetClassOffsetsRawSize();
2275 for (OatDexFile& oat_dex_file : oat_dex_files_) {
2276 for (uint32_t& class_offset : oat_dex_file.class_offsets_) {
2406 for (OatDexFile& oat_dex_file : oat_dex_files_) {
2407 oat_dex_file.offset_ = offset;
2408 offset += oat_dex_file.SizeOf();
2806 for (const OatDexFile& oat_dex_file : oat_dex_files_) {
2807 const off_t desired_offset = oat_dex_file.dex_file_offset_ -
3049 for (OatDexFile& oat_dex_file : oat_dex_files_) {
3050 if (oat_dex_file.class_offsets_offset_ != 0u) {
3060 if (!oat_dex_file.WriteClassOffsets(this, out)) {
3063 relative_offset += oat_dex_file.GetClassOffsetsRawSize();
3174 OatDexFile* oat_dex_file = &oat_dex_files_[i];
3178 DCHECK_EQ(relative_offset, oat_dex_file->method_bss_mapping_offset_);
3194 DCHECK_EQ(0u, oat_dex_file->method_bss_mapping_offset_);
3200 DCHECK_EQ(relative_offset, oat_dex_file->type_bss_mapping_offset_);
3216 DCHECK_EQ(0u, oat_dex_file->type_bss_mapping_offset_);
3222 DCHECK_EQ(relative_offset, oat_dex_file->string_bss_mapping_offset_);
3238 DCHECK_EQ(0u, oat_dex_file->string_bss_mapping_offset_);
3248 OatDexFile* oat_dex_file = &oat_dex_files_[i];
3249 DCHECK_EQ(relative_offset, oat_dex_file->offset_);
3253 if (!oat_dex_file->Write(this, out)) {
3256 relative_offset += oat_dex_file->SizeOf();
3346 for (OatDexFile& oat_dex_file : oat_dex_files_) {
3347 if (!oat_dex_file.source_.IsZipEntry()) {
3351 ZipEntry* entry = oat_dex_file.source_.GetZipEntry();
3369 for (OatDexFile& oat_dex_file : oat_dex_files_) {
3370 if (!WriteDexFile(out, file, &oat_dex_file, update_input_vdex)) {
3400 for (OatDexFile& oat_dex_file : oat_dex_files_) {
3403 if (!file->PreadFully(&header, sizeof(header), oat_dex_file.dex_file_offset_)) {
3411 CHECK_GT(vdex_dex_shared_data_offset_, oat_dex_file.dex_file_offset_);
3413 header.data_off_ = vdex_dex_shared_data_offset_ - oat_dex_file.dex_file_offset_;
3416 if (!file->PwriteFully(&header, sizeof(header), oat_dex_file.dex_file_offset_)) {
3426 for (OatDexFile& oat_dex_file : oat_dex_files_) {
3428 if (!file->PreadFully(&header, sizeof(header), oat_dex_file.dex_file_offset_)) {
3437 oat_dex_file.dex_file_offset_;
3443 if (oat_dex_file.source_.IsRawData()) {
3445 const uint8_t* cur_data_begin = oat_dex_file.source_.GetRawData() + header.data_off_;
3483 for (OatDexFile& oat_dex_file : oat_dex_files_) {
3484 oat_dex_file.source_.Clear(); // Get rid of the reference, it's about to be invalidated.
3493 OatDexFile* oat_dex_file,
3495 if (!SeekToDexFile(out, file, oat_dex_file)) {
3503 if (!LayoutAndWriteDexFile(out, oat_dex_file)) {
3506 } else if (oat_dex_file->source_.IsZipEntry()) {
3508 if (!WriteDexFile(out, file, oat_dex_file, oat_dex_file->source_.GetZipEntry())) {
3511 } else if (oat_dex_file->source_.IsRawFile()) {
3513 if (!WriteDexFile(out, file, oat_dex_file, oat_dex_file->source_.GetRawFile())) {
3517 DCHECK(oat_dex_file->source_.IsRawData());
3518 if (!WriteDexFile(out, oat_dex_file, oat_dex_file->source_.GetRawData(), update_input_vdex)) {
3524 DCHECK_EQ(vdex_size_, oat_dex_file->dex_file_offset_);
3525 vdex_size_ += oat_dex_file->dex_file_size_;
3526 size_dex_file_ += oat_dex_file->dex_file_size_;
3530 bool OatWriter::SeekToDexFile(OutputStream* out, File* file, OatDexFile* oat_dex_file) {
3549 << " File: " << oat_dex_file->GetLocation() << " Output: " << file->GetPath();
3554 << " File: " << oat_dex_file->GetLocation() << " Output: " << file->GetPath();
3561 << " File: " << oat_dex_file->GetLocation() << " Output: " << file->GetPath();
3566 oat_dex_file->dex_file_offset_ = start_offset;
3570 bool OatWriter::LayoutAndWriteDexFile(OutputStream* out, OatDexFile* oat_dex_file) {
3578 std::string location(oat_dex_file->GetLocation());
3581 if (oat_dex_file->source_.IsZipEntry()) {
3582 ZipEntry* zip_entry = oat_dex_file->source_.GetZipEntry();
3595 } else if (oat_dex_file->source_.IsRawFile()) {
3596 File* raw_file = oat_dex_file->source_.GetRawFile();
3609 CHECK(oat_dex_file->source_.IsRawData())
3610 << static_cast<size_t>(oat_dex_file->source_.GetType());
3611 const uint8_t* raw_dex_file = oat_dex_file->source_.GetRawData();
3615 DCHECK(ValidateDexFileHeader(raw_dex_file, oat_dex_file->GetLocation()));
3621 oat_dex_file->dex_file_location_checksum_,
3637 oat_dex_file->dex_sections_layout_ = dex_layout.GetSections();
3642 oat_dex_file->dex_file_size_ = header->file_size_;
3649 if (!WriteDexFile(out, oat_dex_file, dex_src, /* update_input_vdex */ false)) {
3656 CHECK_EQ(oat_dex_file->dex_file_location_checksum_, dex_file->GetLocationChecksum());
3662 OatDexFile* oat_dex_file,
3671 << " File: " << oat_dex_file->GetLocation() << " Output: " << file->GetPath();
3676 << " File: " << oat_dex_file->GetLocation() << " Output: " << file->GetPath();
3682 << " File: " << oat_dex_file->GetLocation() << " Output: " << file->GetPath();
3688 << " File: " << oat_dex_file->GetLocation() << " Output: " << file->GetPath();
3694 << extracted_size << " File: " << oat_dex_file->GetLocation();
3703 << " File: " << oat_dex_file->GetLocation() << " Output: " << file->GetPath();
3706 if (extracted_size < oat_dex_file->dex_file_size_) {
3708 oat_dex_file->dex_file_size_
3709 << " File: " << oat_dex_file->GetLocation();
3714 size_t end_offset = start_offset + oat_dex_file->dex_file_size_;
3719 << " File: " << oat_dex_file->GetLocation() << " Output: " << file->GetPath();
3725 << " Expected: " << end_offset << " File: " << oat_dex_file->GetLocation();
3730 << " File: " << oat_dex_file->GetLocation() << " Output: " << file->GetPath();
3735 if (extracted_size > oat_dex_file->dex_file_size_) {
3738 << " File: " << oat_dex_file->GetLocation()
3749 OatDexFile* oat_dex_file,
3758 << " File: " << oat_dex_file->GetLocation() << " Output: " << file->GetPath();
3763 if (!file->Copy(dex_file, 0, oat_dex_file->dex_file_size_)) {
3765 << " File: " << oat_dex_file->GetLocation() << " Output: " << file->GetPath();
3770 << " File: " << oat_dex_file->GetLocation() << " Output: " << file->GetPath();
3775 size_t end_offset = start_offset + oat_dex_file->dex_file_size_;
3780 << " File: " << oat_dex_file->GetLocation() << " Output: " << file->GetPath();
3786 << " Expected: " << end_offset << " File: " << oat_dex_file->GetLocation();
3791 << " File: " << oat_dex_file->GetLocation() << " Output: " << file->GetPath();
3799 OatDexFile* oat_dex_file,
3805 DCHECK(ValidateDexFileHeader(dex_file, oat_dex_file->GetLocation()));
3812 PLOG(ERROR) << "Failed to write dex file " << oat_dex_file->GetLocation()
3818 << " File: " << oat_dex_file->GetLocation();
3840 for (OatDexFile& oat_dex_file : oat_dex_files_) {
3842 MemMap* map = oat_dex_file.source_.GetZipEntry()->MapDirectlyOrExtract(
3843 oat_dex_file.dex_file_location_data_, "zipped dex", &error_msg);
3853 oat_dex_file.GetLocation(),
3854 oat_dex_file.dex_file_location_checksum_,
3855 /* oat_dex_file */ nullptr,
3860 LOG(ERROR) << "Failed to open dex file from oat file. File: " << oat_dex_file.GetLocation()
3864 oat_dex_file.class_offsets_.resize(dex_files.back()->GetHeader().class_defs_size_);
3895 for (OatDexFile& oat_dex_file : oat_dex_files_) {
3897 dex_files_map->Begin() + oat_dex_file.dex_file_offset_ - map_offset;
3902 CHECK(ValidateDexFileHeader(raw_dex_file, oat_dex_file.GetLocation()))
3908 CHECK_EQ(header->file_size_, oat_dex_file.dex_file_size_)
3910 << oat_dex_file.dex_file_size_ << " Actual: " << header->file_size_
3916 oat_dex_file.dex_file_size_,
3917 oat_dex_file.GetLocation(),
3918 oat_dex_file.dex_file_location_checksum_,
3919 /* oat_dex_file */ nullptr,
3924 LOG(ERROR) << "Failed to open dex file from oat file. File: " << oat_dex_file.GetLocation()
3931 oat_dex_file.class_offsets_.resize(dex_files.back()->GetHeader().class_defs_size_);
3954 OatDexFile* oat_dex_file = &oat_dex_files_[i];
3955 DCHECK_EQ(oat_dex_file->lookup_table_offset_, 0u);
3957 if (oat_dex_file->create_type_lookup_table_ != CreateTypeLookupTable::kCreate ||
3958 oat_dex_file->class_offsets_.empty()) {
3962 size_t table_size = TypeLookupTable::RawDataLength(oat_dex_file->class_offsets_.size());
3988 << " File: " << oat_dex_file->GetLocation()
4000 << " File: " << oat_dex_file->GetLocation()
4005 oat_dex_file->lookup_table_offset_ = rodata_offset;
4041 OatDexFile* oat_dex_file = &oat_dex_files_[i];
4042 DCHECK_EQ(oat_dex_file->dex_sections_layout_offset_, 0u);
4051 << " File: " << oat_dex_file->GetLocation()
4062 DCHECK(oat_dex_file != nullptr);
4063 if (!oat_rodata->WriteFully(&oat_dex_file->dex_sections_layout_,
4064 sizeof(oat_dex_file->dex_sections_layout_))) {
4066 << " File: " << oat_dex_file->GetLocation()
4070 oat_dex_file->dex_sections_layout_offset_ = rodata_offset;
4071 size_oat_dex_file_dex_layout_sections_ += sizeof(oat_dex_file->dex_sections_layout_);
4072 rodata_offset += sizeof(oat_dex_file->dex_sections_layout_);
4096 OatDexFile* oat_dex_file = &oat_dex_files_[i];
4098 &oat_dex_file->dex_file_location_checksum_, sizeof(VdexFile::VdexChecksum))) {
4422 const OatDexFile& oat_dex_file = oat_dex_files_[i];
4423 uint32_t dex_file_offset = oat_dex_file.dex_file_offset_;