(_bfd_elf_maybe_function_sym): Likewise. Replace elf_symbol_type
parameter with asymbol.
* elf64-ppc.c (ppc64_elf_maybe_function_sym): Likewise.
* elf-bfd.h (_bfd_elf_maybe_function_sym): Update prototype.
(struct elf_backend_data <maybe_function_sym>): Likewise.
+2012-02-07 Alan Modra <amodra@gmail.com>
+
+ * elf.c (elf_find_function): Don't use internal_elf_sym.
+ (_bfd_elf_maybe_function_sym): Likewise. Replace elf_symbol_type
+ parameter with asymbol.
+ * elf64-ppc.c (ppc64_elf_maybe_function_sym): Likewise.
+ * elf-bfd.h (_bfd_elf_maybe_function_sym): Update prototype.
+ (struct elf_backend_data <maybe_function_sym>): Likewise.
+
2012-02-02 Vidya Praveen (vidya.praveen@atmel.com)
PR bfd/13410
2012-02-02 Vidya Praveen (vidya.praveen@atmel.com)
PR bfd/13410
- * bfd/elf32-avr.c (elf32_avr_relax_section): Correct the
+ * bfd/elf32-avr.c (elf32_avr_relax_section): Correct the
condition that qualifies the candidates for relaxation.
2012-02-02 Tristan Gingold <gingold@adacore.com>
condition that qualifies the candidates for relaxation.
2012-02-02 Tristan Gingold <gingold@adacore.com>
* cpu-z8k.c: Likewise.
* cpu-i386.c: Include "libiberty.h".
* cpu-z8k.c: Likewise.
* cpu-i386.c: Include "libiberty.h".
- (bfd_arch_i386_fill): New.
+ (bfd_arch_i386_fill): New.
Add bfd_arch_i386_fill to bfd_arch_info initializer.
* cpu-k1om.c: Add bfd_arch_i386_fill to bfd_arch_info initializer.
* cpu-l1om.c: Likewise.
Add bfd_arch_i386_fill to bfd_arch_info initializer.
* cpu-k1om.c: Add bfd_arch_i386_fill to bfd_arch_info initializer.
* cpu-l1om.c: Likewise.
- * linker.c (default_data_link_order): Call abfd->arch_info->fill
+ * linker.c (default_data_link_order): Call abfd->arch_info->fill
if fill size is 0.
* bfd-in2.h: Regenerated.
if fill size is 0.
* bfd-in2.h: Regenerated.
/* Return TRUE if symbol may be a function. Set *CODE_SEC and *CODE_VAL
to the function's entry point. */
/* Return TRUE if symbol may be a function. Set *CODE_SEC and *CODE_VAL
to the function's entry point. */
- bfd_boolean (*maybe_function_sym) (const elf_symbol_type *sym,
+ bfd_boolean (*maybe_function_sym) (const asymbol *sym,
asection **code_sec, bfd_vma *code_off);
/* Used to handle bad SHF_LINK_ORDER input. */
asection **code_sec, bfd_vma *code_off);
/* Used to handle bad SHF_LINK_ORDER input. */
extern bfd_boolean _bfd_elf_is_function_type (unsigned int);
extern bfd_boolean _bfd_elf_is_function_type (unsigned int);
-extern bfd_boolean _bfd_elf_maybe_function_sym (const elf_symbol_type *,
+extern bfd_boolean _bfd_elf_maybe_function_sym (const asymbol *,
asection **, bfd_vma *);
extern int bfd_elf_get_default_section_type (flagword);
asection **, bfd_vma *);
extern int bfd_elf_get_default_section_type (flagword);
for (p = symbols; *p != NULL; p++)
{
for (p = symbols; *p != NULL; p++)
{
- elf_symbol_type *q;
- unsigned int type;
asection *code_sec;
bfd_vma code_off;
asection *code_sec;
bfd_vma code_off;
- q = (elf_symbol_type *) *p;
-
- type = ELF_ST_TYPE (q->internal_elf_sym.st_info);
- switch (type)
+ if ((sym->flags & BSF_FILE) != 0)
- case STT_FILE:
- file = &q->symbol;
if (state == symbol_seen)
state = file_after_symbol_seen;
continue;
if (state == symbol_seen)
state = file_after_symbol_seen;
continue;
- default:
- if (bed->maybe_function_sym (q, &code_sec, &code_off)
- && code_sec == section
- && code_off >= low_func
- && code_off <= offset)
- {
- func = (asymbol *) q;
- low_func = code_off;
- filename = NULL;
- if (file != NULL
- && (ELF_ST_BIND (q->internal_elf_sym.st_info) == STB_LOCAL
- || state != file_after_symbol_seen))
- filename = bfd_asymbol_name (file);
- }
- break;
+ }
+
+ if (bed->maybe_function_sym (sym, &code_sec, &code_off)
+ && code_sec == section
+ && code_off >= low_func
+ && code_off <= offset)
+ {
+ func = sym;
+ low_func = code_off;
+ filename = NULL;
+ if (file != NULL
+ && ((sym->flags & BSF_LOCAL) != 0
+ || state != file_after_symbol_seen))
+ filename = bfd_asymbol_name (file);
}
if (state == nothing_seen)
state = symbol_seen;
}
if (state == nothing_seen)
state = symbol_seen;
and *CODE_OFF to the function's entry point. */
bfd_boolean
and *CODE_OFF to the function's entry point. */
bfd_boolean
-_bfd_elf_maybe_function_sym (const elf_symbol_type *sym,
+_bfd_elf_maybe_function_sym (const asymbol *sym,
asection **code_sec, bfd_vma *code_off)
{
asection **code_sec, bfd_vma *code_off)
{
- unsigned int type = ELF_ST_TYPE (sym->internal_elf_sym.st_info);
- if (type == STT_NOTYPE
- || type == STT_FUNC
- || type == STT_GNU_IFUNC)
- {
- *code_sec = sym->symbol.section;
- *code_off = sym->symbol.value;
- return TRUE;
- }
- return FALSE;
+ if ((sym->flags & (BSF_SECTION_SYM | BSF_FILE | BSF_OBJECT
+ | BSF_THREAD_LOCAL | BSF_RELC | BSF_SRELC)) != 0)
+ return FALSE;
+
+ *code_sec = sym->section;
+ *code_off = sym->value;
+ return TRUE;
and *CODE_OFF to the function's entry point. */
static bfd_boolean
and *CODE_OFF to the function's entry point. */
static bfd_boolean
-ppc64_elf_maybe_function_sym (const elf_symbol_type *sym,
+ppc64_elf_maybe_function_sym (const asymbol *sym,
asection **code_sec, bfd_vma *code_off)
{
if (_bfd_elf_maybe_function_sym (sym, code_sec, code_off))
{
asection **code_sec, bfd_vma *code_off)
{
if (_bfd_elf_maybe_function_sym (sym, code_sec, code_off))
{
- if (strcmp (sym->symbol.section->name, ".opd") == 0)
- opd_entry_value (sym->symbol.section, sym->symbol.value,
- code_sec, code_off);
+ if (strcmp (sym->section->name, ".opd") == 0)
+ opd_entry_value (sym->section, sym->value, code_sec, code_off);
return TRUE;
}
return FALSE;
return TRUE;
}
return FALSE;