[PATCH] D35473: [ELF] compareByFilePosition requires stable_sort

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 17 00:09:30 PDT 2017


smeenai added a subscriber: peter.smith.
smeenai added a comment.

I discovered this because the `.ARM.exidx` end sentinel was getting incorrectly reordered away from the end of the section, leading to unwinding failing in certain binaries. CC @peter.smith, in case you've run into any similar issues.

Unfortunately, I'm not sure how to write a test case for this. I was using `-ffunction-sections` so I would end up with multiple `.ARM.exidx.*` sections, so there's a reasonable chance of the sentinel getting incorrectly reordered, but there's no guarantee, since it depends on the underlying `std::sort` implementation (which could potentially even be randomized). Any ideas?


https://reviews.llvm.org/D35473





More information about the llvm-commits mailing list