From fdaa035e5e511476fb16b17791572c7e5724b641 Mon Sep 17 00:00:00 2001 From: rearnsha Date: Wed, 17 Jul 2002 12:17:17 +0000 Subject: [PATCH] From: Ian Rickards * dwarf2.c (concat_filename): If we can't establish the directory just return the filename. --- bfd/ChangeLog | 5 +++++ bfd/dwarf2.c | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index cb66ee74e8..f8e4100848 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2002-07-17 Ian Rickards + + * dwarf2.c (concat_filename): If we can't establish the directory + just return the filename. + 2002-07-16 Moritz Jodeit * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Correct order of memset args. diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index 005a21f7d3..9c5e7b8d17 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); } } -- 2.11.0