-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JITLink] Some cleanups to EHFrameSupport #66707
Conversation
The code expects DWARFRecordSectionSplitter to split each CFI record into its own block, so remove loop over possibly multiple entries in one block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why error on an existing CIE edge?
LGTM otherwise.
Because that's the simplification, that the new code expects that there is no edge yet and we can remove the additional checks. And I firmly believe that assumptions should be checked in the code. |
There were multiple simplifications in this piece of code. Assuming one record per block seems reasonable (we have the splitter as you noted), but rejecting objects with existing FDE-to-CIE edges is a change in behavior -- I'm asking for the reasoning behind that. |
Making my concern explicit: This could cause us to reject well-formed objects that would have been accepted before. The existing error check for that doesn't seem burdensome in either readability or performance -- I think that should have been left it. Sorry -- probably should have been clearer about that in the review. |
According to the DWARF standard:
So the field in the emitted objects must always be offsets while only dynamically registered frames must have a finalized pointer, which we achieve by adding edges / relocations. In my reading this means we must never see a relocation on this field before we process it... |
The DWARF spec is handy for understanding eh-frames for exceptions but I don't think it constitutes a proper spec for them. E.g. the The practical problem is just Darwin as far as I know: On some architectures (e..g arm64) we use relocations for some fields (pc-begin consistently, but others too). LLVM doesn't generate CIE edges (at least not these days), but I have seen them in the past, possibly from custom compilers. I'm inclined to pay the extra cost to check for and accept them where they're present. |
EHFrameEdgeFixer
: The code expectsDWARFRecordSectionSplitter
to split each CFI record into its own block, so remove loop over possibly multiple entries in one block.