Skip to content

Commit 157b3d5

Browse files
author
Georgii Rymar
committed
[yaml2obj] - Address post commit comments for D74764
It removes a stale comment and fixes the comment in the test and section names related accordingly.
1 parent 72848f2 commit 157b3d5

File tree

2 files changed

+29
-31
lines changed

2 files changed

+29
-31
lines changed

llvm/lib/ObjectYAML/ELFEmitter.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,8 +707,6 @@ void ELFState<ELFT>::initStrtabSectionHeader(Elf_Shdr &SHeader, StringRef Name,
707707
else if (Name == ".dynstr")
708708
SHeader.sh_flags = ELF::SHF_ALLOC;
709709

710-
// If the section is explicitly described in the YAML
711-
// then we want to use its section address.
712710
assignSectionAddress(SHeader, YAMLSec);
713711
}
714712

llvm/test/tools/yaml2obj/ELF/section-address-assign.yaml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,37 @@
1212
## We assign virtual addresses to allocatable sections automatically for executables and shared libraries.
1313

1414
# EXE-DSO: Section Headers:
15-
# EXE-DSO-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al
16-
# EXE-DSO-NEXT: [ 0] NULL 0000000000000000 000000 000000 00 0 0 0
17-
# EXE-DSO-NEXT: [ 1] .text.any.addr PROGBITS 0000000000001000 000040 000003 00 A 0 0 0
18-
# EXE-DSO-NEXT: [ 2] .text.shsize PROGBITS 0000000000001003 000043 001234 00 A 0 0 0
19-
# EXE-DSO-NEXT: [ 3] .text.align PROGBITS 0000000000001100 000100 000004 00 A 0 0 256
20-
# EXE-DSO-NEXT: [ 4] .data.any.addr PROGBITS 0000000000002000 000104 000001 00 A 0 0 0
21-
# EXE-DSO-NEXT: [ 5] .data.after.fill PROGBITS 0000000000002101 000205 000001 00 A 0 0 0
22-
# EXE-DSO-NEXT: [ 6] .data.return.back PROGBITS 0000000000001500 000206 000001 00 A 0 0 0
23-
# EXE-DSO-NEXT: [ 7] .data.return.back.foo PROGBITS 0000000000001501 000207 000000 00 A 0 0 0
24-
# EXE-DSO-NEXT: [ 8] .dynsym DYNSYM 0000000000001508 000208 000018 18 A 9 1 8
25-
# EXE-DSO-NEXT: [ 9] .dynstr STRTAB 0000000000001520 000220 000001 00 A 0 0 1
26-
# EXE-DSO-NEXT: [10] .strtab STRTAB 0000000000000000 000221 000001 00 0 0 1
27-
# EXE-DSO-NEXT: [11] .shstrtab STRTAB 0000000000000000 000222 000093 00 0 0 1
15+
# EXE-DSO-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al
16+
# EXE-DSO-NEXT: [ 0] NULL 0000000000000000 000000 000000 00 0 0 0
17+
# EXE-DSO-NEXT: [ 1] .text.any.addr PROGBITS 0000000000001000 000040 000003 00 A 0 0 0
18+
# EXE-DSO-NEXT: [ 2] .text.shsize PROGBITS 0000000000001003 000043 001234 00 A 0 0 0
19+
# EXE-DSO-NEXT: [ 3] .text.align PROGBITS 0000000000001100 000100 000004 00 A 0 0 256
20+
# EXE-DSO-NEXT: [ 4] .data.any.addr PROGBITS 0000000000002000 000104 000001 00 A 0 0 0
21+
# EXE-DSO-NEXT: [ 5] .data.after.fill PROGBITS 0000000000002101 000205 000001 00 A 0 0 0
22+
# EXE-DSO-NEXT: [ 6] .data.go.back PROGBITS 0000000000001500 000206 000001 00 A 0 0 0
23+
# EXE-DSO-NEXT: [ 7] .data.go.back.foo PROGBITS 0000000000001501 000207 000000 00 A 0 0 0
24+
# EXE-DSO-NEXT: [ 8] .dynsym DYNSYM 0000000000001508 000208 000018 18 A 9 1 8
25+
# EXE-DSO-NEXT: [ 9] .dynstr STRTAB 0000000000001520 000220 000001 00 A 0 0 1
26+
# EXE-DSO-NEXT: [10] .strtab STRTAB 0000000000000000 000221 000001 00 0 0 1
27+
# EXE-DSO-NEXT: [11] .shstrtab STRTAB 0000000000000000 000222 00008b 00 0 0 1
2828

