Index: llvm/test/tools/llvm-tli-checker/ps4-tli-check.s =================================================================== --- llvm/test/tools/llvm-tli-checker/ps4-tli-check.s +++ /dev/null @@ -1,291 +0,0 @@ -# REQUIRES: x86-registered-target -# -## The object files ps4-tli-checks.right.so and ps4-tli-checks.wrong.so -## were generated with the following commands: -## llvm-mc --triple=x86_64-scei-ps4 --filetype=obj ps4-tli-check.s -o t.o -## ld.lld --shared t.o -o Inputs/ps4-tli-check.right.so -## llvm-mc --triple=x86_64-scei-ps4 --defsym WRONG=1 --filetype=obj ps4-tli-check.s -o t2.o -## ld.lld --shared t2.o -o Inputs/ps4-tli-check.wrong.so -# -# RUN: llvm-tli-checker --triple=x86_64-scei-ps4 %S/Inputs/ps4-tli-check.right.so | FileCheck %s -# -# RUN: echo %S/Inputs/ps4-tli-check.wrong.so > %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 - Index: llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml =================================================================== --- /dev/null +++ llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml @@ -0,0 +1,1244 @@ +# 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. +# 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 + + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + OSABI: ELFOSABI_FREEBSD + Type: ET_DYN + Machine: EM_X86_64 +Sections: + - Name: .dynsym + Type: SHT_DYNSYM + Flags: [ SHF_ALLOC ] + Address: 0x1C8 + Link: .dynstr + AddressAlign: 0x8 + - Name: .dynstr + Type: SHT_STRTAB + Flags: [ SHF_ALLOC ] + Address: 0x25F4 + AddressAlign: 0x1 + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + Address: 0x3D50 + AddressAlign: 0x4 + Content: '90' +DynamicSymbols: + - Name: [[ZDAPV]] + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _ZdaPvRKSt9nothrow_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _ZdaPvSt11align_val_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _ZdaPvSt11align_val_tRKSt9nothrow_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _ZdaPvm + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _ZdaPvmSt11align_val_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _ZdlPv + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _ZdlPvRKSt9nothrow_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _ZdlPvSt11align_val_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _ZdlPvSt11align_val_tRKSt9nothrow_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _ZdlPvm + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _ZdlPvmSt11align_val_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _Znam + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _ZnamRKSt9nothrow_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _ZnamSt11align_val_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _ZnamSt11align_val_tRKSt9nothrow_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _Znwm + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _ZnwmRKSt9nothrow_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _ZnwmSt11align_val_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: _ZnwmSt11align_val_tRKSt9nothrow_t + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: __cxa_atexit + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: __cxa_guard_abort + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: __cxa_guard_acquire + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: __cxa_guard_release + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: abs + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: acos + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: acosf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: acosh + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: acoshf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: acoshl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: acosl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: aligned_alloc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: asin + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: asinf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: asinh + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: asinhf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: asinhl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: asinl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: atan + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: atan2 + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: atan2f + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: atan2l + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: atanf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: atanh + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: atanhf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: atanhl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: atanl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: atof + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: atoi + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: atol + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: atoll + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: calloc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: cbrt + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: cbrtf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: cbrtl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: ceil + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: ceilf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: ceill + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: clearerr + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: copysign + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: copysignf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: copysignl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: cos + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: cosf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: cosh + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: coshf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: coshl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: cosl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: exp + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: exp2 + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: exp2f + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: exp2l + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: expf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: expl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: expm1 + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: expm1f + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: expm1l + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fabs + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fabsf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fabsl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fclose + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fdopen + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: feof + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: ferror + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fflush + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fgetc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fgetpos + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fgets + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fileno + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: floor + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: floorf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: floorl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fmax + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fmaxf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fmaxl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fmin + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fminf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fminl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fmod + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fmodf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fmodl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fopen + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fprintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fputc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fputs + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fread + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: free + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: frexp + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: frexpf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: frexpl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fscanf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fseek + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fsetpos + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: ftell + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: fwrite + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: getc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: getchar + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: gets + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: isdigit + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: labs + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: ldexp + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: ldexpf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: ldexpl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: llabs + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: log + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: log10 + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: log10f + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: log10l + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: log1p + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: log1pf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: log1pl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: log2 + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: log2f + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: log2l + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: logb + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: logbf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: logbl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: logf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: logl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: malloc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: memalign + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: memchr + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: memcmp + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: memcpy + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: memmove + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: memset + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: mktime + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: modf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: modff + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: modfl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: nearbyint + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: nearbyintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: nearbyintl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: perror + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: posix_memalign + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: pow + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: powf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: powl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: printf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: putc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: putchar + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: puts + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: qsort + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: realloc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: remainder + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: remainderf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: remainderl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: remove + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: rewind + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: rint + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: rintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: rintl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: round + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: roundf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: roundl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: scanf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: setbuf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: setvbuf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: sin + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: sinf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: sinh + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: sinhf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: sinhl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: sinl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: snprintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: sprintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: sqrt + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: sqrtf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: sqrtl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: sscanf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strcasecmp + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strcat + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strchr + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strcmp + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strcoll + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strcpy + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strcspn + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strdup + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strlen + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strncasecmp + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strncat + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strncmp + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strncpy + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strpbrk + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strrchr + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strspn + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strstr + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strtod + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strtof + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strtok + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strtok_r + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strtol + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strtold + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strtoll + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strtoul + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strtoull + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: strxfrm + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: tan + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: tanf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: tanh + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: tanhf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: tanhl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: tanl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: trunc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: truncf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: truncl + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: ungetc + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: vfprintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: vfscanf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: vprintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: vscanf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: vsnprintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: vsprintf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: vsscanf + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 + - Name: wcslen + Type: STT_FUNC + Section: .text + Binding: STB_GLOBAL + Value: 0x3D50 +... Index: llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp =================================================================== --- llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp +++ llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp @@ -39,7 +39,7 @@ #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 @@ public: TLICheckerOptTable() : OptTable(InfoTable) {} }; -} // namespace +} // end anonymous namespace // We have three levels of reporting. enum class ReportKind { @@ -67,7 +67,7 @@ // Most of the ObjectFile interfaces return an Expected, so make it easy // to ignore those. -template T unwrapIgnoreError(Expected E) { +template static T unwrapIgnoreError(Expected E) { if (E) return std::move(*E); // Sink the error and return a nothing value. @@ -99,10 +99,11 @@ } // 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 += "'"; + // Append a friendlier version of Itanium or Windows mangled names. if (Name.startswith("_Z") || Name.startswith("??")) { OutputName += " aka "; OutputName += demangle(Name.str()); @@ -119,7 +120,7 @@ // Print out what we found. void dump(); }; -TLINameList TLINames; +static TLINameList TLINames; void TLINameList::initialize(StringRef TargetTriple) { Triple T(TargetTriple); @@ -146,7 +147,7 @@ // 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,23 +160,22 @@ 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. if (!O->isELF()) { - WithColor::warning() << "Only ELF-format files are supported\n"; + WithColor::warning() << "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) { + for (auto &S : ELF->getDynamicSymbolIterators()) { // We want only global function symbols. - SymbolRef::Type Type = unwrapIgnoreError(I->getType()); - uint32_t Flags = unwrapIgnoreError(I->getFlags()); - StringRef Name = unwrapIgnoreError(I->getName()); + SymbolRef::Type Type = unwrapIgnoreError(S.getType()); + uint32_t Flags = unwrapIgnoreError(S.getFlags()); + StringRef Name = unwrapIgnoreError(S.getName()); if (Type == SymbolRef::ST_Function && (Flags & SymbolRef::SF_Global)) insert({Name, true}); } @@ -211,7 +211,7 @@ SmallString<255> Filepath(LibDir); sys::path::append(Filepath, LibName); if (!sys::fs::exists(Filepath)) { - WithColor::warning() << "Could not find '" << StringRef(Filepath) << "'\n"; + WithColor::warning() << "could not find '" << StringRef(Filepath) << "'\n"; return; } outs() << "\nLooking for symbols in '" << StringRef(Filepath) << "'\n"; @@ -229,7 +229,7 @@ else if (ObjectFile *O = dyn_cast(&Binary)) populateFromObject(O); else { - WithColor::warning() << "Not an Archive or ObjectFile: '" + WithColor::warning() << "not an Archive or ObjectFile: '" << StringRef(Filepath) << "'\n"; return; } @@ -269,7 +269,7 @@ std::vector LibList = Args.getAllArgValues(OPT_INPUT); if (LibList.empty()) { - WithColor::error() << "No input files\n"; + WithColor::error() << "no input files\n"; exit(EXIT_FAILURE); } StringRef LibDir = Args.getLastArgValue(OPT_libdir_EQ); @@ -330,7 +330,8 @@ 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'; } }