llvm::yaml::Hex64 Entry;
Optional<llvm::yaml::Hex16> SHEntSize;
- Optional<llvm::yaml::Hex64> SHOffset;
+ Optional<llvm::yaml::Hex64> SHOff;
Optional<llvm::yaml::Hex16> SHNum;
Optional<llvm::yaml::Hex16> SHStrNdx;
};
Doc.Header.SHEntSize ? (uint16_t)*Doc.Header.SHEntSize : sizeof(Elf_Shdr);
// Immediately following the ELF header and program headers.
// Align the start of the section header and write the ELF header.
- uint64_t ShOffset;
- CBA.getOSAndAlignedOffset(ShOffset, sizeof(typename ELFT::uint));
- Header.e_shoff = Doc.Header.SHOffset
- ? typename ELFT::uint(*Doc.Header.SHOffset)
- : ShOffset;
+ uint64_t SHOff;
+ CBA.getOSAndAlignedOffset(SHOff, sizeof(typename ELFT::uint));
+ Header.e_shoff =
+ Doc.Header.SHOff ? typename ELFT::uint(*Doc.Header.SHOff) : SHOff;
Header.e_shnum =
Doc.Header.SHNum ? (uint16_t)*Doc.Header.SHNum : Doc.Sections.size();
Header.e_shstrndx = Doc.Header.SHStrNdx ? (uint16_t)*Doc.Header.SHStrNdx
IO.mapOptional("Entry", FileHdr.Entry, Hex64(0));
IO.mapOptional("SHEntSize", FileHdr.SHEntSize);
- IO.mapOptional("SHOffset", FileHdr.SHOffset);
+ IO.mapOptional("SHOff", FileHdr.SHOff);
IO.mapOptional("SHNum", FileHdr.SHNum);
IO.mapOptional("SHStrNdx", FileHdr.SHStrNdx);
}
- Type: SHT_NULL
Size: 288230376151711744
-## Check the case when SHOffset is too large. SHOffset + sizeof(Elf_Shdr) overflows the uint64 type.
+## Check the case when SHOff is too large. SHOff + sizeof(Elf_Shdr) overflows the uint64 type.
# RUN: yaml2obj --docnum=28 %s -o %t28
# RUN: not llvm-readobj -h %t28 2>&1 | FileCheck -DFILE=%t28 --check-prefix=INVALID-SEC-NUM3 %s
Data: ELFDATA2LSB
Type: ET_REL
Machine: EM_X86_64
- SHOffset: 0xffffffffffffffff
+ SHOff: 0xffffffffffffffff
## Check that llvm-objdump reports an error when it tries to dump a
## symbol name and .strtab is empty.
Type: ET_REL
Machine: EM_X86_64
SHEntSize: 64
- SHOffset: 2
+ SHOff: 2
SHNum: 3
SHStrNdx: 4
Type: ET_REL
Machine: EM_X86_64
SHEntSize: 1
- SHOffset: 2
+ SHOff: 2
SHNum: 3
SHStrNdx: 4
template <class ELFT> Expected<ELFYAML::Object *> ELFDumper<ELFT>::dump() {
auto Y = std::make_unique<ELFYAML::Object>();
- // Dump header. We do not dump SHEntSize, SHOffset, SHNum and SHStrNdx field.
+ // Dump header. We do not dump SHEntSize, SHOff, SHNum and SHStrNdx fields.
// When not explicitly set, the values are set by yaml2obj automatically
// and there is no need to dump them here.
Y->Header.Class = ELFYAML::ELF_ELFCLASS(Obj.getHeader()->getFileClass());