[PATCH] D75527: [yaml2obj] - Add `ELFYAML::YAMLInt` to fix how we parse a relocation `Addend` key.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 13 09:39:52 PDT 2020


MaskRay added a comment.

> For an 64-bit object any hex/decimal addends in range [-(2^64 - 1), 2^64 - 1)] is accepted.
>  For an 64-bit object any hex/decimal addends in range [-(2^32 - 1), 2^32 - 1)] is accepted.

My feeling is that the ranges should be:
[-(2^63 - 1), 2^64 - 1)]
[-(2^31 - 1), 2^32 - 1)]

> It should probably accept the union of int32_t and uint32_t, i.e. [-2147483648, 4294967295]. Examples: R_AARCH64_ABS32, R_AARCH64_PREL32, R_PPC64_ADDR32.

For example, for an ELFCLASS32 object, an addend of -0xffffffff or -0x80000001 is invalid.


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

https://reviews.llvm.org/D75527





More information about the llvm-commits mailing list