diff options
author | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2021-11-15 12:50:51 +0100 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2021-11-15 12:56:10 +0100 |
commit | f9402ccaa9fac7858713a7672fae5760ae3d5ce7 (patch) | |
tree | 120dc7c0bafe4ff49b5b8e6022db155264abd330 /gas/doc/as.texi | |
parent | e6c46d077240565fac4d70066719a8bbe2c212d1 (diff) | |
download | binutils-f9402ccaa9fac7858713a7672fae5760ae3d5ce7.zip binutils-f9402ccaa9fac7858713a7672fae5760ae3d5ce7.tar.gz binutils-f9402ccaa9fac7858713a7672fae5760ae3d5ce7.tar.bz2 |
Deal with full path in .file 0 directive
Gas uses the directory part, if present, of the .file 0 directive to set
entry 0 of the directory table in DWARF 5, which represents the "current
directory".
Now Gas also uses the file part of the same directive to set entry 0 of the
file table, which represents the "current compilation file". But the latter
need not be located in the former so GCC will use a full path in the file
part when it is passed a full path:
gcc -c /full/path/test.c -save-temps
yields:
.file 0 "/current/directory" "/full/path/test.c"
in the assembly file and:
The Directory Table (offset 0x22, lines 2, columns 1):
Entry Name
0 (indirect line string, offset: 0x25): /current/directory
1 (indirect line string, offset: 0x38): /full/path
The File Name Table (offset 0x30, lines 2, columns 2):
Entry Dir Name
0 0 (indirect line string, offset: 0x43): /full/path/test.c
in the object file. Note the full path and the questionable Dir value in
the 0 entry of the file table.
Diffstat (limited to 'gas/doc/as.texi')
-rw-r--r-- | gas/doc/as.texi | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gas/doc/as.texi b/gas/doc/as.texi index 0cc7455..9c1924d 100644 --- a/gas/doc/as.texi +++ b/gas/doc/as.texi @@ -5416,19 +5416,22 @@ table is shared with the @code{.debug_info} section of the DWARF2 debugging information, and thus the user must know the exact indices that table entries will have. -If DWARF-5 support has been enabled via the @option{-gdwarf-5} option then -an extended version of the @code{file} is also allowed: +If DWARF5 support has been enabled via the @option{-gdwarf-5} option then +an extended version of @code{.file} is also allowed: @smallexample .file @var{fileno} [@var{dirname}] @var{filename} [md5 @var{value}] @end smallexample With this version a separate directory name is allowed, although if this is -used then @var{filename} should not contain any directory components. In -addtion an md5 hash value of the contents of @var{filename} can be provided. -This will be stored in the the file table as well, and can be used by tools -reading the debug information to verify that the contents of the source file -match the contents of the compiled file. +used then @var{filename} should not contain any directory component, except +for @var{fileno} equal to 0: in this case, @var{dirname} is expected to be +the current directory and @var{filename} the currently processed file, and +the latter need not be located in the former. In addtion an MD5 hash value +of the contents of @var{filename} can be provided. This will be stored in +the the file table as well, and can be used by tools reading the debug +information to verify that the contents of the source file match the +contents of the compiled file. @node Fill @section @code{.fill @var{repeat} , @var{size} , @var{value}} |