aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/ELFObjectWriter.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2020-02-05 11:24:15 -0800
committerFangrui Song <maskray@google.com>2020-02-06 11:31:04 -0800
commit727362e87bb3e35e812a44f41d08791683a04f5d (patch)
treec72c249ed5350152954b6beba1ac17002e7ef326 /llvm/lib/MC/ELFObjectWriter.cpp
parent208470dd5d0a46bc3c24b66489b687eda4954262 (diff)
downloadllvm-727362e87bb3e35e812a44f41d08791683a04f5d.zip
llvm-727362e87bb3e35e812a44f41d08791683a04f5d.tar.gz
llvm-727362e87bb3e35e812a44f41d08791683a04f5d.tar.bz2
[MC][ELF] Rename MC related "Associated" to "LinkedToSym"
"linked-to section" is used by the ELF spec. By analogy, "linked-to symbol" is a good name for the signature symbol. The word "linked-to" implies a directed edge and makes it clear its relation with "sh_link", while one can argue that "associated" means an undirected edge. Also, combine tests and add precise SMLoc to improve diagnostics. Reviewed By: eugenis, grimar, jhenderson Differential Revision: https://reviews.llvm.org/D74082
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 804f999..f9431d5 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -1001,7 +1001,7 @@ void ELFWriter::writeSection(const SectionIndexMapTy &SectionIndexMap,
case ELF::SHT_RELA: {
sh_link = SymbolTableIndex;
assert(sh_link && ".symtab not found");
- const MCSection *InfoSection = Section.getAssociatedSection();
+ const MCSection *InfoSection = Section.getLinkedToSection();
sh_info = SectionIndexMap.lookup(cast<MCSectionELF>(InfoSection));
break;
}
@@ -1024,7 +1024,7 @@ void ELFWriter::writeSection(const SectionIndexMapTy &SectionIndexMap,
}
if (Section.getFlags() & ELF::SHF_LINK_ORDER) {
- const MCSymbol *Sym = Section.getAssociatedSymbol();
+ const MCSymbol *Sym = Section.getLinkedToSymbol();
const MCSectionELF *Sec = cast<MCSectionELF>(&Sym->getSection());
sh_link = SectionIndexMap.lookup(Sec);
}
@@ -1180,7 +1180,7 @@ uint64_t ELFWriter::writeObject(MCAssembler &Asm, const MCAsmLayout &Layout) {
uint64_t SecStart = W.OS.tell();
writeRelocations(Asm,
- cast<MCSectionELF>(*RelSection->getAssociatedSection()));
+ cast<MCSectionELF>(*RelSection->getLinkedToSection()));
uint64_t SecEnd = W.OS.tell();
SectionOffsets[RelSection] = std::make_pair(SecStart, SecEnd);