[PATCH] D17733: [ELF] Fix reading of PC values of FDEs

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 29 13:45:23 PST 2016


atanasyan created this revision.
atanasyan added reviewers: ruiu, rafael.
atanasyan added a subscriber: llvm-commits.
atanasyan set the repository for this revision to rL LLVM.
atanasyan added a project: lld.

The patch fixes two related problems:
- If CIE augmentation string has 'L' token the CIE contains a byte defines LSDA encoding. We should skip this byte in `getFdeEncoding` routine. Before this fix we do not skip it and if the next token is 'R' treat this byte as FDE encoding.
- FDE encoding format has separate flags e.g. DW_EH_PE_pcrel for definition of relative pointers. We should add .eh_frame address to the PC value iif the DW_EH_PE_pcrel is specified.

http://www.airs.com/blog/archives/460

There is one more not fixed problem in this code. If PC value is encoded using signed relative format e.g. DW_EH_PE_sdata4 | DW_EH_PE_pcrel we should sign extend result of read32 to perform calculation correctly. I am going to fix that in a separate patch.

Repository:
  rL LLVM

http://reviews.llvm.org/D17733

Files:
  ELF/OutputSections.cpp
  test/ELF/eh-frame-hdr-abs-fde.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17733.49411.patch
Type: text/x-patch
Size: 3523 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160229/bb4fa75f/attachment.bin>


More information about the llvm-commits mailing list