[PATCH] D75342: [obj2yaml] - Teach tool to dump program headers.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 09:40:16 PST 2020


MaskRay added a comment.

@jhenderson listed many good test cases. It requires some work. I've left some notes.

> 1. Standalone empty segments

GNU ld can create a p_memsz=p_filesz=0 PT_LOAD. lld doesn't.

> 2. Nested empty segments (at start/end/middle)

PT_TLS⊆PT_LOAD(RW)

(PT_TLS(p_memsz=0, p_align=64) is used by Android Bionic)

> 3. Empty sections in segments (at start/end/middle)
> 4. Misaligned segments?

p_offset%p_align != p_vaddr%p_align

> 5. Out-of-order PT_LOAD segments?

PT_LOAD not ordered by p_vaddr.

> ELF spec: Loadable segment entries in the program header table appear in ascending order, sorted on the p_vaddr member.



> 6. Segments with gaps in them (file size != size of all sections), where gap is at start/middle/end of segment.

`Type: Filler`

> 7. Segments with memsize > file size.

Needs non-empty `SHT_NOBITS`.

> 8. Non-alloc sections within segments.




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75342/new/

https://reviews.llvm.org/D75342





More information about the llvm-commits mailing list