mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Simplify iterating over program headers and detect corrupt ones.
We now use a simple pointer and have range loops. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242669 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1109,20 +1109,18 @@ template<class ELFT>
|
||||
void ELFDumper<ELFT>::printProgramHeaders() {
|
||||
ListScope L(W, "ProgramHeaders");
|
||||
|
||||
for (typename ELFO::Elf_Phdr_Iter PI = Obj->program_header_begin(),
|
||||
PE = Obj->program_header_end();
|
||||
PI != PE; ++PI) {
|
||||
for (const typename ELFO::Elf_Phdr &Phdr : Obj->program_headers()) {
|
||||
DictScope P(W, "ProgramHeader");
|
||||
W.printHex ("Type",
|
||||
getElfSegmentType(Obj->getHeader()->e_machine, PI->p_type),
|
||||
PI->p_type);
|
||||
W.printHex ("Offset", PI->p_offset);
|
||||
W.printHex ("VirtualAddress", PI->p_vaddr);
|
||||
W.printHex ("PhysicalAddress", PI->p_paddr);
|
||||
W.printNumber("FileSize", PI->p_filesz);
|
||||
W.printNumber("MemSize", PI->p_memsz);
|
||||
W.printFlags ("Flags", PI->p_flags, makeArrayRef(ElfSegmentFlags));
|
||||
W.printNumber("Alignment", PI->p_align);
|
||||
W.printHex("Type",
|
||||
getElfSegmentType(Obj->getHeader()->e_machine, Phdr.p_type),
|
||||
Phdr.p_type);
|
||||
W.printHex("Offset", Phdr.p_offset);
|
||||
W.printHex("VirtualAddress", Phdr.p_vaddr);
|
||||
W.printHex("PhysicalAddress", Phdr.p_paddr);
|
||||
W.printNumber("FileSize", Phdr.p_filesz);
|
||||
W.printNumber("MemSize", Phdr.p_memsz);
|
||||
W.printFlags("Flags", Phdr.p_flags, makeArrayRef(ElfSegmentFlags));
|
||||
W.printNumber("Alignment", Phdr.p_align);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user