Files
clang-p2996/llvm/test/tools/llvm-nm/AArch64/macho-redacted-function.test
Francis Visoiu Mistrih 3d381a7102 [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.
2020-12-04 21:48:53 -08:00

17 lines
382 B
Plaintext

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