On Wed, Sep 23, 2026 at 2:08 AM Oleg Tolmatcev <[email protected]> wrote:
>
> ср, 23 сент. 2026 г. в 01:06, Andrea Pinski <[email protected]>:
> >
> > On Tue, Sep 22, 2026 at 3:59 PM Oleg Tolmatcev <[email protected]> 
> > wrote:
> > >
> > > On Windows, opening a source file in text mode translates CRLF to LF.
> > > md5_stream therefore records a checksum that does not match the file
> > > contents.  Open source files in binary mode before calculating CodeView
> > > checksums.
> > >
> > > gcc/ChangeLog:
> > >
> > >         PR debug/119940
> > >         * dwarf2codeview.cc (codeview_start_source_file): Open the source 
> > > file
> > >         in binary mode.
> >
> > Ok.
> >
> > > ---
> > >  gcc/dwarf2codeview.cc | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/gcc/dwarf2codeview.cc b/gcc/dwarf2codeview.cc
> > > index ada04079fd..67e3799104 100644
> > > --- a/gcc/dwarf2codeview.cc
> > > +++ b/gcc/dwarf2codeview.cc
> > > @@ -1746,7 +1746,7 @@ codeview_start_source_file (const char *filename)
> > >    sf->string_offset = string_offset;
> > >    sf->filename = xstrdup (filename);
> > >
> > > -  f = fopen (filename, "r");
> > > +  f = fopen (filename, "rb");
> > >    if (!f)
> > >      internal_error ("could not open %s for reading", filename);
> > >
> > > --
> > > 2.55.0.windows.5
> > >
>
> Thanks for the review. I forgot to mention that I don't have write access.

Pushed: https://gcc.gnu.org/pipermail/gcc-cvs/2026-September/462166.html .

This patch is small enough it is not legally significant.
But you are going to contribute in the future, it would be good if you
either sign your commits in accordance with the DCO or have a
copyright assignment on file with the FSF.
Please see https://gcc.gnu.org/contribute.html#legal for more
information for both.

Thanks,
Andrea

>
> Oleg

Reply via email to