diff options
author | Richard Earnshaw <richard.earnshaw@arm.com> | 2002-07-17 12:17:18 +0000 |
---|---|---|
committer | Richard Earnshaw <richard.earnshaw@arm.com> | 2002-07-17 12:17:18 +0000 |
commit | 0dafd5f6a9d00407314e765ce587fbf4d58fd9e3 (patch) | |
tree | d4e842664b013fd69b940b32305f83e8afe29b8a | |
parent | ae66e5d720521257f3797a54a209e881b9b6f30d (diff) | |
download | binutils-0dafd5f6a9d00407314e765ce587fbf4d58fd9e3.tar.gz binutils-0dafd5f6a9d00407314e765ce587fbf4d58fd9e3.tar.bz2 binutils-0dafd5f6a9d00407314e765ce587fbf4d58fd9e3.zip |
From: Ian Rickards <irickard@arm.com>
* dwarf2.c (concat_filename): If we can't establish the directory
just return the filename.
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/dwarf2.c | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index cb66ee74e85..f8e4100848e 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2002-07-17 Ian Rickards <irickard@arm.com> + + * dwarf2.c (concat_filename): If we can't establish the directory + just return the filename. + 2002-07-16 Moritz Jodeit <moritz@jodeit.org> * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Correct order of memset args. diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 005a21f7d3b..9c5e7b8d173 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -856,13 +856,18 @@ concat_filename (table, file) filename = table->files[file - 1].name; if (IS_ABSOLUTE_PATH(filename)) return filename; - else { char* dirname = (table->files[file - 1].dir ? table->dirs[table->files[file - 1].dir - 1] : table->comp_dir); - return (char*) concat (dirname, "/", filename, NULL); + + /* Not all tools set DW_AT_comp_dir, so dirname may be unknown. The + best we can do is return the filename part. */ + if (dirname == NULL) + return filename; + else + return (char*) concat (dirname, "/", filename, NULL); } } |