]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
2005-08-14 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@redhat.com>
Mon, 15 Aug 2005 08:01:25 +0000 (08:01 +0000)
committerRoland McGrath <roland@redhat.com>
Mon, 15 Aug 2005 08:01:25 +0000 (08:01 +0000)
* elflint.c (check_sections): Use ebl_section_type_name and allow any
sh_type it recognizes.

* elflint.c (check_sections): Print unknown flags in hex, don't
truncate high bits.  Print section number and name for unknown type.

src/ChangeLog
src/elflint.c

index 5dd61f2e565d1eb91494afce9353e36f9daf203f..a95f5c5fbbdc0e25c5a9cddfa65902dd51d8c842 100644 (file)
@@ -1,3 +1,11 @@
+2005-08-14  Roland McGrath  <roland@redhat.com>
+
+       * elflint.c (check_sections): Use ebl_section_type_name and allow any
+       sh_type it recognizes.
+
+       * elflint.c (check_sections): Print unknown flags in hex, don't
+       truncate high bits.  Print section number and name for unknown type.
+
 2005-08-13  Roland McGrath  <roland@redhat.com>
 
        * elflint.c (check_program_header): Use ebl_segment_type_name and
index 65b3fb7273edbc0501402bbf5ce254184b7a1eba..53abf849508f666e56ec40e22f83c1483ab484c2 100644 (file)
@@ -678,7 +678,8 @@ section [%2d] '%s': symbol %zu: invalid section index\n"),
       else
        xndx = sym->st_shndx;
 
-      if (GELF_ST_TYPE (sym->st_info) >= STT_NUM)
+      if (GELF_ST_TYPE (sym->st_info) >= STT_NUM
+         && !ebl_symbol_type_name (ebl, GELF_ST_TYPE (sym->st_info), NULL, 0))
        ERROR (gettext ("section [%2d] '%s': symbol %zu: unknown type\n"),
               idx, section_name (ebl, idx), cnt);
 
@@ -2708,16 +2709,20 @@ section [%2zu] '%s': size not multiple of entry size\n"),
          && shdr->sh_type != SHT_CHECKSUM
          && shdr->sh_type != SHT_GNU_verdef
          && shdr->sh_type != SHT_GNU_verneed
-         && shdr->sh_type != SHT_GNU_versym)
-       ERROR (gettext ("unsupported section type %d\n"), (int) shdr->sh_type);
+         && shdr->sh_type != SHT_GNU_versym
+         && ebl_section_type_name (ebl, shdr->sh_type, NULL, 0) == NULL)
+       ERROR (gettext ("section [%2zu] '%s' has unsupported type %d\n"),
+              cnt, section_name (ebl, cnt),
+              (int) shdr->sh_type);
 
 #define ALL_SH_FLAGS (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR | SHF_MERGE \
                      | SHF_STRINGS | SHF_INFO_LINK | SHF_LINK_ORDER \
                      | SHF_OS_NONCONFORMING | SHF_GROUP | SHF_TLS)
       if (shdr->sh_flags & ~ALL_SH_FLAGS)
-       ERROR (gettext ("section [%2zu] '%s' contain unknown flag(s) %d\n"),
+       ERROR (gettext ("section [%2zu] '%s' contains unknown flag(s)"
+                       " %#" PRIx64 "\n"),
               cnt, section_name (ebl, cnt),
-              (int) shdr->sh_flags & ~ALL_SH_FLAGS);
+              (uint64_t) shdr->sh_flags & ~(uint64_t) ALL_SH_FLAGS);
       else if (shdr->sh_flags & SHF_TLS)
        {
          // XXX Correct?