[PATCH] D136536: [lld-macho] Don't sort map file entries by name
Jez Ng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 24 09:04:38 PDT 2022
int3 updated this revision to Diff 470177.
int3 added a comment.
update test
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D136536/new/
https://reviews.llvm.org/D136536
Files:
lld/MachO/MapFile.cpp
lld/test/MachO/dead-strip.s
Index: lld/test/MachO/dead-strip.s
===================================================================
--- lld/test/MachO/dead-strip.s
+++ lld/test/MachO/dead-strip.s
@@ -46,14 +46,14 @@
## Check that dead stripped symbols get listed properly.
# RUN: FileCheck --check-prefix=MAP %s < %t/map
-# MAP: _main
+# MAP: _main
# MAP-LABEL: Dead Stripped Symbols
-# MAP: <<dead>> 0x00000001 [ 1] _unref_com
-# MAP: <<dead>> 0x00000008 [ 1] _unref_data
-# MAP: <<dead>> 0x00000006 [ 1] _unref_extern
-# MAP: <<dead>> 0x00000001 [ 1] _unref_local
-# MAP: <<dead>> 0x00000007 [ 1] _unref_private_extern
-# MAP: <<dead>> 0x00000008 [ 1] l_unref_data
+# MAP-DAG: <<dead>> 0x00000001 [ 1] _unref_com
+# MAP-DAG: <<dead>> 0x00000008 [ 1] _unref_data
+# MAP-DAG: <<dead>> 0x00000006 [ 1] _unref_extern
+# MAP-DAG: <<dead>> 0x00000001 [ 1] _unref_local
+# MAP-DAG: <<dead>> 0x00000007 [ 1] _unref_private_extern
+# MAP-DAG: <<dead>> 0x00000008 [ 1] l_unref_data
## Run dead stripping on code without any dead symbols.
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos \
Index: lld/MachO/MapFile.cpp
===================================================================
--- lld/MachO/MapFile.cpp
+++ lld/MachO/MapFile.cpp
@@ -72,13 +72,7 @@
info.files.push_back(file);
}
parallelSort(info.liveSymbols.begin(), info.liveSymbols.end(),
- [](Defined *a, Defined *b) {
- return a->getVA() != b->getVA() ? a->getVA() < b->getVA()
- : a->getName() < b->getName();
- });
- parallelSort(
- info.deadSymbols.begin(), info.deadSymbols.end(),
- [](Defined *a, Defined *b) { return a->getName() < b->getName(); });
+ [](Defined *a, Defined *b) { return a->getVA() < b->getVA(); });
return info;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136536.470177.patch
Type: text/x-patch
Size: 1839 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221024/bfc5cd41/attachment.bin>
More information about the llvm-commits
mailing list