[lld] r315113 - Inline a small function.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 6 14:32:23 PDT 2017
Author: ruiu
Date: Fri Oct 6 14:32:23 2017
New Revision: 315113
URL: http://llvm.org/viewvc/llvm-project?rev=315113&view=rev
Log:
Inline a small function.
Modified:
lld/trunk/ELF/OutputSections.cpp
Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=315113&r1=315112&r2=315113&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Fri Oct 6 14:32:23 2017
@@ -76,12 +76,6 @@ OutputSection::OutputSection(StringRef N
Live = false;
}
-static uint64_t updateOffset(uint64_t Off, InputSection *S) {
- Off = alignTo(Off, S->Alignment);
- S->OutSecOff = Off;
- return Off + S->getSize();
-}
-
void OutputSection::addSection(InputSection *S) {
assert(S->Live);
Live = true;
@@ -92,13 +86,14 @@ void OutputSection::addSection(InputSect
// crude approximation so that it is at least easy for other code to know the
// section order. It is also used to calculate the output section size early
// for compressed debug sections.
- this->Size = updateOffset(Size, S);
+ S->OutSecOff = alignTo(Size, S->Alignment);
+ this->Size = S->OutSecOff + S->getSize();
// If this section contains a table of fixed-size entries, sh_entsize
// holds the element size. Consequently, if this contains two or more
// input sections, all of them must have the same sh_entsize. However,
// you can put different types of input sections into one output
- // sectin by using linker scripts. I don't know what to do here.
+ // section by using linker scripts. I don't know what to do here.
// Probably we sholuld handle that as an error. But for now we just
// pick the largest sh_entsize.
this->Entsize = std::max(this->Entsize, S->Entsize);
More information about the llvm-commits
mailing list