Warn if the sh_info field of a symbol table does not index the first non-local symbol...
authorNick Clifton <nickc@redhat.com>
Fri, 12 Aug 2016 19:36:20 +0000 (20:36 +0100)
committerNick Clifton <nickc@redhat.com>
Fri, 12 Aug 2016 19:36:20 +0000 (20:36 +0100)
* readelf.c (process_symbol_table): Generate a warning if a local
symbol is found at and offste greater than or equal to the sh_info
field of it's section header.

binutils/ChangeLog
binutils/readelf.c

index d21c299fac89975918f0c9a0e8bd8d0ba0d37e65..5018e43dd501c5c6fd5be2d7bc7e6906f206e733 100644 (file)
@@ -1,3 +1,9 @@
+2016-08-12  Nick Clifton  <nickc@redhat.com>
+
+       * readelf.c (process_symbol_table): Generate a warning if a local
+       symbol is found at and offste greater than or equal to the sh_info
+       field of it's section header.
+
 2016-08-08  Nick Clifton  <nickc@redhat.com>
 
        PR binutils/20440
index e6674c2f5fcd85d2cf55a64a99b85bce441d2cd3..586d13c7dea2068d9adeeb4bdfccd42ade6e682a 100644 (file)
@@ -11114,6 +11114,11 @@ process_symbol_table (FILE * file)
                }
 
              putchar ('\n');
+
+             if (ELF_ST_BIND (psym->st_info) == STB_LOCAL
+                 && si >= section->sh_info)
+               warn (_("local symbol %u found at index >= %s's sh_info value of %u\n"),
+                     si, printable_section_name (section), section->sh_info);
            }
 
          free (symtab);