diff options
author | Fangrui Song <i@maskray.me> | 2021-02-07 15:47:10 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2021-02-07 15:47:10 -0800 |
commit | 980d28d9556a671081719f82aea3de5db4328688 (patch) | |
tree | e1810db2ee694997e6e6a17d1bb2c7679a7f48a0 /llvm/lib/MC/ELFObjectWriter.cpp | |
parent | ca268ed28520cbe05e5a9f006cb7b615301a4aa1 (diff) | |
download | llvm-980d28d9556a671081719f82aea3de5db4328688.zip llvm-980d28d9556a671081719f82aea3de5db4328688.tar.gz llvm-980d28d9556a671081719f82aea3de5db4328688.tar.bz2 |
ELFObjectWriter: Don't sort local symbols
GNU as does not sort local symbols. This has several advantages:
* The .symtab order is roughly the symbol occurrence order.
* The closest preceding STT_SECTION symbol is the definition of a local symbol.
* The closest preceding STT_FILE symbol is the defining file of a local symbol, if there are multiple default-version .file directives. (Not implemented in MC.)
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
-rw-r--r-- | llvm/lib/MC/ELFObjectWriter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp index 69307b6..74eb7b6 100644 --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/lib/MC/ELFObjectWriter.cpp @@ -730,7 +730,7 @@ void ELFWriter::computeSymbolTable( ELF::SHN_ABS, true); // Symbols are required to be in lexicographic order. - array_pod_sort(LocalSymbolData.begin(), LocalSymbolData.end()); + //array_pod_sort(LocalSymbolData.begin(), LocalSymbolData.end()); array_pod_sort(ExternalSymbolData.begin(), ExternalSymbolData.end()); // Set the symbol indices. Local symbols must come before all other |