if ((now_seg->flags & need_flags) != need_flags)
{
/* FIXME: Add code to suppress multiple warnings ? */
- as_warn ("dwarf line number information for %s ignored",
- segment_name (now_seg));
+ if (debug_type != DEBUG_DWARF2)
+ as_warn ("dwarf line number information for %s ignored",
+ segment_name (now_seg));
return;
}
/* Early out for as-yet incomplete location information. */
if (loc->line == 0)
return;
- if (loc->filenum == 0 && DWARF2_LINE_VERSION < 5)
- return;
+ if (loc->filenum == 0)
+ {
+ if (dwarf_level < 5)
+ dwarf_level = 5;
+ if (DWARF2_LINE_VERSION < 5)
+ return;
+ }
/* Don't emit sequences of line symbols for the same line when the
symbols apply to assembler code. It is necessary to emit
{
const char * dir = NULL;
- if (dirs)
+ if (dirs != NULL)
dir = dirs[files[num].dir];
if (with_md5
/* If the filenames match, but the directory table entry was
empty, then fill it with the provided directory name. */
if (dir == NULL)
- dirs[files[num].dir] = xmemdup0 (dirname, strlen (dirname));
+ {
+ if (dirs == NULL)
+ {
+ dirs_allocated = files[num].dir + 32;
+ dirs = XCNEWVEC (char *, dirs_allocated);
+ }
+
+ dirs[files[num].dir] = xmemdup0 (dirname, strlen (dirname));
+ }
return TRUE;
}
file = get_basename (filename);
if (filename_cmp (file, files[num].filename) == 0)
{
+ /* The filenames match, but the directory table entry is empty.
+ Fill it with the provided directory name. */
if (file > filename)
- /* The filenames match, but the directory table entry is empty.
- Fill it with the provided directory name. */
- dirs[files[num].dir] = xmemdup0 (filename, file - filename);
+ {
+ if (dirs == NULL)
+ {
+ dirs_allocated = files[num].dir + 32;
+ dirs = XCNEWVEC (char *, dirs_allocated);
+ }
+
+ dirs[files[num].dir] = xmemdup0 (filename, file - filename);
+ }
return TRUE;
}
}
num = get_absolute_expression ();
- if ((offsetT) num < 1 && DWARF2_LINE_VERSION < 5)
+ if ((offsetT) num < 1)
{
- as_bad (_("file number less than one"));
- ignore_rest_of_line ();
- return NULL;
+ if (num == 0 && dwarf_level < 5)
+ dwarf_level = 5;
+ if ((offsetT) num < 0 || DWARF2_LINE_VERSION < 5)
+ {
+ as_bad (_("file number less than one"));
+ ignore_rest_of_line ();
+ return NULL;
+ }
}
/* FIXME: Should we allow ".file <N>\n" as an expression meaning
if (filenum < 1)
{
- if (filenum != 0 || DWARF2_LINE_VERSION < 5)
+ if (filenum == 0 && dwarf_level < 5)
+ dwarf_level = 5;
+ if (filenum < 0 || DWARF2_LINE_VERSION < 5)
{
as_bad (_("file number less than one"));
return;
}
}
- if (filenum >= (int) files_in_use || files[filenum].filename == NULL)
+ if ((valueT) filenum >= files_in_use || files[filenum].filename == NULL)
{
as_bad (_("unassigned file number %ld"), (long) filenum);
return;