]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Hide a couple classes in an anonymous namespace
authorPetr Machata <pmachata@redhat.com>
Mon, 30 Nov 2009 15:55:28 +0000 (16:55 +0100)
committerPetr Machata <pmachata@redhat.com>
Wed, 18 Aug 2010 12:55:17 +0000 (14:55 +0200)
src/dwarflint/checks-low.cc

index 714d4bd0fa3d0471da578256a2b04ecd456fe927..16f377becd8584c6553346ca9a8f5aab17178294 100644 (file)
 #include <cstring>
 #include <cassert>
 
-struct secentry
-{
-  Elf_Data *reldata;   /* Relocation data if any found.  */
-  size_t reltype;      /* SHT_REL or SHT_RELA.  We need this
-                          temporary store to be able to resolve
-                          relocation section appearing before
-                          relocated section.  */
-  size_t secndx;       /* Index into file->sec or 0 if not yet loaded.  */
-  section_id id;       /* Section type.  */
-
-  explicit secentry (section_id a_id = sec_invalid)
-    : reldata (NULL)
-    , reltype (0)
-    , secndx (0)
-    , id (a_id)
-  {}
-};
-
-struct secinfo_map
-  : public std::map <std::string, secentry>
-{
-  secentry *get (const char *name)
-  {
-    iterator it = find (std::string (name));
-    if (it == end ())
-      return NULL;
-    else
-      return &it->second;
-  }
-};
 
 namespace
 {
@@ -193,6 +163,37 @@ namespace
     return elf;
   }
 
+  struct secentry
+  {
+    Elf_Data *reldata; /* Relocation data if any found.  */
+    size_t reltype;    /* SHT_REL or SHT_RELA.  We need this
+                          temporary store to be able to resolve
+                          relocation section appearing before
+                          relocated section.  */
+    size_t secndx;     /* Index into file->sec or 0 if not yet loaded.  */
+    section_id id;     /* Section type.  */
+
+    explicit secentry (section_id a_id = sec_invalid)
+      : reldata (NULL)
+      , reltype (0)
+      , secndx (0)
+      , id (a_id)
+    {}
+  };
+
+  struct secinfo_map
+    : public std::map <std::string, secentry>
+  {
+    secentry *get (const char *name)
+    {
+      iterator it = find (std::string (name));
+      if (it == end ())
+       return NULL;
+      else
+       return &it->second;
+    }
+  };
+
   bool
   elf_file_init (struct elf_file *file, int fd)
   {