diff options
Diffstat (limited to 'lld/ELF/Writer.cpp')
-rw-r--r-- | lld/ELF/Writer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index a0ae508b2eb..0715bf04d6d 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -1027,12 +1027,6 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() { if (In<ELFT>::Iplt && !In<ELFT>::Iplt->empty()) In<ELFT>::Iplt->addSymbols(); - // 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. - if (Target->NeedsThunks) - createThunks<ELFT>(OutputSections); - // Now that we have defined all possible symbols including linker- // synthesized ones. Visit all symbols to give the finishing touches. for (Symbol *S : Symtab<ELFT>::X->getSymbols()) { @@ -1078,6 +1072,12 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() { fixHeaders(); } + // 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. + if (Target->NeedsThunks) + createThunks<ELFT>(OutputSections); + // Fill other section headers. The dynamic table is finalized // at the end because some tags like RELSZ depend on result // of finalizing other sections. |