https://sourceware.org/bugzilla/show_bug.cgi?id=32913

            Bug ID: 32913
           Summary: dwp fatal error removes a.out file
           Product: binutils
           Version: 2.45 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
          Assignee: ccoutant at gmail dot com
          Reporter: vries at gcc dot gnu.org
                CC: ian at airs dot com
  Target Milestone: ---

Say you compiled some source file to a.out:
...
$ g++-14 test.cc -g
$ ls a.out
a.out
...

Now say we invoke dwp to produce a fatal error:
...
$ dwp -o bla.dwp
dwp: fatal error: no input files and no executable specified
$
...

Dwp has removed a.out:
...
$ ls a.out
ls: cannot access 'a.out': No such file or directory
$
...

This is because dwp used gold options, and the output file option has an a.out
default:
...
(gdb) p options.output_
$3 = {<gold::options::Struct_var> = {
    _vptr.Struct_var = 0x6c00a8 <vtable for
gold::General_options::Struct_output+16>}, option = {
    longname = "output", dashes = gold::options::TWO_DASHES, shortname = 111
'o',
    default_value = 0x6d9cc0 "a.out", helpstring = 0x6d9cab "Set output file
name",
    helparg = 0x6d86ef "FILE", optional_arg = false, reader = 0x7fffffff8758,
is_default = false},
  user_set_via_option = false, value = 0x6d9cc0 "a.out"}
...
and dwp uses gold_fatal, which removes the gold output file.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to