Skip to content

Commit 61c2495

Browse files
author
git apple-llvm automerger
committed
Merge commit '7a587ca93200' from llvm.org/master into apple/master
2 parents a30a1bd + 7a587ca commit 61c2495

File tree

14 files changed

+88
-90
lines changed

14 files changed

+88
-90
lines changed

llvm/include/llvm/ObjectYAML/ELFYAML.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,10 @@ struct FileHeader {
8484
Optional<llvm::yaml::Hex64> EPhOff;
8585
Optional<llvm::yaml::Hex16> EPhEntSize;
8686
Optional<llvm::yaml::Hex16> EPhNum;
87-
88-
Optional<llvm::yaml::Hex16> SHEntSize;
89-
Optional<llvm::yaml::Hex64> SHOff;
90-
Optional<llvm::yaml::Hex16> SHNum;
91-
Optional<llvm::yaml::Hex16> SHStrNdx;
87+
Optional<llvm::yaml::Hex16> EShEntSize;
88+
Optional<llvm::yaml::Hex64> EShOff;
89+
Optional<llvm::yaml::Hex16> EShNum;
90+
Optional<llvm::yaml::Hex16> EShStrNdx;
9291
};
9392

9493
struct SectionHeader {

llvm/lib/ObjectYAML/ELFEmitter.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -417,21 +417,21 @@ void ELFState<ELFT>::writeELFHeader(raw_ostream &OS, uint64_t SHOff) {
417417
else
418418
Header.e_phnum = 0;
419419

420-
Header.e_shentsize =
421-
Doc.Header.SHEntSize ? (uint16_t)*Doc.Header.SHEntSize : sizeof(Elf_Shdr);
420+
Header.e_shentsize = Doc.Header.EShEntSize ? (uint16_t)*Doc.Header.EShEntSize
421+
: sizeof(Elf_Shdr);
422422

423423
const bool NoShdrs =
424424
Doc.SectionHeaders && Doc.SectionHeaders->NoHeaders.getValueOr(false);
425425

426-
if (Doc.Header.SHOff)
427-
Header.e_shoff = *Doc.Header.SHOff;
426+
if (Doc.Header.EShOff)
427+
Header.e_shoff = *Doc.Header.EShOff;
428428
else if (NoShdrs)
429429
Header.e_shoff = 0;
430430
else
431431
Header.e_shoff = SHOff;
432432

433-
if (Doc.Header.SHNum)
434-
Header.e_shnum = *Doc.Header.SHNum;
433+
if (Doc.Header.EShNum)
434+
Header.e_shnum = *Doc.Header.EShNum;
435435
else if (!Doc.SectionHeaders)
436436
Header.e_shnum = Doc.getSections().size();
437437
else if (NoShdrs)
@@ -442,8 +442,8 @@ void ELFState<ELFT>::writeELFHeader(raw_ostream &OS, uint64_t SHOff) {
442442
: 0) +
443443
/*Null section*/ 1;
444444

445-
if (Doc.Header.SHStrNdx)
446-
Header.e_shstrndx = *Doc.Header.SHStrNdx;
445+
if (Doc.Header.EShStrNdx)
446+
Header.e_shstrndx = *Doc.Header.EShStrNdx;
447447
else if (NoShdrs || ExcludedSectionHeaders.count(".shstrtab"))
448448
Header.e_shstrndx = 0;
449449
else

llvm/lib/ObjectYAML/ELFYAML.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -872,11 +872,10 @@ void MappingTraits<ELFYAML::FileHeader>::mapping(IO &IO,
872872
IO.mapOptional("EPhOff", FileHdr.EPhOff);
873873
IO.mapOptional("EPhEntSize", FileHdr.EPhEntSize);
874874
IO.mapOptional("EPhNum", FileHdr.EPhNum);
875-
876-
IO.mapOptional("SHEntSize", FileHdr.SHEntSize);
877-
IO.mapOptional("SHOff", FileHdr.SHOff);
878-
IO.mapOptional("SHNum", FileHdr.SHNum);
879-
IO.mapOptional("SHStrNdx", FileHdr.SHStrNdx);
875+
IO.mapOptional("EShEntSize", FileHdr.EShEntSize);
876+
IO.mapOptional("EShOff", FileHdr.EShOff);
877+
IO.mapOptional("EShNum", FileHdr.EShNum);
878+
IO.mapOptional("EShStrNdx", FileHdr.EShStrNdx);
880879
}
881880

882881
void MappingTraits<ELFYAML::ProgramHeader>::mapping(

llvm/test/Object/invalid.test

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ Sections:
181181

182182
--- !ELF
183183
FileHeader:
184-
Class: ELFCLASS64
185-
Data: ELFDATA2LSB
186-
Type: ET_REL
187-
Machine: EM_X86_64
188-
SHEntSize: 1
184+
Class: ELFCLASS64
185+
Data: ELFDATA2LSB
186+
Type: ET_REL
187+
Machine: EM_X86_64
188+
EShEntSize: 1
189189

190190
## Check that llvm-readobj reports a warning if .symtab has sh_size
191191
## that is not a multiple of sh_entsize.
@@ -306,11 +306,11 @@ Symbols: []
306306

307307
--- !ELF
308308
FileHeader:
309-
Class: ELFCLASS64
310-
Data: ELFDATA2LSB
311-
Type: ET_REL
312-
Machine: EM_X86_64
313-
SHNum: 0xFF
309+
Class: ELFCLASS64
310+
Data: ELFDATA2LSB
311+
Type: ET_REL
312+
Machine: EM_X86_64
313+
EShNum: 0xFF
314314

315315
## Check llvm-readobj does not crash on a truncated ELF.
316316

@@ -521,11 +521,11 @@ ProgramHeaders:
521521

522522
--- !ELF
523523
FileHeader:
524-
Class: ELFCLASS64
525-
Data: ELFDATA2LSB
526-
Type: ET_REL
527-
Machine: EM_X86_64
528-
SHStrNdx: 0xFF
524+
Class: ELFCLASS64
525+
Data: ELFDATA2LSB
526+
Type: ET_REL
527+
Machine: EM_X86_64
528+
EShStrNdx: 0xFF
529529
Sections:
530530
- Name: .foo
531531
Type: SHT_PROGBITS
@@ -541,11 +541,11 @@ Sections:
541541

542542
--- !ELF
543543
FileHeader:
544-
Class: ELFCLASS64
545-
Data: ELFDATA2LSB
546-
Type: ET_REL
547-
Machine: EM_X86_64
548-
SHNum: 0x0
544+
Class: ELFCLASS64
545+
Data: ELFDATA2LSB
546+
Type: ET_REL
547+
Machine: EM_X86_64
548+
EShNum: 0x0
549549
Sections:
550550
- Type: SHT_NULL
551551
Size: 288230376151711743
@@ -560,11 +560,11 @@ Sections:
560560

561561
--- !ELF
562562
FileHeader:
563-
Class: ELFCLASS64
564-
Data: ELFDATA2LSB
565-
Type: ET_REL
566-
Machine: EM_X86_64
567-
SHNum: 0x0
563+
Class: ELFCLASS64
564+
Data: ELFDATA2LSB
565+
Type: ET_REL
566+
Machine: EM_X86_64
567+
EShNum: 0x0
568568
Sections:
569569
- Type: SHT_NULL
570570
Size: 288230376151711744
@@ -578,11 +578,11 @@ Sections:
578578

579579
--- !ELF
580580
FileHeader:
581-
Class: ELFCLASS64
582-
Data: ELFDATA2LSB
583-
Type: ET_REL
584-
Machine: EM_X86_64
585-
SHOff: 0xffffffffffffffff
581+
Class: ELFCLASS64
582+
Data: ELFDATA2LSB
583+
Type: ET_REL
584+
Machine: EM_X86_64
585+
EShOff: 0xffffffffffffffff
586586

587587
## Check that llvm-objdump reports an error when it tries to dump a
588588
## symbol name and .strtab is empty.
@@ -641,12 +641,12 @@ DynamicSymbols:
641641

642642
--- !ELF
643643
FileHeader:
644-
Class: ELFCLASS64
645-
Data: ELFDATA2LSB
646-
Type: ET_REL
647-
Machine: EM_X86_64
644+
Class: ELFCLASS64
645+
Data: ELFDATA2LSB
646+
Type: ET_REL
647+
Machine: EM_X86_64
648648
## SHN_XINDEX == 0xffff.
649-
SHStrNdx: 0xffff
649+
EShStrNdx: 0xffff
650650
Sections:
651651
- Type: SHT_NULL
652652
Link: 0xff

llvm/test/tools/llvm-readobj/ELF/dynamic-reloc-no-section-headers.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ FileHeader:
2323
Machine: EM_X86_64
2424
## We simulate no section header table by
2525
## overriding the ELF header properties.
26-
SHOff: 0x0
27-
SHNum: 0x0
26+
EShOff: 0x0
27+
EShNum: 0x0
2828
Sections:
2929
- Name: .rela.dyn
3030
Type: SHT_RELA

llvm/test/tools/llvm-readobj/ELF/gnu-notes.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ FileHeader:
8888
Type: ET_EXEC
8989
Machine: EM_X86_64
9090
EPhEntSize: [[PHENTSIZE=56]]
91-
SHNum: [[SHNUM=6]]
91+
EShNum: [[SHNUM=6]]
9292
Sections:
9393
- Name: .note.ABI-tag
9494
Type: SHT_NOTE

llvm/test/tools/llvm-readobj/ELF/hash-table.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ FileHeader:
6464
Machine: EM_X86_64
6565
## We simulate no section header table by
6666
## overriding the ELF header properties.
67-
SHOff: 0x0
68-
SHNum: 0x0
67+
EShOff: 0x0
68+
EShNum: 0x0
6969
Sections:
7070
- Name: .hash
7171
Type: SHT_HASH

llvm/test/tools/llvm-readobj/ELF/invalid-shstrndx.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ FileHeader:
4646
Data: ELFDATA2LSB
4747
Type: ET_REL
4848
Machine: EM_X86_64
49-
SHStrNdx: 0xFF
49+
EShStrNdx: 0xFF

llvm/test/tools/llvm-readobj/ELF/many-sections.s

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919
--- !ELF
2020
FileHeader:
21-
Class: ELFCLASS64
22-
Data: ELFDATA2LSB
23-
Type: ET_REL
24-
Machine: EM_X86_64
25-
SHNum: 0
26-
SHStrNdx: 0xffff ## SHN_XINDEX
21+
Class: ELFCLASS64
22+
Data: ELFDATA2LSB
23+
Type: ET_REL
24+
Machine: EM_X86_64
25+
EShNum: 0
26+
EShStrNdx: 0xffff ## SHN_XINDEX
2727
Sections:
2828
- Type: SHT_NULL
2929
Link: .shstrtab
@@ -56,13 +56,13 @@ Sections:
5656

5757
--- !ELF
5858
FileHeader:
59-
Class: ELFCLASS64
60-
Data: ELFDATA2LSB
61-
Type: ET_REL
62-
Machine: EM_X86_64
63-
SHOff: 0
64-
SHNum: 0
65-
SHStrNdx: 0xffff ## SHN_XINDEX
59+
Class: ELFCLASS64
60+
Data: ELFDATA2LSB
61+
Type: ET_REL
62+
Machine: EM_X86_64
63+
EShOff: 0
64+
EShNum: 0
65+
EShStrNdx: 0xffff ## SHN_XINDEX
6666
Sections:
6767
- Type: SHT_NULL
6868
Link: .shstrtab

llvm/test/tools/llvm-readobj/ELF/sections-no-section-header-string-table.test

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@
9292

9393
--- !ELF
9494
FileHeader:
95-
Class: ELFCLASS64
96-
Data: ELFDATA2LSB
97-
Type: ET_DYN
98-
Machine: EM_X86_64
99-
SHStrNdx: 0
95+
Class: ELFCLASS64
96+
Data: ELFDATA2LSB
97+
Type: ET_DYN
98+
Machine: EM_X86_64
99+
EShStrNdx: 0
100100
Sections:
101101
- Name: .foo
102102
Type: SHT_PROGBITS

llvm/test/tools/llvm-readobj/ELF/symbols.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ FileHeader:
161161
Data: ELFDATA2LSB
162162
Type: ET_REL
163163
Machine: EM_X86_64
164-
SHStrNdx: [[SHSTRTAB=2]]
164+
EShStrNdx: [[SHSTRTAB=2]]
165165
Sections:
166166
- Name: .symtab
167167
Type: SHT_SYMTAB

llvm/test/tools/yaml2obj/ELF/header-sh-fields.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ ProgramHeaders:
3333

3434
--- !ELF
3535
FileHeader:
36-
Class: ELFCLASS64
37-
Data: ELFDATA2LSB
38-
Type: ET_REL
39-
Machine: EM_X86_64
40-
SHEntSize: [[SHENTSIZE=64]]
41-
SHOff: [[SHOFF=200]]
42-
SHNum: [[SHNUM=3]]
43-
SHStrNdx: [[SHSTRNDX=2]]
36+
Class: ELFCLASS64
37+
Data: ELFDATA2LSB
38+
Type: ET_REL
39+
Machine: EM_X86_64
40+
EShEntSize: [[SHENTSIZE=64]]
41+
EShOff: [[SHOFF=200]]
42+
EShNum: [[SHNUM=3]]
43+
EShStrNdx: [[SHSTRNDX=2]]
4444
EPhOff: [[PHOFF=64]]
4545
EPhEntSize: [[PHENTSIZE=56]]
4646
EPhNum: [[PHNUM=2]]

llvm/test/tools/yaml2obj/ELF/section-headers.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ FileHeader:
184184
Data: ELFDATA2LSB
185185
Type: ET_REL
186186
Machine: EM_X86_64
187-
SHOff: 0x2
188-
SHNum: 0x3
189-
SHStrNdx: 0x4
187+
EShOff: 0x2
188+
EShNum: 0x3
189+
EShStrNdx: 0x4
190190
Sections:
191191
- Name: .foo
192192
Type: SHT_PROGBITS

llvm/tools/obj2yaml/elf2yaml.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ bool ELFDumper<ELFT>::shouldPrintSection(const ELFYAML::Section &S,
200200
template <class ELFT> Expected<ELFYAML::Object *> ELFDumper<ELFT>::dump() {
201201
auto Y = std::make_unique<ELFYAML::Object>();
202202

203-
// Dump header. We do not dump EPh* and SH* fields. When not explicitly set,
203+
// Dump header. We do not dump EPh* and ESh* fields. When not explicitly set,
204204
// the values are set by yaml2obj automatically and there is no need to dump
205205
// them here.
206206
Y->Header.Class = ELFYAML::ELF_ELFCLASS(Obj.getHeader()->getFileClass());

0 commit comments

Comments
 (0)