ELF: Write .eh_frame_hdr explicitly after writing .eh_frame.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 28 Feb 2019 23:11:35 +0000 (23:11 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 28 Feb 2019 23:11:35 +0000 (23:11 +0000)
commit7fb9eabda56e02dce024bf92590d97c038700f7d
treeceb61baa0131264d9d0c249c6ed7aef69b0817fe
parent701593f1dbff225e39f8a25cfd2bfbc3f246f296
ELF: Write .eh_frame_hdr explicitly after writing .eh_frame.

This lets us remove the special case from Writer::writeSections(), and also
fixes a bug where .eh_frame_hdr isn't necessarily written in the correct
order if a linker script moves .eh_frame and .eh_frame_hdr into the same
output section.

Differential Revision: https://reviews.llvm.org/D58795

llvm-svn: 355153
lld/ELF/OutputSections.cpp
lld/ELF/OutputSections.h
lld/ELF/SyntheticSections.cpp
lld/ELF/SyntheticSections.h
lld/ELF/Target.cpp
lld/ELF/Writer.cpp
lld/test/ELF/linkerscript/eh-frame-merge.s [new file with mode: 0644]