Bug spotted by https://cookieplmonster.github.io/2020/02/01/emulator-bug-llvm-bug/
The blog post proposes a simple solution (using a std::deque instead of a smallvector to store section entries). They also propose an alternative, namely to avoid taking any section reference at all. This patch enforces the latter using a proxy class. I'm totally fine with the dequeue approach too, and will gladly update the patch if needed.
LLVM code usually uses "std::" prefix before STL containers names and algorithms.
(See std::map below and other variables).