[PATCH] D59553: [LLD][ELF][DebugInfo] llvm-symbolizer shows incorrect source line info if --gc-sections used

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 08:37:37 PDT 2019


avl added a comment.

@echristo @aprantl @probinson

Folks, I would like to ask a question related to this review and DWARF standard:

DWARF5 standard has the following statement related to non-continuous address ranges:

> 2.17.3 Non-Contiguous Address Ranges
>  ...
>  A bounded range entry whose beginning and ending address offsets are equal
>  (including zero) indicates an empty range and may be ignored.

Would not it be useful to extend it to explicitly explain the following case
(for some next version of the standard)

> "A bounded range entry whose beginning address offset greater than ending address offset
>  indicates an invalid range and may be ignored. "

?

This situation (LowPC > HighPC) already represents an invalid range.

llvm-dwarfdump --verify :
error: Invalid address range [0xfffffffffffffffe, 0x0000000000000004)

Thus it would be useful to indicate that explicitly and describe that default handling would be to skip.
So that broken ranges do not affect valid ranges.

For this patch, it would mean that practically all cases 
would lead in this situation, and DWARF readers would adequately skip them :

1.

  LowPC -> points to deleted section -> set to UINT64_MAX-1; 
  HighPC -> points to deleted section -> set to UINT64_MAX-1; 
  
  ignored.



2.



  LowPC -> points to deleted section -> set to UINT64_MAX-1; 
  HighPC -> points to correct section -> set to some value less than UINT64_MAX-1;
  
  ignored.



3.



  LowPC -> points to deleted section -> set to UINT64_MAX-1; 
  Length has some value -> HighPC = UINT64_MAX-1 + value -> overflow -> less than LowPC
  
  ignored. 

What do you think?


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

https://reviews.llvm.org/D59553





More information about the llvm-commits mailing list