2929
## We do not assign virtual addresses to allocatable sections in a relocatable object
3030
## unless YAML document has an explicit request.
3131

3232
# REL: Section Headers:
33-
# REL-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al
34-
# REL-NEXT: [ 0] NULL 0000000000000000 000000 000000 00 0 0 0
35-
# REL-NEXT: [ 1] .text.any.addr PROGBITS 0000000000001000 000040 000003 00 A 0 0 0
36-
# REL-NEXT: [ 2] .text.shsize PROGBITS 0000000000000000 000043 001234 00 A 0 0 0
37-
# REL-NEXT: [ 3] .text.align PROGBITS 0000000000000000 000100 000004 00 A 0 0 256
38-
# REL-NEXT: [ 4] .data.any.addr PROGBITS 0000000000002000 000104 000001 00 A 0 0 0
39-
# REL-NEXT: [ 5] .data.after.fill PROGBITS 0000000000000000 000205 000001 00 A 0 0 0
40-
# REL-NEXT: [ 6] .data.return.back PROGBITS 0000000000001500 000206 000001 00 A 0 0 0
41-
# REL-NEXT: [ 7] .data.return.back.foo PROGBITS 0000000000000000 000207 000000 00 A 0 0 0
42-
# REL-NEXT: [ 8] .dynsym DYNSYM 0000000000000000 000208 000018 18 A 9 1 8
43-
# REL-NEXT: [ 9] .dynstr STRTAB 0000000000000000 000220 000001 00 A 0 0 1
44-
# REL-NEXT: [10] .strtab STRTAB 0000000000000000 000221 000001 00 0 0 1
45-
# REL-NEXT: [11] .shstrtab STRTAB 0000000000000000 000222 000093 00 0 0 1
33+
# REL-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al
34+
# REL-NEXT: [ 0] NULL 0000000000000000 000000 000000 00 0 0 0
35+
# REL-NEXT: [ 1] .text.any.addr PROGBITS 0000000000001000 000040 000003 00 A 0 0 0
36+
# REL-NEXT: [ 2] .text.shsize PROGBITS 0000000000000000 000043 001234 00 A 0 0 0
37+
# REL-NEXT: [ 3] .text.align PROGBITS 0000000000000000 000100 000004 00 A 0 0 256
38+
# REL-NEXT: [ 4] .data.any.addr PROGBITS 0000000000002000 000104 000001 00 A 0 0 0
39+
# REL-NEXT: [ 5] .data.after.fill PROGBITS 0000000000000000 000205 000001 00 A 0 0 0
40+
# REL-NEXT: [ 6] .data.go.back PROGBITS 0000000000001500 000206 000001 00 A 0 0 0
41+
# REL-NEXT: [ 7] .data.go.back.foo PROGBITS 0000000000000000 000207 000000 00 A 0 0 0
42+
# REL-NEXT: [ 8] .dynsym DYNSYM 0000000000000000 000208 000018 18 A 9 1 8
43+
# REL-NEXT: [ 9] .dynstr STRTAB 0000000000000000 000220 000001 00 A 0 0 1
44+
# REL-NEXT: [10] .strtab STRTAB 0000000000000000 000221 000001 00 0 0 1
45+
# REL-NEXT: [11] .shstrtab STRTAB 0000000000000000 000222 00008b 00 0 0 1
4646

4747
--- !ELF
4848
FileHeader:
@@ -83,15 +83,15 @@ Sections:
8383
Type: SHT_PROGBITS
8484
Flags: [ SHF_ALLOC ]
8585
Size: 0x1
86-
## Show we can return back in the address space and
86+
## Show we can go back in the address space and
8787
## continue placing sections. The order of sections in the
8888
## section header table will match the order in the YAML description.
89-
- Name: .data.return.back
89+
- Name: .data.go.back
9090
Address: 0x1500
9191
Type: SHT_PROGBITS
9292
Flags: [ SHF_ALLOC ]
9393
Size: 0x1
94-
- Name: .data.return.back.foo
94+
- Name: .data.go.back.foo
9595
Type: SHT_PROGBITS
9696
Flags: [ SHF_ALLOC ]
9797
## Used to trigger creation of .dynsym and .dynstr.

0 commit comments

Comments
 (0)