Created attachment 15597
Small repro
First: I'm not sure whether I am using gccas or llvm-as. The command I use is
'clang -arch x86_64 -c -v myobj.s'.
This is about .cfi_xxx directives for emitting DWARF CFI (call frame
information) that enables debuggers to generate stack backtraces and
programming language runtimes (specifically C++ and Objective-C) to walk and
unwind the stack.
The assembler currently accepts input where the net CFA offset adjustment at a
.cfi_endproc is nonzero. See small example attached. Its current behavior in
that case is that the adjustment is applied to the next assembly routine
(.cfi_startproc directive) as well. You can see by running 'dwarfdump --eh-
frame myobj.o'. I believe this input is usually/always erroneous and
furthermore the behavior is undesirable.
I would suggest to at least offer an option to have this flagged as an error.
Also, that behavior should probably be the default.
(Context: the OCaml native code compiler currently generates such unbalanced
directives. See http://caml.inria.fr/mantis/view.php?id=7120 and
http://caml.inria.fr/mantis/view.php?id=7118 and
https://github.com/ocaml/ocaml/pull/408 . In this case, it is definitely an
error. It caused my application to crash randomly. Especially during demos ;-) )
myobj.s
(220 bytes, application/octet-stream)