On 15/02/2012 20:15, Nathan Howell wrote:
I've hit a bug when main.c is compiled with -g to emit debug
symbols. GHC uses inline assembly to emit a .note section, which
appears to work when debug symbols are omitted. Enabling symbols
causes the assembler to fail when attempting to calculate offsets that
span sections. The attached patch splits the main function and note
section into two files: a C file with no inline assembly and a
separate assembly file containing just the .note section.
Seems reasonable. I'll apply, thanks.
Simon
Example case:
.file "ghc13519_0.c"
.section .debug_abbrev,"",@progbits
.Ldebug_abbrev0:
.section .debug_info,"",@progbits
.Ldebug_info0:
.section .debug_line,"",@progbits
.Ldebug_line0:
.text
.Ltext0:
#APP
.section .debug-ghc-link-info,"",@note
.ascii "<trimmed>"
#NO_APP
.p2align 4,,15
.globl main
.type main, @function
main:
.LFB99:
.file 1 "/tmp/ghc13519_0/ghc13519_0.c"
.loc 1 4 0
.cfi_startproc
.LVL0:
subq $24, %rsp
.LCFI0:
.cfi_def_cfa_offset 32
.loc 1 5 0
<trimmed>
Ldebug_loc0:
.LLST0:
.quad .LFB99-.Ltext0 # assembler fails to calculate these offsets
.quad .LCFI0-.Ltext0
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc