diff options
Diffstat (limited to 'elfutils/src/elflint.c')
-rw-r--r-- | elfutils/src/elflint.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/elfutils/src/elflint.c b/elfutils/src/elflint.c index 7ddf3a9a..f85d2864 100644 --- a/elfutils/src/elflint.c +++ b/elfutils/src/elflint.c @@ -377,8 +377,9 @@ check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size) ERROR (gettext ("unknown ELF header version number e_ident[%d] == %d\n"), EI_VERSION, ehdr->e_ident[EI_VERSION]); - /* We currently don't handle any OS ABIs. */ - if (ehdr->e_ident[EI_OSABI] != ELFOSABI_NONE) + /* We currently don't handle any OS ABIs other than Linux. */ + if (ehdr->e_ident[EI_OSABI] != ELFOSABI_NONE + && ehdr->e_ident[EI_OSABI] != ELFOSABI_LINUX) ERROR (gettext ("unsupported OS ABI e_ident[%d] == '%s'\n"), EI_OSABI, ebl_osabi_name (ebl, ehdr->e_ident[EI_OSABI], buf, sizeof (buf))); @@ -705,10 +706,17 @@ section [%2d] '%s': symbol %zu: invalid section index\n"), ERROR (gettext ("section [%2d] '%s': symbol %zu: unknown type\n"), idx, section_name (ebl, idx), cnt); - if (GELF_ST_BIND (sym->st_info) >= STB_NUM) + if (GELF_ST_BIND (sym->st_info) >= STB_NUM + && !ebl_symbol_binding_name (ebl, GELF_ST_BIND (sym->st_info), NULL, + 0)) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: unknown symbol binding\n"), idx, section_name (ebl, idx), cnt); + if (GELF_ST_BIND (sym->st_info) == STB_GNU_UNIQUE + && GELF_ST_TYPE (sym->st_info) != STT_OBJECT) + ERROR (gettext ("\ +section [%2d] '%s': symbol %zu: unique symbol not of object type\n"), + idx, section_name (ebl, idx), cnt); if (xndx == SHN_COMMON) { @@ -976,6 +984,17 @@ section [%2d] '%s': _DYNAMIC symbol size %" PRIu64 " does not match dynamic segm } } } + + if (GELF_ST_VISIBILITY (sym->st_other) != STV_DEFAULT + && shdr->sh_type == SHT_DYNSYM) + ERROR (gettext ("\ +section [%2d] '%s': symbol %zu: symbol in dynamic symbol table with non-default visibility\n"), + idx, section_name (ebl, idx), cnt); + if ((sym->st_other ^ GELF_ST_VISIBILITY (sym->st_other)) != 0) + ERROR (gettext ("\ +section [%2d] '%s': symbol %zu: unknown bit set in st_other\n"), + idx, section_name (ebl, idx), cnt); + } } @@ -3950,6 +3969,7 @@ section [%2d] '%s': unknown core file note type %" PRIu32 case NT_GNU_ABI_TAG: case NT_GNU_HWCAP: case NT_GNU_BUILD_ID: + case NT_GNU_GOLD_VERSION: break; case 0: |