File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -251,7 +251,15 @@ def _preprocess(self, text: str) -> str:
251251 # references to a local _JIT_CONTINUE label (which we will add later):
252252 continue_symbol = rf"\b{ re .escape (self .symbol_prefix )} _JIT_CONTINUE\b"
253253 continue_label = f"{ self .label_prefix } _JIT_CONTINUE"
254- return re .sub (continue_symbol , continue_label , text )
254+ text = re .sub (continue_symbol , continue_label , text )
255+ # Strip CFI directives. JIT stencils are compiled with
256+ # -fno-asynchronous-unwind-tables and don't use DWARF CFI unwind
257+ # tables (.eh_frame).
258+ # The optimizer's dead code elimination can remove blocks containing
259+ # .cfi_endproc while keeping the corresponding .cfi_startproc,
260+ # producing unbalanced CFI frames that some assemblers reject:
261+ text = re .sub (r"^\s*\.cfi_\w+[^\n]*$" , "" , text , flags = re .MULTILINE )
262+ return text
255263
256264 def _parse_instruction (self , line : str ) -> Instruction :
257265 target = None
You can’t perform that action at this time.
0 commit comments