Skip to content

Commit e68efcf

Browse files
committed
Address review comments
1 parent 411d04c commit e68efcf

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

lld/ELF/Arch/AArch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ void AArch64::relocate(uint8_t *loc, const Relocation &rel,
433433
// .relr.auth.dyn to .rela.dyn, and the addend write is not needed.
434434
//
435435
// If val fits in 32 bits, we have two potential scenarios:
436-
// * True RELR: Write the 32-bit `val`
436+
// * True RELR: Write the 32-bit `val`.
437437
// * RELA: Even if the value now fits in 32 bits, it might have been
438438
// converted from RELR during an iteration in
439439
// finalizeAddressDependentContent(). Writing the value is harmless

lld/ELF/SyntheticSections.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,8 @@ class RelocationBaseSection : public SyntheticSection {
549549
return SyntheticSection::classof(d) &&
550550
(d->type == llvm::ELF::SHT_RELA || d->type == llvm::ELF::SHT_REL ||
551551
d->type == llvm::ELF::SHT_RELR ||
552-
(config->emachine == llvm::ELF::EM_AARCH64 &&
553-
d->type == llvm::ELF::SHT_AARCH64_AUTH_RELR));
552+
(d->type == llvm::ELF::SHT_AARCH64_AUTH_RELR &&
553+
config->emachine == llvm::ELF::EM_AARCH64));
554554
}
555555
int32_t dynamicTag, sizeDynamicTag;
556556
SmallVector<DynamicReloc, 0> relocs;

lld/ELF/Writer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,7 +1459,7 @@ template <class ELFT> void Writer<ELFT>::finalizeAddressDependentContent() {
14591459
// during RelocationScanner::processAux, but the target VA for some of
14601460
// them might be wider than 32 bits. We can only know the final VA at this
14611461
// point, so move relocations with large values from .relr.auth.dyn to
1462-
// .rela.dyn.
1462+
// .rela.dyn. See also AArch64::relocate.
14631463
if (part.relrAuthDyn) {
14641464
auto it = llvm::remove_if(
14651465
part.relrAuthDyn->relocs, [&part](const RelativeReloc &elem) {
@@ -1470,7 +1470,6 @@ template <class ELFT> void Writer<ELFT>::finalizeAddressDependentContent() {
14701470
reloc.offset,
14711471
DynamicReloc::AddendOnlyWithTargetVA,
14721472
*reloc.sym, reloc.addend, R_ABS});
1473-
// See also AArch64::relocate
14741473
return true;
14751474
});
14761475
changed |= (it != part.relrAuthDyn->relocs.end());

0 commit comments

Comments
 (0)