[lld] r251195 - ELF2: Move Writer class to the top of the file. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 24 11:22:59 PDT 2015
Author: ruiu
Date: Sat Oct 24 13:22:59 2015
New Revision: 251195
URL: http://llvm.org/viewvc/llvm-project?rev=251195&view=rev
Log:
ELF2: Move Writer class to the top of the file. NFC.
Modified:
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=251195&r1=251194&r2=251195&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Sat Oct 24 13:22:59 2015
@@ -26,16 +26,6 @@ using namespace lld;
using namespace lld::elf2;
namespace {
-
-static uint32_t toPhdrFlags(uint64_t Flags) {
- uint32_t Ret = PF_R;
- if (Flags & SHF_WRITE)
- Ret |= PF_W;
- if (Flags & SHF_EXECINSTR)
- Ret |= PF_X;
- return Ret;
-}
-
// The writer writes a SymbolTable result to a file.
template <class ELFT> class Writer {
public:
@@ -612,6 +602,15 @@ template <class ELFT> static bool needsP
return Sec->getFlags() & SHF_ALLOC;
}
+static uint32_t toPhdrFlags(uint64_t Flags) {
+ uint32_t Ret = PF_R;
+ if (Flags & SHF_WRITE)
+ Ret |= PF_W;
+ if (Flags & SHF_EXECINSTR)
+ Ret |= PF_X;
+ return Ret;
+}
+
// Visits all sections to create PHDRs and to assign incremental,
// non-overlapping addresses to output sections.
template <class ELFT> void Writer<ELFT>::assignAddresses() {
More information about the llvm-commits
mailing list