-
-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not try to demangle C++ symbols as Rust ones
Previously, we always tried to demangle a symbol name as a Rust symbol first and then attempted to demangle it as a C++ symbol. This resulted in an incorrect demangled result, as the Rust legacy mangling scheme is not distinguishable from C++. This patch fix the issue by adding the "is_rust_obj" flag to the ObjectFile. We try to demangle a symbol as a Rust one before as a C++ only if the flag is true. Fixes #1159
- Loading branch information
Showing
7 changed files
with
80 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
. $(dirname $0)/common.inc | ||
|
||
cat <<'EOF' | $CC -c -o $t/a.o -xc - | ||
void _ZN2ns7versionEv(); | ||
int main() { _ZN2ns7versionEv(); } | ||
EOF | ||
|
||
! $CC -B. -o $t/exe1 $t/a.o 2> $t/log || false | ||
grep -Fq 'ns::version()' $t/log | ||
|
||
cat <<'EOF' | $CC -c -o $t/b.o -xc - | ||
void _ZN2ns7versionEv(); | ||
int main() { _ZN2ns7versionEv(); } | ||
__attribute__((section(".comment"))) char str[] = "rustc version x.y.z\n"; | ||
EOF | ||
|
||
! $CC -B. -o $t/exe2 $t/b.o 2> $t/log || false | ||
grep -Fq 'ns::versionv' $t/log |