Open llvmbot opened 7 years ago
I see no reason why using the integrated assembler vs gas should differ here so this is a bug.
Can you add your patch and a test case on phabricator (reviews.llvm.org)?
It's been more than a month now. Any input anyone?
emit file directive all the time Second patch makes sure to always emit the file directive even if -g is used and avoids adding an empty or an - (stdin) entry.
emit file directive if not generating dwarf The patch that I've attached works for me and generates the proper file directive for the non-dwarf case.
Is this a bug, undefined behaviour or intended?
Extended Description
Hello
When compiling .(s|S) files with clang, a FILE symbol is missing from the object file, unless explicitly setting one with the .file directive. Not using the integrated as, also fixes the issue:
$ clang -g bzero.S a.c && readelf -Ws a.out | grep FILE 33: 0000000000000000 0 FILE LOCAL DEFAULT ABS a.c
$ clang -no-integrated-as -g bzero.S a.c && readelf -Ws a.out | grep FILE 31: 0000000000000000 0 FILE LOCAL DEFAULT ABS bzero.S 33: 0000000000000000 0 FILE LOCAL DEFAULT ABS a.c
$ gcc -g bzero.S a.c && readelf -Ws a.out | grep FILE
31: 0000000000000000 0 FILE LOCAL DEFAULT ABS bzero.S 33: 0000000000000000 0 FILE LOCAL DEFAULT ABS a.c
This seems like a bug and the FILE symbol should be added with the integrated as as well.
Thank you!