From: H.J. Lu Date: Wed, 25 Feb 2009 14:39:35 +0000 (+0000) Subject: 2009-02-25 H.J. Lu X-Git-Tag: sid-snapshot-20090301~20 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2c63885c8bdc83996806fea03340e5ef713a307c;p=pf3gnuchains%2Fpf3gnuchains4x.git 2009-02-25 H.J. Lu * elf.c (elf_find_function): Use is_function_type to check function symbol. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index df8618d036..4d5838791c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2009-02-25 H.J. Lu + + * elf.c (elf_find_function): Use is_function_type to check + function symbol. + 2009-02-24 Sterling Augustine * xtensa-modules.c: Revert to previous version 1.11 due diff --git a/bfd/elf.c b/bfd/elf.c index 44af469e1f..97ac5cbc42 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -7041,7 +7041,7 @@ _bfd_elf_set_arch_mach (bfd *abfd, for error reporting. */ static bfd_boolean -elf_find_function (bfd *abfd ATTRIBUTE_UNUSED, +elf_find_function (bfd *abfd, asection *section, asymbol **symbols, bfd_vma offset, @@ -7061,6 +7061,7 @@ elf_find_function (bfd *abfd ATTRIBUTE_UNUSED, make a better choice of file name for local symbols by ignoring file symbols appearing after a given local symbol. */ enum { nothing_seen, symbol_seen, file_after_symbol_seen } state; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); filename = NULL; func = NULL; @@ -7071,20 +7072,22 @@ elf_find_function (bfd *abfd ATTRIBUTE_UNUSED, for (p = symbols; *p != NULL; p++) { elf_symbol_type *q; + unsigned int type; q = (elf_symbol_type *) *p; - switch (ELF_ST_TYPE (q->internal_elf_sym.st_info)) + type = ELF_ST_TYPE (q->internal_elf_sym.st_info); + switch (type) { - default: - break; case STT_FILE: file = &q->symbol; if (state == symbol_seen) state = file_after_symbol_seen; continue; + default: + if (!bed->is_function_type (type)) + break; case STT_NOTYPE: - case STT_FUNC: if (bfd_get_section (&q->symbol) == section && q->symbol.value >= low_func && q->symbol.value <= offset)