probinson added a comment.

In D71487#1791824 <https://reviews.llvm.org/D71487#1791824>, @clayborg wrote:

> BTW: is used to be that both DW_AT_low_pc and DW_AT_high_pc would be set to 
> zero when a function was dead stripped. This was back when both the low and 
> high pc used DW_FORM_addr (a file address). But then DWARF changed such that 
> DW_AT_high_pc could be encoded as a data form: DW_FORM_data1, DW_FORM_data2, 
> DW_FORM_data4, or DW_FORM_data8. This is used to mean it is an offset from 
> the low PC. Seems the linkers now didn't have a relocation for the 
> DW_AT_high_pc so they couldn't zero it out. This is sad because we can end up 
> with many functions at address zero that didn't get linked, and if zero is a 
> valid address, then our DWARF contains a bunch of useless info that only 
> hides which function is the real function for address zero.


One solution, which we do in Sony, is to make the linker fix up undefined 
references to be -1 instead of 0 (at least, in the .debug_* sections).  That's 
more obviously an invalid address.  Doesn't help with existing objects in the 
wild but I'd like to keep that idea in the air as a forward evolutionary step.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71487



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to