This is an archive of the discontinued LLVM Phabricator instance.

missing FILE symbol for .(s|S) files
Needs ReviewPublic

Authored by rnagy on Mar 19 2018, 8:49 AM.
This revision needs review, but all reviewers have resigned.

Details

Reviewers
niravd
Summary

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!

Diff Detail

Repository
rL LLVM

Event Timeline

rnagy created this revision.Mar 19 2018, 8:49 AM

This looks good. Can you convert your example into a test case?

rnagy added a comment.Mar 19 2018, 9:46 AM

This looks good. Can you convert your example into a test case?

I will try. I am not really familiar with the codebase.

niravd added a comment.May 8 2018, 8:46 AM

Robert, it looks like the state of the assembler file handling has shifted. Is the underlying issue still valid?

niravd resigned from this revision.Jun 10 2019, 10:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2019, 10:53 AM