Skip to content

Commit 39c6fce

Browse files
committed
[LLDB][ELF] Use yaml2obj for the test.
Rather than including a binary, use `yaml2obj` for the duplicate section name test. rdar://124467787
1 parent 9cbd304 commit 39c6fce

File tree

3 files changed

+48
-8
lines changed

3 files changed

+48
-8
lines changed
Binary file not shown.

lldb/test/Shell/ObjectFile/ELF/two-text-sections.test

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Test handling of object files that have duplicate sections. This is legal,
2+
# according to the System V ABI (Edition 4.1); see 4-20 where it says:
3+
#
4+
# Section names with a dot (.) prefix are reserved for the system,
5+
# although applications may use these sections if their existing
6+
# meanings are satisfactory. ... **An object file may have more than
7+
# one section with the same name.**
8+
#
9+
# (See https://github.com/llvm/llvm-project/issues/88001)
10+
11+
# RUN: yaml2obj %s -o %t
12+
# RUN: lldb-test symbols %t | FileCheck %s
13+
14+
# CHECK: 0x0000000000400010 {{.*}} my_function
15+
# CHECK: 0x0000000000401020 {{.*}} my_other_function
16+
17+
!ELF
18+
FileHeader:
19+
Class: ELFCLASS64
20+
Data: ELFDATA2LSB
21+
Type: ET_EXEC
22+
Machine: EM_X86_64
23+
ProgramHeaders:
24+
- Type: PT_LOAD
25+
Flags: [ PF_X, PF_R ]
26+
FirstSec: .text
27+
LastSec: '.text (1)'
28+
VAddr: 0x400000
29+
Align: 0x1000
30+
Offset: 0x0
31+
Sections:
32+
- Name: .text
33+
Type: SHT_PROGBITS
34+
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
35+
Address: 0x400010
36+
AddressAlign: 0x10
37+
- Name: '.text (1)'
38+
Type: SHT_PROGBITS
39+
Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GNU_RETAIN ]
40+
Address: 0x401000
41+
AddressAlign: 0x10
42+
Symbols:
43+
- Name: my_function
44+
Section: .text
45+
Value: 0x400010
46+
- Name: my_other_function
47+
Section: '.text (1)'
48+
Value: 0x401020

0 commit comments

Comments
 (0)