[PATCH] D58445: [yaml2obj]Allow symbol Index field to take values lower than SHN_LORESERVE

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 20 07:07:29 PST 2019


jhenderson added a comment.

In D58445#1404051 <https://reviews.llvm.org/D58445#1404051>, @grimar wrote:

> I thought before about some kind of conflict we might see in situations like this.
>  From one side we might want to keep (and maybe improve) the validating because it is probably a useful thing in general.
>  But we still want to have a way to produce invalid outputs when we want, as this patch does.
>
> Should we instead of removing the validation code add an option to `yaml2obj`, something like `-no-validate`?


Hmm... interesting thought. In this case, I think if you've explicitly used Index, you probably know what you are doing by specifying an explicit section index outside the reserved range, instead of using one of the SHN_* values or using the Section field. I could be persuaded otherwise though. On a related note, without this change, you cannot specify `Index: SHN_UNDEF`, because SHN_UNDEF is less than SHN_LORESERVE. It's not strictly necessary, because the default is undefined, but it's still slightly weird behaviour.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D58445





More information about the llvm-commits mailing list