[PATCH] D61584: [DebugInfo] Some fields do not need relocations even relax is enabled.

Hsiangkai Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 15 23:10:50 PDT 2019


HsiangKai added a comment.

In D61584#1503168 <https://reviews.llvm.org/D61584#1503168>, @probinson wrote:

> It still bothers me that MCDwarf has to know exactly when to override the target's decision to do relaxation.
>
> Why is it appropriate to do that in the two methods where you have made that change in this patch, and not in many other places within MCDwarf that call the same helper?  What guides me to know it's correct in the first three calls to emitAbsValue within FrameEmitterImpl::EmitFDE, but not in the fourth?  Without becoming an expert in all the fine details of every target.


It is not about target's decision. It is about whether the symbol difference will be changed after linking. For example, `length` field in FDE is used to describe the size of this FDE structure. It will not be affected by linker even relaxation is enabled. However, `address_range` in FDE is used to describe the range of instructions related to this FDE. If the linker modifies the instructions in the range, `address_range` will need be updated by linker accordingly. That's why it needs to set `Fixed` flag in `length` field instead of `address_range` field in FDE.

I will review other uses of `emitAbsValue` to ensure the flag is set correctly.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61584





More information about the llvm-commits mailing list