Skip to content
Commit 1136ec64 authored by George Rimar's avatar George Rimar
Browse files

[ELF] - Fix crash relative to SHF_LINK_ORDER sections.

Our code assumes all input sections in an output SHF_LINK_ORDER
section has SHF_LINK_ORDER flag. We do not check that and that can cause a crash.

That happens because we call 
std::stable_sort(Sections.begin(), Sections.end(), compareByFilePosition);, 
where compareByFilePosition predicate does not expect to see
null when calls getLinkOrderDep. 

The same might happen when sections refer to non-regular sections. 
Test cases demonstrate the issues, patch fixes them.

Differential revision: https://reviews.llvm.org/D44193

llvm-svn: 327006
parent 6d1aec12
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment