forked from GPUOpen-Drivers/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-nm][MachO] Don't call getFlags on redacted symbols
Avoid calling getFlags on a non-existent symbol. The way this is triggered is by calling strip -N on a binary, which sets the MH_NLIST_OUTOFSYNC_WITH_DYLDINFO header flag. Then, in the LC_FUNCTION_STARTS command, nm is trying to print the stripped symbols and needs the proper checks.
- Loading branch information
Showing
3 changed files
with
24 additions
and
6 deletions.
There are no files selected for viewing
Binary file added
BIN
+32.1 KB
llvm/test/tools/llvm-nm/AArch64/Inputs/redacted-function.macho-aarch64
Binary file not shown.
16 changes: 16 additions & 0 deletions
16
llvm/test/tools/llvm-nm/AArch64/macho-redacted-function.test
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,16 @@ | ||
RUN: llvm-nm %p/Inputs/redacted-function.macho-aarch64 | FileCheck %s | ||
|
||
CHECK: <redacted function 1> | ||
|
||
# Generated with: | ||
# $ cat /tmp/a.c | ||
# static int i(void) { | ||
# return 0; | ||
# } | ||
# | ||
# int main(void) { | ||
# return i(); | ||
# } | ||
# | ||
# $ xcrun -sdk watchos clang -arch arm64_32 /tmp/a.c -o /tmp/redacted-function.macho-aarch64 | ||
# $ xcrun -sdk watchos strip -N /tmp/redacted-function.macho-aarch64 |
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