Move clearOutputSections earlier. NFC.

llvm-svn: 304948
This commit is contained in:
Rafael Espindola 2017-06-07 22:27:51 +00:00
parent 2356c9ffae
commit fa6fcff2e3
1 changed files with 1 additions and 2 deletions

View File

@ -1230,6 +1230,7 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
for (BaseCommand *Base : Script->Opt.Commands)
if (auto *Cmd = dyn_cast<OutputSectionCommand>(Base))
OutputSectionCommands.push_back(Cmd);
clearOutputSections();
// Dynamic section must be the last one in this list and dynamic
// symbol table section (DynSymTab) must be the first one.
@ -1243,8 +1244,6 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
In<ELFT>::VerSym, In<ELFT>::VerNeed, InX::Dynamic},
[](SyntheticSection *SS) { SS->finalizeContents(); });
clearOutputSections();
// Some architectures use small displacements for jump instructions.
// It is linker's responsibility to create thunks containing long
// jump instructions if jump targets are too far. Create thunks.