[llvm-dev] CFI error with binutils 2.27

Richard Pennington via llvm-dev llvm-dev at lists.llvm.org
Sat Aug 6 20:32:54 PDT 2016


On 08/06/2016 11:39 AM, Richard Pennington via llvm-dev wrote:
> Hi,
>
> :If I compile this file with debugging enabled (clang/LLVM TOT)
>
> int main()
> {
> }
>
> I get the error
>
> Error: inconsistent uses of .cfi_sections
>
> From the 2.27 binutils assemblers. It seems that 2.27 doesn't like the
>
> .cfi_sections .debug_frame
>
> directive following previous .cfi directives. The assemblers seem to 
> be happy if the .cfi_sections directive precedes any other .cfi 
> directive. Is this a bug in binutils or LLVM? It looks as if a fix 
> might be to move the generation of the .cfi_sections directive from 
> endModule() to somewhere else (maybe a non-existant beginModule()?).
>
> Could someone give me some hints about what the right approach might 
> be? It looks as if the ARM code generator might need special handling 
> also since it appears to emit the .cfi_sections directive itself.
>
> Thanks for any suggestions.
>
> -Rich

As a work-around I modified DwarfCFIException.cpp and ARMException.cpp 
to send the .cfi_sections directive before the first function is 
processed. Seems to work.

-Rich


More information about the llvm-dev mailing list