This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Wrong file name entry in .debug_info section
- From: kamlesh kumar <kamleshbhalui at gmail dot com>
- To: binutils at sourceware dot org
- Date: Fri, 3 Aug 2018 14:36:39 +0530
- Subject: Wrong file name entry in .debug_info section
Hi devs,
gas is putting wrong entry inside .debug_info section into attribute
DW_AT_name
if -xassembler-with-cpp option is used with deubbing enabled.
considering following example:
hello.s
<https://gist.github.com/kamleshbhalui/ef391b040bcfa514048a2ae680a1eafd>
when below command is issued:
gcc -g -c -xassembler-with-cpp -P hello.s
readelf --debug-dump hello.o | grep DW_AT_name
I get following:
DW_AT_name :/tmp/cc8P6Tw2.s
which is a temporary file generated by compiler now no more exist.
Why gas is putting wrong file name there.
Even if compiler put *.file="hello.s" * at top of hello.s .
why gas is not using that info?
is this a bug ?since other compiler is giving right answer.
There is one workout that do not use -P so it will generate linemarker and
gas is using file name from there.But I do not want that because that will
be redundant information.