Supersize ThinLTO with optimizations causing some symbols to not have path info |
|||
Issue descriptionFrom this change: https://chromium-review.googlesource.com/c/chromium/src/+/1149061 Symbol names have " (.llvm.032939022)" appended. Probably just need to strip when parsing map file.
,
Nov 7
I think he meant to assign it to the other sam
,
Nov 7
As pointed out earlier, to repro this one just have to add thin_lto_enable_optimizations = true to args.gn. In libchrome.so.map we find symbols like .ARM.exidx.text._ZN5media12_GLOBAL__N_114GetBeepContextEv.llvm.5513108144494008565 llvm-cxxfilt then demangles these to: media::(anonymous namespace)::GetBeepContext() (.llvm.5513108144494008565) This appears in about ~3500 symbols. The name actually came from section names in the generated ELF .o files in thinlto-cache. Also, it looks like the suffix comes from https://github.com/llvm-mirror/llvm/blob/master/include/llvm/IR/ModuleSummaryIndex.h ******** /// Convenience method for creating a promoted global name /// for the given value name of a local, and its original module's ID. static std::string getGlobalNameForLocal(StringRef Name, ModuleHash ModHash) { SmallString<256> NewName(Name); NewName += ".llvm."; NewName += utostr((uint64_t(ModHash[0]) << 32) | ModHash[1]); // Take the first 64 bits return NewName.str(); } ======== So the numbers is some sort of hash.
,
Nov 8
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3828fe01699687de32f501d1719f4c39c958cd3c commit 3828fe01699687de32f501d1719f4c39c958cd3c Author: Samuel Huang <huangs@chromium.org> Date: Thu Nov 08 16:15:49 2018 [SuperSize] Ignore LLVM promoted global names suffix (.llvm.1234). Under LLD ThinLTO, if thin_lto_enable_optimizations is enabled then "promoted global names" can appear. For these, mangled symbol names get the suffix '.llvm.1234' or '.1.llvm.1234', where '1' is a small number, and '1234' is a hash. When demangled, the suffix becomes ' (.llvm.1324)' or ' (.1.llvm.1324)' if successful; and is left alone otherwise. These suffix interferes with name comparison, leading to secondary problems like symbols losing path info. This CL makes SuperSize detect and strip these suffixes, to reduce spurious diffs from enabling ThinLTO optimization. The transformation is applied when parsing .map and nm output. Details: * Add demangle.StripLlvmPromotedGlobalNames(), which performs a quick-reject substring test for '.llvm.', followed by RegExp string substitution. * Print the number of promoted global names found in .map file. * Minor updates to comments and tests. Bug: 902723 Change-Id: I4ca4142c891c948894c10180b31ff65b759cccfe Reviewed-on: https://chromium-review.googlesource.com/c/1324192 Commit-Queue: Samuel Huang <huangs@chromium.org> Reviewed-by: Eric Stevenson <estevenson@chromium.org> Reviewed-by: Samuel Huang <huangs@chromium.org> Cr-Commit-Position: refs/heads/master@{#606487} [modify] https://crrev.com/3828fe01699687de32f501d1719f4c39c958cd3c/tools/binary_size/libsupersize/demangle.py [modify] https://crrev.com/3828fe01699687de32f501d1719f4c39c958cd3c/tools/binary_size/libsupersize/linker_map_parser.py [modify] https://crrev.com/3828fe01699687de32f501d1719f4c39c958cd3c/tools/binary_size/libsupersize/testdata/mock_toolchain/mock_nm.py
,
Nov 8
|
|||
►
Sign in to add a comment |
|||
Comment 1 by agrieve@google.com
, Nov 7