Skip to content

Commit 490ce7e

Browse files
committed
gas .file 0 vs. dwarf5
Support added in commit 3417bfc for dwarf5 directory table 0 assumed that .file 0 was always the first debug .file directive. That's not necessarily true. * dwarf2dbg.c (get_directory_table_entry): Don't assume entry 1 is available after putting DW_AT_comp_dir in entry 0. Pass pwd as file0_dirname to recursive call to avoid another getpwd in the case file0_dirname is NULL.
1 parent 6d007cc commit 490ce7e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

gas/dwarf2dbg.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -650,9 +650,8 @@ get_directory_table_entry (const char *dirname,
650650
is set to the current build directory). Since we are
651651
about to create a directory entry that is not the
652652
same, allocate the current directory first. */
653-
(void) get_directory_table_entry (pwd, file0_dirname,
654-
strlen (pwd), true);
655-
d = 1;
653+
(void) get_directory_table_entry (pwd, pwd, strlen (pwd), true);
654+
d = dirs_in_use;
656655
}
657656
else
658657
d = 0;

0 commit comments

Comments
 (0)