[PATCH] D58266: [MC] Sort DWARF FDEs by the associated CIE before emitting them.

John Reagan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 19 11:39:10 PST 2019


JohnReagan added a comment.

I asked my local expert for an opinion.

"The comments about the DWARF standard are correct.  I don’t think it imposes any order or restriction on the placement of FDE’s and CIE’s.

However, the Linux Standard Base design is such that FDE’s can only refer to prior CIE’s, not ones that appear later in .eh_frame.  This restriction arises because the CIE pointer in FDE’s are self-relative offsets, and the offset is an unsigned quantity which is always subtracted from the FDE location.

Seems to me that, given this, there’s only two ways you’d want to organize FDE’s and CIE’s: either bunch all the CIE’s at the beginning, followed by all the FDE’s; or each CIE is followed by all its FDE’s.  This proposal is suggesting eliminating the former as an option.  I wasn’t there when the LSB was formalized, but it seems to me that if they had wanted to have each CIE followed by all its FDE’s, they wouldn’t have put a pointer to the CIE in the FDE in the first place.  Would have saved some space and complexity."


Repository:
  rL LLVM

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

https://reviews.llvm.org/D58266





More information about the llvm-commits mailing list