diff --git a/lld/ELF/ADLTSection.h b/lld/ELF/ADLTSection.h index b4ba5966741d9d58326a2b77426d4e3b0556fee4..3441ddb8af2947da4b3cac8ec5b44d0a74f87184 100644 --- a/lld/ELF/ADLTSection.h +++ b/lld/ELF/ADLTSection.h @@ -102,6 +102,7 @@ typedef struct { adlt_hash_type_t stringHashType; // contains adlt_hash_type_enum_t value Elf64_Off blobStart; // offset of binary blob start relative to .adlt Elf64_Xword blobSize; + Elf64_Xword overallMappedSize; // bytes, required to map the whole ADLT image } adlt_section_header_t; static const char adltBlobStartMark[4] = { 0xA, 0xD, 0x1, 0x7 }; diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 6ac5296c1530bb36f815c2b03b1f0c2032c6b68b..8f51cc9600a61cfa71fd8f32ee0618613e2289be 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -4020,8 +4020,8 @@ static_assert(sizeof(adltBlobStartMark) == 4, "0xad17 consist of 4 bytes" ); -static_assert(sizeof(adlt_section_header_t) == 32, - "please udpate major version if header has been changed" +static_assert(sizeof(adlt_section_header_t) == 40, + "please udpate version if header has been changed" ); static_assert(sizeof(adlt_psod_t) == 128, @@ -4058,8 +4058,11 @@ void AdltSection::finalizeContents() { ADLT_HASH_TYPE_GNU_HASH, // .stringHashType getBlobStartOffset(), // .blobStart estimateBlobSize(), // .blobSize + 0, // .overallMappedSize }; + // TODO: estimate and fill overallMappedSize + buildSonameIndex(); linkInternalDtNeeded(); extractInitFiniArray();