Next: , Previous: Fail, Up: Pseudo Ops


7.53 .file

There are two different versions of the .file directive. Targets that support DWARF2 line number information use the DWARF2 version of .file. Other targets use the default version.

Default Version

This version of the .file directive tells as that we are about to start a new logical file. The syntax is:

     .file string

string is the new file name. In general, the filename is recognized whether or not it is surrounded by quotes ‘"’; but if you wish to specify an empty file name, you must give the quotes–"". This statement may go away in future: it is only recognized to be compatible with old as programs.

DWARF2 Version

When emitting DWARF2 line number information, .file assigns filenames to the .debug_line file name table. The syntax is:

     .file fileno filename

The fileno operand should be a unique positive integer to use as the index of the entry in the table. The filename operand is a C string literal.

The detail of filename indices is exposed to the user because the filename table is shared with the .debug_info section of the DWARF2 debugging information, and thus the user must know the exact indices that table entries will have.