static int
 cmp_symtabs (const symtab_and_line &sala, const symtab_and_line &salb)
 {
-  const char *dira = sala.symtab->dirname ();
-  const char *dirb = salb.symtab->dirname ();
+  const char *dira = sala.symtab->compunit ()->dirname ();
+  const char *dirb = salb.symtab->compunit ()->dirname ();
   int r;
 
   if (dira == NULL)
 
 
   cust = s->compunit ();
   gdb_printf (_("Current source file is %s\n"), s->filename);
-  if (s->dirname () != NULL)
-    gdb_printf (_("Compilation directory is %s\n"), s->dirname ());
+  if (s->compunit ()->dirname () != NULL)
+    gdb_printf (_("Compilation directory is %s\n"), s->compunit ()->dirname ());
   if (s->fullname)
     gdb_printf (_("Located in %s\n"), s->fullname);
   const std::vector<off_t> *offsets;
 
   gdb::unique_xmalloc_ptr<char> fullname (s->fullname);
   s->fullname = NULL;
-  scoped_fd fd = find_and_open_source (s->filename, s->dirname (),
+  scoped_fd fd = find_and_open_source (s->filename, s->compunit ()->dirname (),
                                       &fullname);
 
   if (fd.get () < 0)
          std::string srcpath;
          if (IS_ABSOLUTE_PATH (s->filename))
            srcpath = s->filename;
-         else if (s->dirname () != nullptr)
+         else if (s->compunit ()->dirname () != nullptr)
            {
-             srcpath = s->dirname ();
+             srcpath = s->compunit ()->dirname ();
              srcpath += SLASH_STRING;
              srcpath += s->filename;
            }
          /* rewrite_source_path would be applied by find_and_open_source, we
             should report the pathname where GDB tried to find the file.  */
 
-         if (s->dirname () == NULL || IS_ABSOLUTE_PATH (s->filename))
+         if (s->compunit ()->dirname () == nullptr
+             || IS_ABSOLUTE_PATH (s->filename))
            fullname.reset (xstrdup (s->filename));
          else
-           fullname.reset (concat (s->dirname (), SLASH_STRING,
+           fullname.reset (concat (s->compunit ()->dirname (), SLASH_STRING,
                                    s->filename, (char *) NULL));
 
          s->fullname = rewrite_source_path (fullname.get ()).release ();
 
              symtab_to_filename_for_display (symtab),
              host_address_to_string (symtab));
 
-  if (symtab->dirname () != NULL)
+  if (symtab->compunit ()->dirname () != NULL)
     gdb_printf (outfile, "Compilation directory is %s\n",
-               symtab->dirname ());
+               symtab->compunit ()->dirname ());
   gdb_printf (outfile, "Read from object file %s (%s)\n",
              objfile_name (objfile),
              host_address_to_string (objfile));
 
 
   program_space *pspace () const;
 
-  const char *dirname () const;
-
   /* Unordered chain of all filetabs in the compunit,  with the exception
      that the "main" source file is the first entry in the list.  */
 
   return this->compunit ()->objfile ();
 }
 
-inline const char *
-symtab::dirname () const
-{
-  return this->compunit ()->dirname ();
-}
-
 /* Return the language of CUST.  */
 
 extern enum language compunit_language (const struct compunit_symtab *cust);