PR28149, debug info with wrong file association

Eric Botcazou botcazou@adacore.com
Fri Sep 17 08:49:20 GMT 2021


> A freshly built x86_64-linux mainline gcc compiling this testcase
> 
> asm("nop");
> int main ()
> {
>   return 0;
> }
> 
> ~/build/gcc/gcc/xgcc -B ~/build/gcc/gcc/ -g pr28149.c -v -save-temps
> shows the assembler being invoked with --gdwarf-5 on the following

Your compiler does not seem to be properly configured, here's mine:

	.file	"pr28149.c"
	.text
.Ltext0:
	.file 0 "/home/eric/build/gcc/native" "pr28149.c"
#APP
	nop
#NO_APP
	.globl	main
	.type	main, @function
main:
.LFB0:
	.file 1 "pr28149.c"
	.loc 1 3 1
	.cfi_startproc

Note that there is a fair amount of configury involved on the compiler side to 
detect various binutils quirks:

#if defined(HAVE_AS_GDWARF_5_DEBUG_FLAG) && 
defined(HAVE_AS_WORKING_DWARF_N_FLAG)
  if (output_asm_line_debug_info () && dwarf_version >= 5)

so the assembler must really be detected at configure time.

-- 
Eric Botcazou




More information about the Binutils mailing list