From 66071f440c31b95cb2514a8daa003b62882b8245 Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Tue, 23 Nov 2021 10:24:29 -0800 Subject: [PATCH] [TLI checker] Update for post-commit review comments Ignore undefined symbols; other minor code cleanup. Replace test objects and their asm source with a yaml equivalent. Differential Revision: https://reviews.llvm.org/D114478 --- .../llvm-tli-checker/Inputs/ps4-tli-check.right.so | Bin 20344 -> 0 bytes .../llvm-tli-checker/Inputs/ps4-tli-check.wrong.so | Bin 20376 -> 0 bytes llvm/test/tools/llvm-tli-checker/ps4-tli-check.s | 291 ------ .../test/tools/llvm-tli-checker/ps4-tli-check.yaml | 1004 ++++++++++++++++++++ llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp | 71 +- 5 files changed, 1040 insertions(+), 326 deletions(-) delete mode 100644 llvm/test/tools/llvm-tli-checker/Inputs/ps4-tli-check.right.so delete mode 100644 llvm/test/tools/llvm-tli-checker/Inputs/ps4-tli-check.wrong.so delete mode 100644 llvm/test/tools/llvm-tli-checker/ps4-tli-check.s create mode 100644 llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml diff --git a/llvm/test/tools/llvm-tli-checker/Inputs/ps4-tli-check.right.so b/llvm/test/tools/llvm-tli-checker/Inputs/ps4-tli-check.right.so deleted file mode 100644 index bbc5362fe7d533173e2aea5df7984d9f733dc230..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20344 zcmeHP33OD&w!LX0G%|F9h{*H;qM~3VaX?hCd5SVBlOQ<6PSOpLPIu^Z643V1@*MI| z1Ox&iK~Q{v3IUuDPJEP!1jv1zkvbkBC8Ir)U)bZwE?F?0=%qs zImuk@rJcYs&Q$uH<6LpI<#+lr?gU7GUhm)4!Cn28)3sb(bDa1Z$aD+>S0Am5IL_7X zI1lhYGR|G!z|Ru-_P+cl^R40jP+0>oPUiccDnmik7&|tY`{eS<{s?}9!uMdof=^ZW z1GK+R;Tvl?_A3;AHWn{DuPXdZ+&sbeDtrxbPdC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`Mc@-&XgAr@;LWVpGTYGS55Jgrno*+e3TsU$n&GmJx%durg+^4$aA-P z4*zHzlqpWe6t};e^WLlGHO05AqrHwFFy$SX&ZAA|ydRQ(it@)4hi}T4F~yBklV8XC z9VA|%=KZ5_q^7t*)A_Y24&M~dY>F>6#d(_I_e}8*rno*+T$3p-&J-VRibF8PkD2l; zOmPdQJQ`E{wkZzQly`6s{%9nh_r>ZtF~yCT;`dDX0;afVQ~Zf355g3eZi>e+#f_Wd zolJRWrZ^~5-j*p}Y$x}5wc6*;iR-v8Q+&HA{>l`8Yl??A#TlCNzf5s)rnvgH_~9+j zm5x_5Qo z(SDn=a0q*n&O{Lc>$)lQ&SwfDX#JZ`u~aYe;4sj z6>f?T|C;tXPS_N$<-tE}<@54|;y1AFy;N3@;6QK zmZo^%T<+TewQr`purajPaqOmi8B@HmDbI8Y`E|abDSp_LM=+l}I-cAV$GD94IxlPm zah<2UhPcj;UQ1l(7n|~SP5GOqyg5@It0`X56lc4Se(LyMQ+%T-KROM6aFWlR&O0{6 zVVd%QOnFbHJk$1^SLX|x@~J!1Ugv$7@=Z+n5&g)c^V3cFZb91XylGQhs3|Yf6eoWN z`E|ZzIdPpgVahi&<#DX-J?|0ZWfQhlu&^M{%FK%u7KU(glZiozU@r7XIkK=@j^+V4 zl|JmXkKWZ0GffqG%#p{B*Hv6X^!V}m@#FR5$Lq(B*N-2s<303$`glF(ieXoG@7L>c z96|oKi=6+;SvCIbZWs6b+SM5nh>3zf3n1m@x7cd;TwCHszdw99=8kvIuU##_SEa~U zDRQn{vz&wu{z-IXe)qiF)gyU6?v58fq_|pQ3h}4NBjerkbyvIR>oP`)%j5K%I8?#t z=8ik>kiEIz28GQf% diff --git a/llvm/test/tools/llvm-tli-checker/Inputs/ps4-tli-check.wrong.so b/llvm/test/tools/llvm-tli-checker/Inputs/ps4-tli-check.wrong.so deleted file mode 100644 index bbf4e3fe509ddd80ce1490ff3b43f806dfae0e52..0000000000000000000000000000000000000000 GIT binary patch liter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fg#Lu^WoP|t1)OY^X%sTujM%ST)gJ| z %t2.txt -# RUN: llvm-tli-checker --triple x86_64-scei-ps4 @%t2.txt | \ -# RUN: FileCheck %s --check-prefix=WRONG_SUMMARY --check-prefix=WRONG_DETAIL \ -# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>" -# RUN: llvm-tli-checker --triple x86_64-scei-ps4 @%t2.txt --report=summary | \ -# RUN: FileCheck %s --check-prefix=WRONG_SUMMARY \ -# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>" -## --separate implies --report=summary. -# RUN: llvm-tli-checker --triple x86_64-scei-ps4 @%t2.txt --separate | \ -# RUN: FileCheck %s --check-prefix=WRONG_SUMMARY \ -# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>" -# -# RUN: llvm-tli-checker --triple x86_64-scei-ps4 --dump-tli > %t3.txt -# RUN: FileCheck %s --check-prefix=AVAIL --input-file %t3.txt -# RUN: FileCheck %s --check-prefix=UNAVAIL --input-file %t3.txt -# -# CHECK: << Total TLI yes SDK no: 0 -# CHECK: >> Total TLI no SDK yes: 0 -# CHECK: == Total TLI yes SDK yes: 235 -# -# WRONG_DETAIL: << TLI yes SDK no : '_ZdaPv' -# WRONG_DETAIL: >> TLI no SDK yes: '_ZdaPvj' -# WRONG_SUMMARY: << Total TLI yes SDK no: 1{{$}} -# WRONG_SUMMARY: >> Total TLI no SDK yes: 1{{$}} -# WRONG_SUMMARY: == Total TLI yes SDK yes: 234 -# -## The -COUNT suffix doesn't care if there are too many matches, so check -## the exact count first; the two directives should add up to that. -# AVAIL: TLI knows 466 symbols, 235 available -# AVAIL-COUNT-235: {{^}} available -# UNAVAIL-COUNT-231: not available - -.macro defname name -.globl \name -.type \name ,@function -\name : nop -.endm - -.text -# For the WRONG case, omit _ZdaPv and include _ZdaPvj. -.ifdef WRONG -defname _ZdaPvj -.else -defname _ZdaPv -.endif -defname _ZdaPvRKSt9nothrow_t -defname _ZdaPvSt11align_val_t -defname _ZdaPvSt11align_val_tRKSt9nothrow_t -defname _ZdaPvm -defname _ZdaPvmSt11align_val_t -defname _ZdlPv -defname _ZdlPvRKSt9nothrow_t -defname _ZdlPvSt11align_val_t -defname _ZdlPvSt11align_val_tRKSt9nothrow_t -defname _ZdlPvm -defname _ZdlPvmSt11align_val_t -defname _Znam -defname _ZnamRKSt9nothrow_t -defname _ZnamSt11align_val_t -defname _ZnamSt11align_val_tRKSt9nothrow_t -defname _Znwm -defname _ZnwmRKSt9nothrow_t -defname _ZnwmSt11align_val_t -defname _ZnwmSt11align_val_tRKSt9nothrow_t -defname __cxa_atexit -defname __cxa_guard_abort -defname __cxa_guard_acquire -defname __cxa_guard_release -defname abs -defname acos -defname acosf -defname acosh -defname acoshf -defname acoshl -defname acosl -defname aligned_alloc -defname asin -defname asinf -defname asinh -defname asinhf -defname asinhl -defname asinl -defname atan -defname atan2 -defname atan2f -defname atan2l -defname atanf -defname atanh -defname atanhf -defname atanhl -defname atanl -defname atof -defname atoi -defname atol -defname atoll -defname calloc -defname cbrt -defname cbrtf -defname cbrtl -defname ceil -defname ceilf -defname ceill -defname clearerr -defname copysign -defname copysignf -defname copysignl -defname cos -defname cosf -defname cosh -defname coshf -defname coshl -defname cosl -defname exp -defname exp2 -defname exp2f -defname exp2l -defname expf -defname expl -defname expm1 -defname expm1f -defname expm1l -defname fabs -defname fabsf -defname fabsl -defname fclose -defname fdopen -defname feof -defname ferror -defname fflush -defname fgetc -defname fgetpos -defname fgets -defname fileno -defname floor -defname floorf -defname floorl -defname fmax -defname fmaxf -defname fmaxl -defname fmin -defname fminf -defname fminl -defname fmod -defname fmodf -defname fmodl -defname fopen -defname fprintf -defname fputc -defname fputs -defname fread -defname free -defname frexp -defname frexpf -defname frexpl -defname fscanf -defname fseek -defname fsetpos -defname ftell -defname fwrite -defname getc -defname getchar -defname gets -defname isdigit -defname labs -defname ldexp -defname ldexpf -defname ldexpl -defname llabs -defname log -defname log10 -defname log10f -defname log10l -defname log1p -defname log1pf -defname log1pl -defname log2 -defname log2f -defname log2l -defname logb -defname logbf -defname logbl -defname logf -defname logl -defname malloc -defname memalign -defname memchr -defname memcmp -defname memcpy -defname memmove -defname memset -defname mktime -defname modf -defname modff -defname modfl -defname nearbyint -defname nearbyintf -defname nearbyintl -defname perror -defname posix_memalign -defname pow -defname powf -defname powl -defname printf -defname putc -defname putchar -defname puts -defname qsort -defname realloc -defname remainder -defname remainderf -defname remainderl -defname remove -defname rewind -defname rint -defname rintf -defname rintl -defname round -defname roundf -defname roundl -defname scanf -defname setbuf -defname setvbuf -defname sin -defname sinf -defname sinh -defname sinhf -defname sinhl -defname sinl -defname snprintf -defname sprintf -defname sqrt -defname sqrtf -defname sqrtl -defname sscanf -defname strcasecmp -defname strcat -defname strchr -defname strcmp -defname strcoll -defname strcpy -defname strcspn -defname strdup -defname strlen -defname strncasecmp -defname strncat -defname strncmp -defname strncpy -defname strpbrk -defname strrchr -defname strspn -defname strstr -defname strtod -defname strtof -defname strtok -defname strtok_r -defname strtol -defname strtold -defname strtoll -defname strtoul -defname strtoull -defname strxfrm -defname tan -defname tanf -defname tanh -defname tanhf -defname tanhl -defname tanl -defname trunc -defname truncf -defname truncl -defname ungetc -defname vfprintf -defname vfscanf -defname vprintf -defname vscanf -defname vsnprintf -defname vsprintf -defname vsscanf -defname wcslen - diff --git a/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml b/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml new file mode 100644 index 0000000..c665049 --- /dev/null +++ b/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml @@ -0,0 +1,1004 @@ +# REQUIRES: x86-registered-target +# +## This produces the object that matches expectations for PS4. +# RUN: yaml2obj %s -DZDAPV=_ZdaPv -o=%t1 +# RUN: llvm-tli-checker --triple=x86_64-scei-ps4 %t1 | FileCheck %s +# +## This produces an object that has _ZdaPvj instead of _ZdaPv. +# RUN: yaml2obj %s -DZDAPV=_ZdaPvj -o=%t2 +# RUN: echo %t2 > %t2.txt +# RUN: llvm-tli-checker --triple x86_64-scei-ps4 @%t2.txt | \ +# RUN: FileCheck %s --check-prefixes=WRONG_SUMMARY,WRONG_DETAIL \ +# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>" +# +# RUN: llvm-tli-checker --triple x86_64-scei-ps4 @%t2.txt --report=summary | \ +# RUN: FileCheck %s --check-prefix=WRONG_SUMMARY \ +# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>" +## --separate implies --report=summary. +## Also use a response file to show we support that. +# RUN: llvm-tli-checker --triple x86_64-scei-ps4 @%t2.txt --separate | \ +# RUN: FileCheck %s --check-prefix=WRONG_SUMMARY \ +# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>" +# +## Verify --dump-tli reports the full set. +# RUN: llvm-tli-checker --triple x86_64-scei-ps4 --dump-tli > %t3.txt +# RUN: FileCheck %s --check-prefix=AVAIL --input-file %t3.txt +# RUN: FileCheck %s --check-prefix=UNAVAIL --input-file %t3.txt +# +# CHECK: << Total TLI yes SDK no: 0 +# CHECK: >> Total TLI no SDK yes: 0 +# CHECK: == Total TLI yes SDK yes: 235 +# +# WRONG_DETAIL: << TLI yes SDK no : '_ZdaPv' aka operator delete[](void*) +# WRONG_DETAIL: >> TLI no SDK yes: '_ZdaPvj' aka operator delete[](void*, unsigned int) +# WRONG_SUMMARY: << Total TLI yes SDK no: 1{{$}} +# WRONG_SUMMARY: >> Total TLI no SDK yes: 1{{$}} +# WRONG_SUMMARY: == Total TLI yes SDK yes: 234 +# +## The -COUNT suffix doesn't care if there are too many matches, so check +## the exact count first; the two directives should add up to that. +# AVAIL: TLI knows 466 symbols, 235 available +# AVAIL-COUNT-235: {{^}} available +# UNAVAIL-COUNT-231: not available + + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_FREEBSD + Type: ET_DYN + Machine: EM_X86_64 +Sections: + - Name: .text + Type: SHT_PROGBITS +DynamicSymbols: +# This is an undefined symbol that is known to TLI but not in the +# available set for PS4, showing the tool will ignore undefined symbols. +# Omitting the Section attribute makes it undefined. + - Name: memcpy_chk + Type: STT_FUNC + Binding: STB_GLOBAL +# This will be either _ZdaPv or _ZdaPvj (see yaml2obj invocations above). + - Name: [[ZDAPV]] + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL +# The rest of these are the remaining symbols needed for PS4. + - Name: _ZdaPvRKSt9nothrow_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _ZdaPvSt11align_val_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _ZdaPvSt11align_val_tRKSt9nothrow_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _ZdaPvm + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _ZdaPvmSt11align_val_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _ZdlPv + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _ZdlPvRKSt9nothrow_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _ZdlPvSt11align_val_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _ZdlPvSt11align_val_tRKSt9nothrow_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _ZdlPvm + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _ZdlPvmSt11align_val_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _Znam + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _ZnamRKSt9nothrow_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _ZnamSt11align_val_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _ZnamSt11align_val_tRKSt9nothrow_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _Znwm + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _ZnwmRKSt9nothrow_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _ZnwmSt11align_val_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: _ZnwmSt11align_val_tRKSt9nothrow_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: __cxa_atexit + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: __cxa_guard_abort + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: __cxa_guard_acquire + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: __cxa_guard_release + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: abs + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: acos + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: acosf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: acosh + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: acoshf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: acoshl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: acosl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: aligned_alloc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: asin + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: asinf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: asinh + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: asinhf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: asinhl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: asinl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: atan + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: atan2 + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: atan2f + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: atan2l + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: atanf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: atanh + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: atanhf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: atanhl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: atanl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: atof + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: atoi + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: atol + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: atoll + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: calloc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: cbrt + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: cbrtf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: cbrtl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: ceil + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: ceilf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: ceill + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: clearerr + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: copysign + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: copysignf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: copysignl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: cos + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: cosf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: cosh + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: coshf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: coshl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: cosl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: exp + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: exp2 + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: exp2f + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: exp2l + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: expf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: expl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: expm1 + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: expm1f + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: expm1l + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fabs + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fabsf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fabsl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fclose + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fdopen + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: feof + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: ferror + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fflush + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fgetc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fgetpos + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fgets + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fileno + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: floor + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: floorf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: floorl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fmax + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fmaxf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fmaxl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fmin + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fminf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fminl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fmod + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fmodf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fmodl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fopen + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fprintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fputc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fputs + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fread + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: free + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: frexp + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: frexpf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: frexpl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fscanf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fseek + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fsetpos + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: ftell + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: fwrite + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: getc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: getchar + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: gets + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: isdigit + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: labs + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: ldexp + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: ldexpf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: ldexpl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: llabs + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: log + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: log10 + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: log10f + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: log10l + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: log1p + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: log1pf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: log1pl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: log2 + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: log2f + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: log2l + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: logb + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: logbf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: logbl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: logf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: logl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: malloc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: memalign + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: memchr + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: memcmp + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: memcpy + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: memmove + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: memset + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: mktime + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: modf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: modff + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: modfl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: nearbyint + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: nearbyintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: nearbyintl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: perror + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: posix_memalign + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: pow + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: powf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: powl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: printf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: putc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: putchar + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: puts + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: qsort + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: realloc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: remainder + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: remainderf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: remainderl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: remove + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: rewind + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: rint + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: rintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: rintl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: round + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: roundf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: roundl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: scanf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: setbuf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: setvbuf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: sin + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: sinf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: sinh + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: sinhf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: sinhl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: sinl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: snprintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: sprintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: sqrt + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: sqrtf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: sqrtl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: sscanf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strcasecmp + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strcat + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strchr + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strcmp + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strcoll + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strcpy + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strcspn + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strdup + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strlen + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strncasecmp + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strncat + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strncmp + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strncpy + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strpbrk + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strrchr + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strspn + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strstr + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strtod + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strtof + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strtok + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strtok_r + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strtol + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strtold + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strtoll + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strtoul + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strtoull + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: strxfrm + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: tan + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: tanf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: tanh + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: tanhf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: tanhl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: tanl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: trunc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: truncf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: truncl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: ungetc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: vfprintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: vfscanf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: vprintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: vscanf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: vsnprintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: vsprintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: vsscanf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + - Name: wcslen + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL +... diff --git a/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp b/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp index bf25efc..4a69f96 100644 --- a/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp +++ b/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp @@ -39,7 +39,7 @@ enum ID { #include "Opts.inc" #undef PREFIX -const opt::OptTable::Info InfoTable[] = { +static const opt::OptTable::Info InfoTable[] = { #define OPTION(PREFIX, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM, \ HELPTEXT, METAVAR, VALUES) \ { \ @@ -55,7 +55,7 @@ class TLICheckerOptTable : public opt::OptTable { public: TLICheckerOptTable() : OptTable(InfoTable) {} }; -} // namespace +} // end anonymous namespace // We have three levels of reporting. enum class ReportKind { @@ -66,13 +66,14 @@ enum class ReportKind { }; // Most of the ObjectFile interfaces return an Expected, so make it easy -// to ignore those. -template T unwrapIgnoreError(Expected E) { +// to ignore errors. +template +static T unwrapIgnoreError(Expected E, T Default = T()) { if (E) return std::move(*E); // Sink the error and return a nothing value. consumeError(E.takeError()); - return T(); + return Default; } static void fail(const Twine &Message) { @@ -99,13 +100,14 @@ static void reportArchiveChildIssue(const object::Archive::Child &C, int Index, } // Return Name, and if Name is mangled, append "aka" and the demangled name. -static std::string PrintableName(StringRef Name) { +static std::string getPrintableName(StringRef Name) { std::string OutputName = "'"; OutputName += Name; OutputName += "'"; - if (Name.startswith("_Z") || Name.startswith("??")) { + std::string DemangledName(demangle(Name.str())); + if (Name != DemangledName) { OutputName += " aka "; - OutputName += demangle(Name.str()); + OutputName += DemangledName; } return OutputName; } @@ -119,7 +121,7 @@ struct TLINameList : std::vector> { // Print out what we found. void dump(); }; -TLINameList TLINames; +static TLINameList TLINames; void TLINameList::initialize(StringRef TargetTriple) { Triple T(TargetTriple); @@ -146,7 +148,7 @@ void TLINameList::dump() { // output as a header. So, for example, no need to repeat the triple. for (auto &TLIName : TLINames) { outs() << (TLIName.second ? " " : "not ") - << "available: " << PrintableName(TLIName.first) << '\n'; + << "available: " << getPrintableName(TLIName.first) << '\n'; } } @@ -159,24 +161,27 @@ class SDKNameMap : public StringMap { public: void populateFromFile(StringRef LibDir, StringRef LibName); }; -SDKNameMap SDKNames; +static SDKNameMap SDKNames; // Given an ObjectFile, extract the global function symbols. void SDKNameMap::populateFromObject(ObjectFile *O) { - // FIXME: Support COFF. + // FIXME: Support other formats. if (!O->isELF()) { - WithColor::warning() << "Only ELF-format files are supported\n"; + WithColor::warning() << O->getFileName() + << ": only ELF-format files are supported\n"; return; } - auto *ELF = cast(O); + const auto *ELF = cast(O); - for (auto I = ELF->getDynamicSymbolIterators().begin(); - I != ELF->getDynamicSymbolIterators().end(); ++I) { - // We want only global function symbols. - SymbolRef::Type Type = unwrapIgnoreError(I->getType()); - uint32_t Flags = unwrapIgnoreError(I->getFlags()); - StringRef Name = unwrapIgnoreError(I->getName()); - if (Type == SymbolRef::ST_Function && (Flags & SymbolRef::SF_Global)) + for (auto &S : ELF->getDynamicSymbolIterators()) { + // We want only defined global function symbols. + SymbolRef::Type Type = unwrapIgnoreError(S.getType()); + uint32_t Flags = unwrapIgnoreError(S.getFlags()); + section_iterator Section = unwrapIgnoreError(S.getSection(), + /*Default=*/O->section_end()); + StringRef Name = unwrapIgnoreError(S.getName()); + if (Type == SymbolRef::ST_Function && (Flags & SymbolRef::SF_Global) && + Section != O->section_end()) insert({Name, true}); } } @@ -211,7 +216,7 @@ void SDKNameMap::populateFromFile(StringRef LibDir, StringRef LibName) { SmallString<255> Filepath(LibDir); sys::path::append(Filepath, LibName); if (!sys::fs::exists(Filepath)) { - WithColor::warning() << "Could not find '" << StringRef(Filepath) << "'\n"; + WithColor::warning() << StringRef(Filepath) << ": not found\n"; return; } outs() << "\nLooking for symbols in '" << StringRef(Filepath) << "'\n"; @@ -229,13 +234,12 @@ void SDKNameMap::populateFromFile(StringRef LibDir, StringRef LibName) { else if (ObjectFile *O = dyn_cast(&Binary)) populateFromObject(O); else { - WithColor::warning() << "Not an Archive or ObjectFile: '" - << StringRef(Filepath) << "'\n"; + WithColor::warning() << StringRef(Filepath) + << ": not an archive or object file\n"; return; } if (Precount == size()) - WithColor::warning() << "No symbols found in '" << StringRef(Filepath) - << "'\n"; + WithColor::warning() << StringRef(Filepath) << ": no symbols found\n"; else outs() << "Found " << size() - Precount << " global function symbols in '" << StringRef(Filepath) << "'\n"; @@ -268,10 +272,8 @@ int main(int argc, char *argv[]) { } std::vector LibList = Args.getAllArgValues(OPT_INPUT); - if (LibList.empty()) { - WithColor::error() << "No input files\n"; - exit(EXIT_FAILURE); - } + if (LibList.empty()) + fail("no input files\n"); StringRef LibDir = Args.getLastArgValue(OPT_libdir_EQ); bool SeparateMode = Args.hasArg(OPT_separate); @@ -283,10 +285,8 @@ int main(int argc, char *argv[]) { .Case("discrepancy", ReportKind::Discrepancy) .Case("full", ReportKind::Full) .Default(ReportKind::Error); - if (ReportLevel == ReportKind::Error) { - WithColor::error() << "invalid option for --report: " << A->getValue(); - exit(EXIT_FAILURE); - } + if (ReportLevel == ReportKind::Error) + fail(Twine("invalid option for --report: ", StringRef(A->getValue()))); } for (size_t I = 0; I < LibList.size(); ++I) { @@ -330,7 +330,8 @@ int main(int argc, char *argv[]) { constexpr char YesNo[2][4] = {"no ", "yes"}; constexpr char Indicator[4][3] = {"!!", ">>", "<<", "=="}; outs() << Indicator[Which] << " TLI " << YesNo[TLIHas] << " SDK " - << YesNo[SDKHas] << ": " << PrintableName(TLIName.first) << '\n'; + << YesNo[SDKHas] << ": " << getPrintableName(TLIName.first) + << '\n'; } } -- 2.7.4