llvm-project/lld/test
Nico Weber aed0a08c69 [lld/mac] Make symbol table order deterministic
SymtabSection::emitStabs() writes the symbol table in the order
of externalSymbols, which has the order of symtab->getSymbols(),
which is just the order symbols are added to the symbol table.

In practice, symbols in the symbol files of input .o files are
sorted, but since that's not guaranteed we sort them in
ObjFile::parseSymbols(). To make sure several symbols with the same
address keep the order they're in the input file, we have to use
stable_sort().

In practice, std::sort() on already-sorted inputs won't change the order
of just adjacent elements, and while in theory std::sort() could use a
random pivot, in practice the code should be deterministic as it was
previously too.

But now lld/test/MachO/stabs.s passes with LLVM_ENABLE_EXPENSIVE_CHECKS=ON
(the last test that was failing with that set).

Fixes a regression from D99972.

While here, remove an empty section in stabs.s and move
.subsections_via_symbols to the end where it usually is (this part no
behavior change).

Differential Revision: https://reviews.llvm.org/D105071
2021-06-29 09:29:49 -04:00
..
COFF [LLD] [COFF] Fix handling of LTO comdats with nontrivial selection types after 728cc0075e 2021-06-25 09:39:56 +03:00
ELF [llvm-objdump] Prefix memory operand addresses with '0x' 2021-06-28 14:25:21 +07:00
MachO [lld/mac] Make symbol table order deterministic 2021-06-29 09:29:49 -04:00
MinGW [LLD] [MinGW] Silence the printouts in one test. NFC. 2021-06-23 10:44:01 +03:00
Unit Support multi-configuration generators correctly in several config files 2021-02-11 09:32:20 -08:00
darwin [lld-macho] Switch default to new Darwin backend 2021-03-01 12:30:10 -05:00
mach-o [lld-macho] Switch default to new Darwin backend 2021-03-01 12:30:10 -05:00
wasm [WebAssembly] Rename event to tag 2021-06-17 20:34:19 -07:00
CMakeLists.txt Fix lld macho standalone build by including llvm/Config/llvm-config.h instead of llvm/Config/config.h 2021-05-19 11:15:07 -04:00
lit.cfg.py [lld-macho] Initial groundwork for -bitcode_bundle 2021-04-16 16:47:14 -04:00
lit.site.cfg.py.in Fix lld macho standalone build by including llvm/Config/llvm-config.h instead of llvm/Config/config.h 2021-05-19 11:15:07 -04:00