File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -564,6 +564,22 @@ void SectionChunk::getBaserels(std::vector<Baserel> *res) {
564564 continue ;
565565 res->emplace_back (rva + rel.VirtualAddress , ty);
566566 }
567+
568+ // Insert a 64-bit relocation for CHPEMetadataPointer in the native load
569+ // config of a hybrid ARM64X image. Its value will be set in prepareLoadConfig
570+ // to match the value in the EC load config, which is expected to be
571+ // a relocatable pointer to the __chpe_metadata symbol.
572+ COFFLinkerContext &ctx = file->symtab .ctx ;
573+ if (ctx.hybridSymtab && ctx.symtab .loadConfigSym &&
574+ ctx.symtab .loadConfigSym ->getChunk () == this &&
575+ ctx.hybridSymtab ->loadConfigSym &&
576+ ctx.symtab .loadConfigSize >=
577+ offsetof (coff_load_configuration64, CHPEMetadataPointer) +
578+ sizeof (coff_load_configuration64::CHPEMetadataPointer))
579+ res->emplace_back (
580+ ctx.symtab .loadConfigSym ->getRVA () +
581+ offsetof (coff_load_configuration64, CHPEMetadataPointer),
582+ IMAGE_REL_BASED_DIR64);
567583}
568584
569585// MinGW specific.
Original file line number Diff line number Diff line change 118118// BASERELOC: BaseReloc [
119119// BASERELOC-NEXT: Entry {
120120// BASERELOC-NEXT: Type: DIR64
121+ // BASERELOC-NEXT: Address: 0x10C8
122+ // BASERELOC-NEXT: }
123+ // BASERELOC-NEXT: Entry {
124+ // BASERELOC-NEXT: Type: DIR64
121125// BASERELOC-NEXT: Address: 0x1208
122126// BASERELOC-NEXT: }
123127// BASERELOC-NEXT: Entry {
124- // BASERELOC: Type: DIR64
128+ // BASERELOC-NEXT: Type: DIR64
125129// BASERELOC-NEXT: Address: 0x2074
126130// BASERELOC-NEXT: }
127131
You can’t perform that action at this time.
0 commit comments