Skip to content

Commit 5776f66

Browse files
author
George Rimar
committed
[yaml2obj] - Check we correctly set the sh_info field of .symtab section.
initSymtabSectionHeader has the following line: SHeader.sh_info = findLocalsNum(Symbols) + 1; As was mentioned in a review comments for D60122, it is never tested. The patch adds a test. Differential revision: https://reviews.llvm.org/D60192 llvm-svn: 357687
1 parent bc7ff89 commit 5776f66

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Check we correctly set the sh_info field of .symtab section.
2+
# A symbol table section's sh_info section header member holds
3+
# the symbol table index for the first non-local symbol.
4+
5+
# RUN: yaml2obj -docnum=1 %s -o %t
6+
# RUN: llvm-readobj -sections %t | FileCheck %s --check-prefix=ONE
7+
# ONE: Name: .symtab
8+
# ONE: Info: 2
9+
10+
--- !ELF
11+
FileHeader:
12+
Class: ELFCLASS64
13+
Data: ELFDATA2LSB
14+
Type: ET_DYN
15+
Machine: EM_X86_64
16+
Symbols:
17+
- Name: local
18+
- Name: global
19+
Binding: STB_GLOBAL
20+
21+
# RUN: yaml2obj -docnum=2 %s -o %t
22+
# RUN: llvm-readobj -sections %t | FileCheck %s --check-prefix=TWO
23+
# TWO: Name: .symtab
24+
# TWO: Info: 3
25+
26+
--- !ELF
27+
FileHeader:
28+
Class: ELFCLASS64
29+
Data: ELFDATA2LSB
30+
Type: ET_DYN
31+
Machine: EM_X86_64
32+
Symbols:
33+
- Name: local1
34+
- Name: local2
35+
- Name: global
36+
Binding: STB_GLOBAL

0 commit comments

Comments
 (0)