From: Ulrich Drepper Date: Tue, 14 Jul 2009 17:42:01 +0000 (-0700) Subject: Add STB_GNU_UNIQUE support to elflint. X-Git-Tag: elfutils-0.142~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96d950e3e28d89469b62b46d5a014ad1260e6a1a;p=platform%2Fupstream%2Felfutils.git Add STB_GNU_UNIQUE support to elflint. --- diff --git a/NEWS b/NEWS index 1b73645..5d1a85a 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,8 @@ libelf: Add elf_getshdrnum alias for elf_getshnum and elf_getshdrstrndx alias libebl: Add support for STB_GNU_UNIQUE. +elflint: Add support for STB_GNU_UNIQUE. + readelf: Add -N option, speeds up DWARF printing without address->name lookups. Version 0.141: diff --git a/src/ChangeLog b/src/ChangeLog index 51b3dd8..69f9a65 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-07-14 Ulrich Drepper + + * elflint.c (check_elf_header): Allow Linux ABI. + (check_symtab): Handle STB_GNU_UNIQUE. + 2009-07-08 Mark Wielaard * readelf.c (attr_callback): Handle DW_Form constants for diff --git a/src/elflint.c b/src/elflint.c index c04ae57..9915a54 100644 --- a/src/elflint.c +++ b/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) {