forked from OSchip/llvm-project
Avoid using EhFrameHdr->Sections.
This is a necessary step for moving clearOutputSections earlier. llvm-svn: 304009
This commit is contained in:
parent
d23e9267a6
commit
881cc1643a
|
@ -1785,7 +1785,9 @@ template <class ELFT> void Writer<ELFT>::writeSections() {
|
|||
}
|
||||
|
||||
OutputSection *EhFrameHdr =
|
||||
In<ELFT>::EhFrameHdr ? In<ELFT>::EhFrameHdr->OutSec : nullptr;
|
||||
(In<ELFT>::EhFrameHdr && !In<ELFT>::EhFrameHdr->empty())
|
||||
? In<ELFT>::EhFrameHdr->OutSec
|
||||
: nullptr;
|
||||
|
||||
// In -r or -emit-relocs mode, write the relocation sections first as in
|
||||
// ELf_Rel targets we might find out that we need to modify the relocated
|
||||
|
@ -1811,7 +1813,7 @@ template <class ELFT> void Writer<ELFT>::writeSections() {
|
|||
|
||||
// The .eh_frame_hdr depends on .eh_frame section contents, therefore
|
||||
// it should be written after .eh_frame is written.
|
||||
if (EhFrameHdr && !EhFrameHdr->Sections.empty()) {
|
||||
if (EhFrameHdr) {
|
||||
OutputSectionCommand *Cmd = Script->getCmd(EhFrameHdr);
|
||||
Cmd->writeTo<ELFT>(Buf + EhFrameHdr->Offset);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue