File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1466,6 +1466,11 @@ Error RewriteInstance::discoverRtInitAddress() {
14661466 if (auto EC = InitArraySection.getError ())
14671467 return errorCodeToError (EC);
14681468
1469+ if (InitArraySection->getAddress () != *BC->InitArrayAddress ) {
1470+ return createStringError (std::errc::not_supported,
1471+ " Inconsistent address of .init_array section" );
1472+ }
1473+
14691474 if (const Relocation *Reloc = InitArraySection->getDynamicRelocationAt (0 )) {
14701475 if (Reloc->isRelative ()) {
14711476 BC->StartFunctionAddress = Reloc->Addend ;
@@ -1517,6 +1522,11 @@ Error RewriteInstance::discoverRtFiniAddress() {
15171522 if (auto EC = FiniArraySection.getError ())
15181523 return errorCodeToError (EC);
15191524
1525+ if (FiniArraySection->getAddress () != *BC->FiniArrayAddress ) {
1526+ return createStringError (std::errc::not_supported,
1527+ " Inconsistent address of .fini_array section" );
1528+ }
1529+
15201530 if (const Relocation *Reloc = FiniArraySection->getDynamicRelocationAt (0 )) {
15211531 BC->FiniFunctionAddress = Reloc->Addend ;
15221532 return Error::success ();
You can’t perform that action at this time.
0 commit comments