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.
The patch that I've attached works for me and generates the
proper file directive.
https://bugs.llvm.org/show_bug.cgi?id=34019
Thank you!