Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lld/mac] With -demangle, strip leading _ from non-mangled names
For void f(); int main() { f(); } `lld -demangle` now produces ld64.lld: error: undefined symbol: f >>> referenced by path/to/main.o:(symbol main+0x8) instead of ld64.lld: error: undefined symbol: _f >>> referenced by path/to/main.o:(symbol _main+0x8) previously. (Without `-demangle`, it still prints `_f` and `_main`.) This does *not* match ld64's behavior, but it does match e.g. lld/COFF's behaviour. This is arguably easier to understand: clang prepends symbol names with `_` on macOS, so it seems friendly if the linker removes it again in its diagnostics. It also makes the `extern "C"` insertion diagnostics we added recently look more self-consistent. Differential Revision: https://reviews.llvm.org/D135189
- Loading branch information
Showing
5 changed files
with
20 additions
and
11 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