[PATCH] D80311: [lld][test] Expand testing for dynamic-list and export-dynamic

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 13:33:04 PDT 2020


MaskRay added inline comments.


================
Comment at: lld/test/ELF/dynamic-list-patterns.s:1
+# REQUIRES: x86
+
----------------
`dynamic-list-glob.s` may be better.

The recognized patterns are globs, not regex.


================
Comment at: lld/test/ELF/dynamic-list-patterns.s:3
+
+## Confirm --dynamic-list identifies symbols by patterns, including wildcards.
+## Patterns need not match a symbol. Both mangled and unmangled names may
----------------
Thanks for deleting dynamic-list-wildcard.s

Whether an entry is a glob depends on whether double quotes are used. It is not unconditional glob, so the sentence is not accurate.

> Confirm --dynamic-list identifies symbols by patterns, including wildcards.




================
Comment at: lld/test/ELF/dynamic-list-patterns.s:10
+# RUN: echo '{ [fb]o?1*; _Z1fv; extern "C++" { "g()"; }; };' > %t.list
+# RUN: ld.lld -pie --dynamic-list %t.list %t.o -o %t.elf
+# RUN: llvm-readelf --dyn-syms %t.elf | FileCheck %s
----------------
`s/%t.elf/%t/`


================
Comment at: lld/test/ELF/export-dynamic-symbol.s:3
 
 # RUN: rm -f %t.a
+# RUN: llvm-mc -filetype=obj -triple=x86_64 %S/Inputs/archive2.s -o %t1.o
----------------
I committed D80487 which came with a bunch of tests. These cases should have been covered.


================
Comment at: lld/test/ELF/export-symbol-types.s:9
+##
+## Exported:
+## - undefined symbols
----------------
undefined symbols and shared symbols are exported.

--export-dynamic, --dynamic-list and --export-dynamic-symbol can export additional symbols: non-local STV_DEFAULT symbols

The list is not accurate because there is overlap between hidden symbols and weak symbols, for example.

weak symbols are not unconditionally exported.

Many symbols generated by the linker are not exported (hidden).


================
Comment at: lld/test/ELF/export-symbol-types.s:24
+# RUN: llvm-mc -filetype=obj -triple=x86_64 %t.s -o %t-shared.o
+# RUN: ld.lld --shared %t-shared.o -o %t-shared.so
+
----------------
Drop `-shared`. `.so` obviously identifies a shared object.




================
Comment at: lld/test/ELF/export-symbol-types.s:26
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t-elf.o
+## Use --fatal-warnings to confirm no diagnostics are emitted.
----------------
Drop `-elf`. It carries no additional information. All object files discussed here are ELF.


================
Comment at: lld/test/ELF/export-symbol-types.s:26
+
+# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t-elf.o
+## Use --fatal-warnings to confirm no diagnostics are emitted.
----------------
MaskRay wrote:
> Drop `-elf`. It carries no additional information. All object files discussed here are ELF.
Delete `llvm-mc -filetype=obj -triple=x86_64 %s -o %t-elf.o`

the object file is the same


================
Comment at: lld/test/ELF/invalid-dynamic-list.test:5
 
-# RUN: echo "{ foobar;" > %t1
-# RUN: not ld.lld --dynamic-list %t1 2>&1 | FileCheck -check-prefix=ERR2 %s
+# RUN: echo "{ foobar;" > %t2
+# RUN: not ld.lld --dynamic-list %t2 2>&1 | FileCheck -check-prefix=ERR2 %s
----------------
You can update the quotes by the way.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80311/new/

https://reviews.llvm.org/D80311





More information about the llvm-commits mailing list