[PECOFF] Sort export table properly.
authorRui Ueyama <ruiu@google.com>
Thu, 20 Nov 2014 21:05:05 +0000 (21:05 +0000)
committerRui Ueyama <ruiu@google.com>
Thu, 20 Nov 2014 21:05:05 +0000 (21:05 +0000)
commit2343e65b14d3b38d37536d30aa9e77bc3a1449bc
tree8efbd0344922db6d3de2ccce4809ef297f9b20a9
parent0dcae714493752ed441ee827a7d3abc95c98e499
[PECOFF] Sort export table properly.

Export table entries need to be sorted in ASCII-betical order,
so that the loader can find an entry for a function by binary search.

We sorted the entries by its mangled names. That can be different
from their exported names. As a result, LLD produces incorrect export
table, from which the loader complains that a function that actually
exists in a DLL cannot be found.

This patch fixes that issue.

llvm-svn: 222452
lld/lib/ReaderWriter/PECOFF/EdataPass.cpp
lld/test/pecoff/export.test