[PATCH] D84825: [ELF] Change tombstone value -1 to 0

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 01:57:27 PDT 2020


jhenderson added a comment.

In D84825#2199023 <https://reviews.llvm.org/D84825#2199023>, @avl wrote:

>> However, we can use ANY other single value (1, 2, 123456, -2 etc) except -1 which also has a special meaning, because semantically, those values all result in an empty range (-2, -2)/(1, 1) etc. There is no need for special handling within consumers for any given value in this case (or at least there shouldn't be), and thus the specific BFD-identical value for .debug_ranges shouldn't matter.
>
> It looks like there still exist a small difference with using -2 and 1 for thombstone value for debug_ranges. When base address selection entry is specified using -2 as thomstone value
>
> {-1, -2}  <<< base address selection entry
> {0, length} <<< address range
>
> the -2 value would case overflow and there would be situation when LowPC is greater than HighPC. This would not happen for 1 value. That overflow situation could affect customers who did not have it before. From that point of view using 1(BFD-identical) as thombstone value looks safer.
>
> {-1, 1}  <<< base address selection entry
> {0, length} <<< address range

That is a fair argument for the "1" approach for .debug_ranges (although I doubt in practice it makes any difference). It doesn't really help .debug_loc though, since the behaviour there is currently broken in BFD land.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84825



More information about the llvm-commits mailing list