[PATCH] D73169: [llvm-readobj] - Add a test for --dyn-symbols when there are no dynamic symbols.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 27 01:38:01 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5c6f8f73ff81: [llvm-readobj] - Add a test for --dyn-symbols when there are no dynamic symbols. (authored by grimar).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73169/new/
https://reviews.llvm.org/D73169
Files:
llvm/test/Object/readobj-absent.test
llvm/test/tools/llvm-readobj/ELF/dyn-symbols.test
Index: llvm/test/tools/llvm-readobj/ELF/dyn-symbols.test
===================================================================
--- llvm/test/tools/llvm-readobj/ELF/dyn-symbols.test
+++ llvm/test/tools/llvm-readobj/ELF/dyn-symbols.test
@@ -290,3 +290,62 @@
- Name: foo
- Name: bar
- Name: zed
+
+## Case 8: Check what we print when:
+## a) The dynamic symbol table does not exist.
+# RUN: yaml2obj %s --docnum=7 -o %t7
+# RUN: llvm-readobj --dyn-symbols %t7 | FileCheck %s --check-prefix=NO-DYNSYM-LLVM
+# RUN: llvm-readelf --dyn-symbols %t7 | count 0
+## b) The dynamic symbol table has a size of 0.
+# RUN: yaml2obj %s --docnum=8 -o %t8
+# RUN: llvm-readobj --dyn-symbols %t8 | FileCheck %s --check-prefix=NO-DYNSYM-LLVM
+# RUN: llvm-readelf --dyn-symbols %t8 | count 0
+## c) The dynamic symbol table only contains the null symbol.
+# RUN: yaml2obj %s --docnum=9 -o %t9
+# RUN: llvm-readobj --dyn-symbols %t9 | FileCheck %s --check-prefix=DYNSYM-EMPTY-LLVM
+# RUN: llvm-readelf --dyn-symbols %t9 | FileCheck %s --check-prefix=DYNSYM-EMPTY-GNU
+
+# NO-DYNSYM-LLVM: DynamicSymbols [
+# NO-DYNSYM-LLVM-NEXT: ]
+
+# DYNSYM-EMPTY-LLVM: DynamicSymbols [
+# DYNSYM-EMPTY-LLVM-NEXT: Symbol {
+# DYNSYM-EMPTY-LLVM-NEXT: Name: (0)
+# DYNSYM-EMPTY-LLVM-NEXT: Value: 0x0
+# DYNSYM-EMPTY-LLVM-NEXT: Size: 0
+# DYNSYM-EMPTY-LLVM-NEXT: Binding: Local (0x0)
+# DYNSYM-EMPTY-LLVM-NEXT: Type: None (0x0)
+# DYNSYM-EMPTY-LLVM-NEXT: Other: 0
+# DYNSYM-EMPTY-LLVM-NEXT: Section: Undefined (0x0)
+# DYNSYM-EMPTY-LLVM-NEXT: }
+# DYNSYM-EMPTY-LLVM-NEXT: ]
+
+# DYNSYM-EMPTY-GNU: Symbol table '.dynsym' contains 1 entries:
+# DYNSYM-EMPTY-GNU-NEXT: Num: Value Size Type Bind Vis Ndx Name
+# DYNSYM-EMPTY-GNU-NEXT: 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_DYN
+ Machine: EM_386
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_DYN
+ Machine: EM_386
+Sections:
+ - Name: .dynsym
+ Type: SHT_DYNSYM
+ Size: 0
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_DYN
+ Machine: EM_386
+DynamicSymbols: []
Index: llvm/test/Object/readobj-absent.test
===================================================================
--- llvm/test/Object/readobj-absent.test
+++ /dev/null
@@ -1,10 +0,0 @@
-## Don't crash if required information is absent
-# RUN: yaml2obj %s -o %t
-# RUN: llvm-readobj --dyn-syms %t
-
---- !ELF
-FileHeader:
- Class: ELFCLASS32
- Data: ELFDATA2LSB
- Type: ET_REL
- Machine: EM_386
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73169.240494.patch
Type: text/x-patch
Size: 2610 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200127/d9429698/attachment.bin>
More information about the llvm-commits
mailing list