[lld] r315268 - Add comments.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 9 20:58:19 PDT 2017
Author: ruiu
Date: Mon Oct 9 20:58:18 2017
New Revision: 315268
URL: http://llvm.org/viewvc/llvm-project?rev=315268&view=rev
Log:
Add comments.
Modified:
lld/trunk/ELF/SyntheticSections.cpp
Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=315268&r1=315267&r2=315268&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Mon Oct 9 20:58:18 2017
@@ -589,6 +589,8 @@ uint64_t EhFrameSection<ELFT>::getFdePc(
template <class ELFT> void EhFrameSection<ELFT>::writeTo(uint8_t *Buf) {
const endianness E = ELFT::TargetEndianness;
+
+ // Write CIE and FDE records.
for (CieRecord *Rec : CieRecords) {
size_t CieOffset = Rec->Cie->OutputOff;
writeCieFde<ELFT>(Buf + CieOffset, Rec->Cie->data());
@@ -603,6 +605,9 @@ template <class ELFT> void EhFrameSectio
}
}
+ // Apply relocations. .eh_frame section contents are not contiguous
+ // in the output buffer, but relocateAlloc() still works because
+ // getOffset() takes care of discontiguous section pieces.
for (EhInputSection *S : Sections)
S->relocateAlloc(Buf, nullptr);
More information about the llvm-commits
mailing list