diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-12-19 17:01:01 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-12-19 17:01:01 +0000 |
| commit | 17cb7c0a2a40151960d5e105bd2b7d9772c97086 (patch) | |
| tree | 7d93d79b2cd30062a9c977394a658efbcb2c4a5d /lld/ELF/LinkerScript.cpp | |
| parent | 980688cdaf274e80394bd9ead0bba957c40eaab2 (diff) | |
Detemplate PhdrEntry. NFC.
llvm-svn: 290115
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
| -rw-r--r-- | lld/ELF/LinkerScript.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index ab6435c5482e..b99ddd7dfd68 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -714,7 +714,7 @@ template <class ELFT> void LinkerScript<ELFT>::placeOrphanSections() { } template <class ELFT> -void LinkerScript<ELFT>::assignAddresses(std::vector<PhdrEntry<ELFT>> &Phdrs) { +void LinkerScript<ELFT>::assignAddresses(std::vector<PhdrEntry> &Phdrs) { // Assign addresses as instructed by linker script SECTIONS sub-commands. Dot = 0; @@ -749,9 +749,8 @@ void LinkerScript<ELFT>::assignAddresses(std::vector<PhdrEntry<ELFT>> &Phdrs) { uintX_t HeaderSize = getHeaderSize(); auto FirstPTLoad = - std::find_if(Phdrs.begin(), Phdrs.end(), [](const PhdrEntry<ELFT> &E) { - return E.H.p_type == PT_LOAD; - }); + std::find_if(Phdrs.begin(), Phdrs.end(), + [](const PhdrEntry &E) { return E.p_type == PT_LOAD; }); if (FirstPTLoad == Phdrs.end()) return; @@ -771,15 +770,14 @@ void LinkerScript<ELFT>::assignAddresses(std::vector<PhdrEntry<ELFT>> &Phdrs) { } // Creates program headers as instructed by PHDRS linker script command. -template <class ELFT> -std::vector<PhdrEntry<ELFT>> LinkerScript<ELFT>::createPhdrs() { - std::vector<PhdrEntry<ELFT>> Ret; +template <class ELFT> std::vector<PhdrEntry> LinkerScript<ELFT>::createPhdrs() { + std::vector<PhdrEntry> Ret; // Process PHDRS and FILEHDR keywords because they are not // real output sections and cannot be added in the following loop. for (const PhdrsCommand &Cmd : Opt.PhdrsCommands) { Ret.emplace_back(Cmd.Type, Cmd.Flags == UINT_MAX ? PF_R : Cmd.Flags); - PhdrEntry<ELFT> &Phdr = Ret.back(); + PhdrEntry &Phdr = Ret.back(); if (Cmd.HasFilehdr) Phdr.add(Out<ELFT>::ElfHeader); @@ -787,7 +785,7 @@ std::vector<PhdrEntry<ELFT>> LinkerScript<ELFT>::createPhdrs() { Phdr.add(Out<ELFT>::ProgramHeaders); if (Cmd.LMAExpr) { - Phdr.H.p_paddr = Cmd.LMAExpr(0); + Phdr.p_paddr = Cmd.LMAExpr(0); Phdr.HasLMA = true; } } @@ -801,7 +799,7 @@ std::vector<PhdrEntry<ELFT>> LinkerScript<ELFT>::createPhdrs() { for (size_t Id : getPhdrIndices(Sec->getName())) { Ret[Id].add(Sec); if (Opt.PhdrsCommands[Id].Flags == UINT_MAX) - Ret[Id].H.p_flags |= Sec->getPhdrFlags(); + Ret[Id].p_flags |= Sec->getPhdrFlags(); } } return Ret; |
