[PATCH] D78304: [yaml2obj] - Program headers: introduce the `POffset` and add an additional check for `Offset`

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 20 06:59:48 PDT 2020


grimar added a comment.

In D78304#1992196 <https://reviews.llvm.org/D78304#1992196>, @jhenderson wrote:

> In D78304#1992157 <https://reviews.llvm.org/D78304#1992157>, @grimar wrote:
>
> > This is what this patch does. It introduces an error when the program header `Offset` forced is greater than the minimal section offset.
> >  But since we need a way to set an arbitrary value for some tests (to override `p_offset`), I've introduced `POffset`, which does not affect on the properties of a program header, it just overrides the `p_offset` field without any checks.
> >
> > So I think the behavior you described is exactly what this patch does, or not ?
>
>
> The bit I don't understand is the need for the POffset field. In such instances, just don't list the sections and use explicit Offset + FileSize/MemSize. The sizes wouldn't make sense anyway since the program header would be at a weird location.


OK, great! That what I did it initially in D78005 <https://reviews.llvm.org/D78005> (in tests) and it sounds good to me. Then I'll remove the "POffset" field from this patch. So it will just introduce the offset validation check and adopt existent test cases.


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

https://reviews.llvm.org/D78304





More information about the llvm-commits mailing list