- /* start-sanitize-armelf */
/* 32-bit ELF support for ARM
Copyright 1993, 1995, 1998 Free Software Foundation, Inc.
PARAMS ((bfd *, bfd *));
static boolean elf32_arm_print_private_bfd_data
PARAMS ((bfd *, PTR));
+static int elf32_arm_get_symbol_type
+ PARAMS (( Elf_Internal_Sym *));
static struct bfd_link_hash_table *elf32_arm_link_hash_table_create
PARAMS ((bfd *));
char *tmp_name;
struct elf_link_hash_entry *myh;
struct elf32_arm_link_hash_table *hash_table;
+ char bind;
hash_table = elf32_arm_hash_table (link_info);
(struct bfd_link_hash_entry **) &myh);
/* If we mark it 'thumb', the disassembler will do a better job. */
- myh->other = C_THUMBEXTFUNC;
+ bind = ELF_ST_BIND (myh->type);
+ myh->type = ELF_ST_INFO (bind, STT_ARM_TFUNC);
free (tmp_name);
/* Here we have a bfd that is to be included on the link. We have a hook
to do reloc rummaging, before section sizes are nailed down. */
- /* _bfd_coff_get_external_symbols (abfd); */
-
globals = elf32_arm_hash_table (link_info);
BFD_ASSERT (globals != NULL);
for (; sec != NULL; sec = sec->next)
{
- struct internal_reloc *i;
- struct internal_reloc *rel;
if (sec->reloc_count == 0)
continue;
irel = (_bfd_elf32_link_read_relocs (abfd, sec, (PTR) NULL,
(Elf_Internal_Rela *) NULL, false));
- BFD_ASSERT (i != 0);
+ BFD_ASSERT (irel != 0);
irelend = irel + sec->reloc_count;
for (; irel < irelend; irel++)
the target of the call. If it is a thumb target, we
insert glue. */
- if (h->other == C_THUMBEXTFUNC)
+ if (ELF_ST_TYPE(h->type) == STT_ARM_TFUNC)
record_arm_to_thumb_glue (link_info, h);
break;
case R_ARM_THM_PC22:
- /* This one is a call from thumb code. We used to look
- for ARM_THUMB9 and ARM_THUMB12 as well. We need to look
- up the target of the call. If it is an arm target, we
- insert glue. If the symbol does not exist it will be
- given a class of C_EXT and so we will generate a stub
- for it. This is not really a problem, since the link
- is doomed anyway. */
+ /* This one is a call from thumb code. We look
+ up the target of the call. If it is not a thumb
+ target, we insert glue. */
- switch (h->other)
- {
- case C_EXT:
- case C_STAT:
- case C_LABEL:
- record_thumb_to_arm_glue (link_info, h);
- break;
- default:
- ;
- }
+ if (ELF_ST_TYPE (h->type) != STT_ARM_TFUNC)
+ record_thumb_to_arm_glue (link_info, h);
break;
default:
/* Arm B/BL instruction */
/* check for arm calling thumb function */
- if (sym_flags == C_THUMBSTATFUNC
- || sym_flags == C_THUMBEXTFUNC)
+ if (sym_flags == STT_ARM_TFUNC)
{
elf32_arm_to_thumb_stub (info, sym_name, input_bfd, output_bfd,
input_section, hit_data, sym_sec, offset, addend, value);
case R_ARM_ABS32:
value += addend;
- if (sym_flags == C_THUMBSTATFUNC
- || sym_flags == C_THUMBEXTFUNC)
+ if (sym_flags == STT_ARM_TFUNC)
value |= 1;
bfd_put_32 (input_bfd, value, hit_data);
return bfd_reloc_ok;
bfd_vma add;
bfd_signed_vma signed_add;
- if (sym_flags == C_EXT
- || sym_flags == C_STAT
- || sym_flags == C_LABEL)
+ /* If it's not a call to thumb, assume call to arm */
+ if (sym_flags != STT_ARM_TFUNC)
{
elf32_thumb_to_arm_stub (info, sym_name, input_bfd, output_bfd, input_section,
hit_data, sym_sec, offset, addend, value);
contents, rel->r_offset,
relocation, rel->r_addend,
info, sec, name,
- (h ? h->other : sym->st_other));
+ (h ? ELF_ST_TYPE (h->type) : ELF_ST_TYPE (sym->st_info)));
if (r != bfd_reloc_ok)
return true;
}
+static int
+elf32_arm_get_symbol_type (elf_sym)
+ Elf_Internal_Sym *elf_sym;
+{
+ return ELF_ST_TYPE(elf_sym->st_info);
+}
+
#define TARGET_LITTLE_SYM bfd_elf32_littlearm_vec
#define TARGET_LITTLE_NAME "elf32-littlearm"
#define bfd_elf32_bfd_set_private_flags elf32_arm_set_private_flags
#define bfd_elf32_bfd_print_private_bfd_data elf32_arm_print_private_bfd_data
#define bfd_elf32_bfd_link_hash_table_create elf32_arm_link_hash_table_create
-
+#define elf_backend_get_symbol_type elf32_arm_get_symbol_type
#define elf_symbol_leading_char '_'
#include "elf32-target.h"
-/* end-sanitize-armelf */