@@ -456,9 +456,6 @@ template <class ELFT> void elf::createSyntheticSections() {
456
456
if (config->relrPackDynRelocs ) {
457
457
part.relrDyn = std::make_unique<RelrSection<ELFT>>(threadCount);
458
458
add (*part.relrDyn );
459
- part.relrAuthDyn = std::make_unique<RelrSection<ELFT>>(
460
- threadCount, /* isAArch64Auth=*/ true );
461
- add (*part.relrAuthDyn );
462
459
}
463
460
464
461
if (!config->relocatable ) {
@@ -1733,33 +1730,9 @@ template <class ELFT> void Writer<ELFT>::finalizeAddressDependentContent() {
1733
1730
in.mipsGot ->updateAllocSize ();
1734
1731
1735
1732
for (Partition &part : partitions) {
1736
- // The R_AARCH64_AUTH_RELATIVE has a smaller addend field as bits [63:32]
1737
- // encode the signing schema. We've put relocations in .relr.auth.dyn
1738
- // during RelocationScanner::processAux, but the target VA for some of
1739
- // them might be wider than 32 bits. We can only know the final VA at this
1740
- // point, so move relocations with large values from .relr.auth.dyn to
1741
- // .rela.dyn.
1742
- if (part.relrAuthDyn ) {
1743
- auto it = llvm::remove_if (
1744
- part.relrAuthDyn ->relocs , [&part](const RelativeReloc &elem) {
1745
- const Relocation &reloc = elem.inputSec ->relocs ()[elem.relocIdx ];
1746
- if (isInt<32 >(reloc.sym ->getVA (reloc.addend )))
1747
- return false ;
1748
- part.relaDyn ->addReloc ({R_AARCH64_AUTH_RELATIVE, elem.inputSec ,
1749
- reloc.offset ,
1750
- DynamicReloc::AddendOnlyWithTargetVA,
1751
- *reloc.sym , reloc.addend , R_ABS});
1752
- // See also AArch64::relocate
1753
- return true ;
1754
- });
1755
- changed |= (it != part.relrAuthDyn ->relocs .end ());
1756
- part.relrAuthDyn ->relocs .erase (it, part.relrAuthDyn ->relocs .end ());
1757
- }
1758
1733
changed |= part.relaDyn ->updateAllocSize ();
1759
1734
if (part.relrDyn )
1760
1735
changed |= part.relrDyn ->updateAllocSize ();
1761
- if (part.relrAuthDyn )
1762
- changed |= part.relrAuthDyn ->updateAllocSize ();
1763
1736
if (part.memtagGlobalDescriptors )
1764
1737
changed |= part.memtagGlobalDescriptors ->updateAllocSize ();
1765
1738
}
@@ -1910,14 +1883,6 @@ static void removeUnusedSyntheticSections() {
1910
1883
auto *sec = cast<SyntheticSection>(s);
1911
1884
if (sec->getParent () && sec->isNeeded ())
1912
1885
return false ;
1913
- // .relr.auth.dyn relocations may be moved to .rela.dyn in
1914
- // finalizeAddressDependentContent, making .rela.dyn no longer empty.
1915
- // Conservatively keep .rela.dyn. .relr.auth.dyn can be made empty, but
1916
- // we would fail to remove it here.
1917
- if (config->emachine == EM_AARCH64 && config->relrPackDynRelocs )
1918
- if (auto *relSec = dyn_cast<RelocationBaseSection>(sec))
1919
- if (relSec == mainPart->relaDyn .get ())
1920
- return false ;
1921
1886
unused.insert (sec);
1922
1887
return true ;
1923
1888
});
@@ -2230,10 +2195,6 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
2230
2195
part.relrDyn ->mergeRels ();
2231
2196
finalizeSynthetic (part.relrDyn .get ());
2232
2197
}
2233
- if (part.relrAuthDyn ) {
2234
- part.relrAuthDyn ->mergeRels ();
2235
- finalizeSynthetic (part.relrAuthDyn .get ());
2236
- }
2237
2198
2238
2199
finalizeSynthetic (part.dynSymTab .get ());
2239
2200
finalizeSynthetic (part.gnuHashTab .get ());
0 commit comments