Re: No debugsource generated, weird DWARF errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Xavier,

On Wed, 2020-07-29 at 18:50 +0200, Xavier Leroy wrote:
> If we need to add a directive to the generated assembly, or pass a `-g`
> option to the assembler, or use `gcc -c -g` as the assembler, let us know
> and we'll see what we can do.
> 
> However, please keep backward compatibility in mind: from the Info manual
> it looks like gas version 2.34 has no `-g` option and no directives to
> control the generation of DWARF information.  So there should be reasonable
> defaults for gas 2.35 to behave roughly like gas 2.34.

I think the change in binutils/gas 2.35 was supposed to be backward
compatible. I am pretty sure it was just an oversight that the DWARF
version (dwarf_level) was not set in the none -g case.

Lets see what Nick (the binutils maintainer) says. My patch is just the
first thing I came up with. I am sure there are other ways to fix this.

Cheers,

Mark

> > But... in 2.35 you can give the DWARF level you want.
> > The problem with not supplying -g (or --gdwarf-[VERSION]) is that the
> > dwarf_level is never set! And then gas will happily create an
> > .debug_info section with DWARF CUs that have a version of zero (!).
> > 
> > This, defaulting to version 4. Fixes it for me:
> > 
> > diff --git a/gas/as.c b/gas/as.c
> > index 4c5881abd88..c2da78870ef 100644
> > --- a/gas/as.c
> > +++ b/gas/as.c
> > @@ -103,7 +103,7 @@ int verbose = 0;
> >  int flag_dwarf_cie_version = -1;
> > 
> >  /* The maximum level of DWARF DEBUG information we should
> > manufacture.  */
> > -unsigned int dwarf_level = 0;
> > +unsigned int dwarf_level = 4;
> > 
> >  #if defined OBJ_ELF || defined OBJ_MAYBE_ELF
> >  int flag_use_elf_stt_common = DEFAULT_GENERATE_ELF_STT_COMMON;
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux