diff options
Diffstat (limited to 'lld/ELF/OutputSections.cpp')
-rw-r--r-- | lld/ELF/OutputSections.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 972457ae43a..02539f5c546 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -681,15 +681,15 @@ template <class ELFT> void DynamicSection<ELFT>::finalize() { if (Out<ELFT>::PreinitArray) { Add({DT_PREINIT_ARRAY, Out<ELFT>::PreinitArray}); - Add({DT_PREINIT_ARRAYSZ, Out<ELFT>::PreinitArray->getSize()}); + Add({DT_PREINIT_ARRAYSZ, Out<ELFT>::PreinitArray, Entry::SecSize}); } if (Out<ELFT>::InitArray) { Add({DT_INIT_ARRAY, Out<ELFT>::InitArray}); - Add({DT_INIT_ARRAYSZ, (uintX_t)Out<ELFT>::InitArray->getSize()}); + Add({DT_INIT_ARRAYSZ, Out<ELFT>::InitArray, Entry::SecSize}); } if (Out<ELFT>::FiniArray) { Add({DT_FINI_ARRAY, Out<ELFT>::FiniArray}); - Add({DT_FINI_ARRAYSZ, (uintX_t)Out<ELFT>::FiniArray->getSize()}); + Add({DT_FINI_ARRAYSZ, Out<ELFT>::FiniArray, Entry::SecSize}); } if (SymbolBody *B = Symtab<ELFT>::X->find(Config->Init)) @@ -760,6 +760,9 @@ template <class ELFT> void DynamicSection<ELFT>::writeTo(uint8_t *Buf) { case Entry::SecAddr: P->d_un.d_ptr = E.OutSec->getVA(); break; + case Entry::SecSize: + P->d_un.d_val = E.OutSec->getSize(); + break; case Entry::SymAddr: P->d_un.d_ptr = E.Sym->template getVA<ELFT>(); break; |