forked from OSchip/llvm-project
Fix a crash.
This is PR33821. What we really want to check in here is if the output section was created, not if the command was empty. llvm-svn: 308382
This commit is contained in:
parent
4158131512
commit
afbb7be6d5
|
@ -1330,7 +1330,7 @@ template <class ELFT> void Writer<ELFT>::addPredefinedSections() {
|
|||
// ARM ABI requires .ARM.exidx to be terminated by some piece of data.
|
||||
// We have the terminater synthetic section class. Add that at the end.
|
||||
OutputSectionCommand *Cmd = findSectionCommand(".ARM.exidx");
|
||||
if (!Cmd || Cmd->Commands.empty() || Config->Relocatable)
|
||||
if (!Cmd || !Cmd->Sec || Config->Relocatable)
|
||||
return;
|
||||
|
||||
auto *Sentinel = make<ARMExidxSentinelSection>();
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
# REQUIRES: x86
|
||||
|
||||
# We used to crash on this.
|
||||
|
||||
# RUN: llvm-mc %s -o %t.o -filetype=obj -triple=aarch64-pc-linux
|
||||
# RUN: echo "SECTIONS { .ARM.exidx : { *(.foo) } }" > %t.script
|
||||
# RUN: ld.lld -T %t.script %t.o -o %t
|
Loading…
Reference in New Issue