diff options
| -rw-r--r-- | lld/ELF/OutputSections.cpp | 2 | ||||
| -rw-r--r-- | lld/test/ELF/invalid-fde-rel.s | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 9e638ad17de..25ea64a3068 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -316,7 +316,7 @@ bool EhOutputSection<ELFT>::isFdeLive(EhSectionPiece &Piece, auto *Sec = cast<EhInputSection<ELFT>>(Piece.ID); unsigned FirstRelI = Piece.FirstRelocation; if (FirstRelI == (unsigned)-1) - fatal(toString(Sec) + ": FDE doesn't reference another section"); + return false; const RelTy &Rel = Rels[FirstRelI]; SymbolBody &B = Sec->getFile()->getRelocTargetSym(Rel); auto *D = dyn_cast<DefinedRegular<ELFT>>(&B); diff --git a/lld/test/ELF/invalid-fde-rel.s b/lld/test/ELF/invalid-fde-rel.s index 9fb73d2158d..f43b9da3003 100644 --- a/lld/test/ELF/invalid-fde-rel.s +++ b/lld/test/ELF/invalid-fde-rel.s @@ -1,7 +1,11 @@ // REQUIRES: x86 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t -// RUN: not ld.lld %t -o %t2 2>&1 | FileCheck %s +// RUN: ld.lld %t -o %t2 +// RUN: llvm-objdump -h %t2 | FileCheck %s + +// This resembles what gold -r produces when it discards the section +// the fde points to. .section .eh_frame .long 0x14 @@ -29,4 +33,4 @@ .long 0x0 .long 0x0 -// CHECK: FDE doesn't reference another section +// CHECK: 1 .eh_frame 00000018 |

