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

--- Comment #5 from Joel Rosdahl <joel at rosdahl dot net> ---
Created attachment 13656
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13656&action=edit
gas: Apply debug prefix map to DWARF-5 PWD entry in directory table

(In reply to Nick Clifton from comment #4)
> OK, well I cannot reproduce that behaviour

Oh, that's peculiar. Here's the reproduction recipe in self-contained script
form:

    #!/bin/sh

    tmpdir=$(mktemp -d)
    trap "rm -rf ${tmpdir}" EXIT

    cd $tmpdir
    echo 'int x;' >test.c
    /usr/bin/gcc -g -fdebug-prefix-map="${tmpdir}=/example" -c test.c
    if grep -q "${tmpdir}" test.o; then
      echo "FAIL: PWD found in object file"
    else
      echo "OK"
    fi

With binutils-2.35.1-41.fc34.x86_64.rpm:

    % ./repro
    OK

With binutils-2.35.2-5.fc34.x86_64.rpm:

    % ./repro
    FAIL: PWD found in object file

> Do you have a suggested patch to fix the problem ?

I didn't, but after having spent some time in the GAS code I now have. See
attachment.

One thing that I'm not 100% sure of is if it's OK to rely on
$COLLECT_GCC_OPTIONS in GAS. I haven't studied how that variable is used by
other parts of the toolchain; I only noted that it's available and contains the
information we need.

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

Reply via email to