@@ -1458,32 +1458,9 @@ template <class ELFT> void Writer<ELFT>::finalizeAddressDependentContent() {
1458
1458
in.mipsGot ->updateAllocSize ();
1459
1459
1460
1460
for (Partition &part : partitions) {
1461
- // The R_AARCH64_AUTH_RELATIVE has a smaller addend field as bits [63:32]
1462
- // encode the signing schema. We've put relocations in .relr.auth.dyn
1463
- // during RelocationScanner::processAux, but the target VA for some of
1464
- // them might be wider than 32 bits. We can only know the final VA at this
1465
- // point, so move relocations with large values from .relr.auth.dyn to
1466
- // .rela.dyn. See also AArch64::relocate.
1467
- if (part.relrAuthDyn ) {
1468
- auto it = llvm::remove_if (
1469
- part.relrAuthDyn ->relocs , [&part](const RelativeReloc &elem) {
1470
- const Relocation &reloc = elem.inputSec ->relocs ()[elem.relocIdx ];
1471
- if (isInt<32 >(reloc.sym ->getVA (reloc.addend )))
1472
- return false ;
1473
- part.relaDyn ->addReloc ({R_AARCH64_AUTH_RELATIVE, elem.inputSec ,
1474
- reloc.offset ,
1475
- DynamicReloc::AddendOnlyWithTargetVA,
1476
- *reloc.sym , reloc.addend , R_ABS});
1477
- return true ;
1478
- });
1479
- changed |= (it != part.relrAuthDyn ->relocs .end ());
1480
- part.relrAuthDyn ->relocs .erase (it, part.relrAuthDyn ->relocs .end ());
1481
- }
1482
1461
changed |= part.relaDyn ->updateAllocSize ();
1483
1462
if (part.relrDyn )
1484
1463
changed |= part.relrDyn ->updateAllocSize ();
1485
- if (part.relrAuthDyn )
1486
- changed |= part.relrAuthDyn ->updateAllocSize ();
1487
1464
if (part.memtagGlobalDescriptors )
1488
1465
changed |= part.memtagGlobalDescriptors ->updateAllocSize ();
1489
1466
}
@@ -1647,14 +1624,6 @@ static void removeUnusedSyntheticSections() {
1647
1624
auto *sec = cast<SyntheticSection>(s);
1648
1625
if (sec->getParent () && sec->isNeeded ())
1649
1626
return false ;
1650
- // .relr.auth.dyn relocations may be moved to .rela.dyn in
1651
- // finalizeAddressDependentContent, making .rela.dyn no longer empty.
1652
- // Conservatively keep .rela.dyn. .relr.auth.dyn can be made empty, but
1653
- // we would fail to remove it here.
1654
- if (config->emachine == EM_AARCH64 && config->relrPackDynRelocs )
1655
- if (auto *relSec = dyn_cast<RelocationBaseSection>(sec))
1656
- if (relSec == mainPart->relaDyn .get ())
1657
- return false ;
1658
1627
unused.insert (sec);
1659
1628
return true ;
1660
1629
});
@@ -1967,10 +1936,6 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
1967
1936
part.relrDyn ->mergeRels ();
1968
1937
finalizeSynthetic (part.relrDyn .get ());
1969
1938
}
1970
- if (part.relrAuthDyn ) {
1971
- part.relrAuthDyn ->mergeRels ();
1972
- finalizeSynthetic (part.relrAuthDyn .get ());
1973
- }
1974
1939
1975
1940
finalizeSynthetic (part.dynSymTab .get ());
1976
1941
finalizeSynthetic (part.gnuHashTab .get ());
0 commit comments