This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Warning when using separate debug info file


> From: Tom Tromey <tom@tromey.com>
> Cc: Tom Tromey <tom@tromey.com>,  lrn1986@gmail.com,  gdb-patches@sourceware.org
> Date: Thu, 25 Apr 2019 11:31:29 -0600
> 
> >> The section isn't needed in the separate debug file -- only in the
> >> stripped file.  What is wrong here is the section flags.
> 
> Eli> So you are saying the bug is actually in the MinGW port of objcopy?
> 
> Maybe, though I don't know much about this file format, so I don't
> really know.
> 
> Eli> Which section flag should not be there?
> 
> I'm not sure, you'll have to experiment.

It turns out that the only flags that should be there are like those
shown in the ELF case:

    $ objdump -h -j .gnu_debuglink q

    q:     file format elf64-x86-64

    Sections:
    Idx Name          Size      VMA               LMA               File off  Algn
     25 .gnu_debuglink 0000000c  0000000000000000  0000000000000000  000013cc  2**2
                      CONTENTS, READONLY

So this:

  objcopy --set-section-flags .gnu_debuglink=contents,readonly hello.exe

fixes the problem: I can now debug the program without the warning.

I'm going to report this to the Binutils list.

Thanks.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]