bounded by non-function labels.
+2000-01-27 Thomas de Lellis <tdel@wrs.com>
+
+ * elf32-arm.h (elf32_arm_get_symbol_type): If a symbol has the
+ STT_ARM_16BIT flag set, but it is not attached to a data object
+ return STT_ARM_16BIT so that it will be treated as code by the
+ disassembler.
+
2000-01-27 Alan Modra <alan@spri.levels.unisa.edu.au>
* coff-i386.c (i3coff_object_p): Remove prototype.
{
case R_ARM_PC24:
/* This one is a call from arm code. We need to look up
- the target of the call. If it is a thumb target, we
+ the target of the call. If it is a thumb target, we
insert glue. */
if (ELF_ST_TYPE(h->type) == STT_ARM_TFUNC)
case R_ARM_THM_PC22:
/* This one is a call from thumb code. We look
- up the target of the call. If it is not a thumb
+ up the target of the call. If it is not a thumb
target, we insert glue. */
if (ELF_ST_TYPE (h->type) != STT_ARM_TFUNC)
}
return true;
+
error_return:
if (free_relocs != NULL)
free (free_relocs);
free (free_contents);
if (free_extsyms != NULL)
free (free_extsyms);
+
return false;
-
}
/* The thumb form of a long branch is a bit finicky, because the offset
Elf_Internal_Sym * elf_sym;
int type;
{
- if (ELF_ST_TYPE (elf_sym->st_info) == STT_ARM_TFUNC)
- return ELF_ST_TYPE (elf_sym->st_info);
- else
- return type;
+ switch (ELF_ST_TYPE (elf_sym->st_info))
+ {
+ case STT_ARM_TFUNC:
+ return ELF_ST_TYPE (elf_sym->st_info);
+ break;
+ case STT_ARM_16BIT:
+ /* If the symbol is not an object, return the STT_ARM_16BIT flag.
+ This allows us to distinguish between data used by Thumb instructions
+ and non-data (which is probably code) inside Thumb regions of an
+ executable. */
+ if (type != STT_OBJECT)
+ return ELF_ST_TYPE (elf_sym->st_info);
+ break;
+ }
+
+ return type;
}
static asection *
+2000-01-27 Thomas de Lellis <tdel@windriver.com>
+
+ * config/tc-arm.c (armadjust_symtab): If the assembler is in
+ Thumb mode but the label seen was not declared as '.thumb_func'
+ then set the ST_INFO type to STT_ARM_16BIT mode. This allows
+ correct disassembly of Thumb code bounded by non function labels.
+
2000-01-27 Alan Modra <alan@spri.levels.unisa.edu.au>
* Makefile.am (MULTI_CFILES): Add config/e-i386aout.c
{
if (ARM_IS_THUMB (sym))
{
+ elf_sym = elf_symbol (symbol_get_bfdsym (sym));
+ bind = ELF_ST_BIND (elf_sym);
+
+ /* If it's a .thumb_func, declare it as so, else tag label as .code 16. */
if (THUMB_IS_FUNC (sym))
- {
- elf_sym = elf_symbol (symbol_get_bfdsym (sym));
- bind = ELF_ST_BIND (elf_sym);
- elf_sym->internal_elf_sym.st_info = ELF_ST_INFO (bind, STT_ARM_TFUNC);
- }
+ elf_sym->internal_elf_sym.st_info = ELF_ST_INFO (bind, STT_ARM_TFUNC);
+ else
+ elf_sym->internal_elf_sym.st_info = ELF_ST_INFO (bind, STT_ARM_16BIT);
}
}
#endif
+2000-01-27 Thomas de Lellis <tdel@windriver.com>
+
+ * arm.h (STT_ARM_TFUNC): Define in terms of STT_LOPROC.
+ (STT_ARM_16BIT): New flag. Denotes a label that was defined in
+ Thumb block but was does not identify a function.
+
2000-01-20 Nick Clifton <nickc@cygnus.com>
* common.h (EM_MCORE): Fix spelling of Motorola.
/* ARM ELF support for BFD.
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#define EF_APCS_26 0x08
#define EF_APCS_FLOAT 0x10
#define EF_PIC 0x20
-#define EF_ALIGN8 0x40 /* 8-bit structure alignment is in use */
+#define EF_ALIGN8 0x40 /* 8-bit structure alignment is in use. */
#define EF_NEW_ABI 0x80
#define EF_OLD_ABI 0x100
#define EF_SOFT_FLOAT 0x200
#define F_PIC EF_PIC
#define F_SOFT_FLOAT EF_SOFT_FLOAT
-/* Additional symbol types for Thumb */
-#define STT_ARM_TFUNC 0xd
+/* Additional symbol types for Thumb. */
+#define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */
+#define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */
-/* ARM-specific values for sh_flags */
-#define SHF_ENTRYSECT 0x10000000 /* Section contains an entry point */
-#define SHF_COMDEF 0x80000000 /* Section may be multiply defined in the input to a link step */
+/* ARM-specific values for sh_flags. */
+#define SHF_ENTRYSECT 0x10000000 /* Section contains an entry point. */
+#define SHF_COMDEF 0x80000000 /* Section may be multiply defined in the input to a link step. */
-/* ARM-specific program header flags */
-#define PF_ARM_SB 0x10000000 /* Segment contains the location addressed by the static base */
+/* ARM-specific program header flags. */
+#define PF_ARM_SB 0x10000000 /* Segment contains the location addressed by the static base. */
/* Relocation types. */
START_RELOC_NUMBERS (elf_arm_reloc_type)
FAKE_RELOC (LAST_INVALID_RELOC1, 99)
RELOC_NUMBER (R_ARM_GNU_VTENTRY, 100)
RELOC_NUMBER (R_ARM_GNU_VTINHERIT, 101)
- RELOC_NUMBER (R_ARM_THM_PC11, 102) /* cygnus extension to abi: thumb unconditional branch */
- RELOC_NUMBER (R_ARM_THM_PC9, 103) /* cygnus extension to abi: thumb conditional branch */
+ RELOC_NUMBER (R_ARM_THM_PC11, 102) /* Cygnus extension to abi: Thumb unconditional branch */
+ RELOC_NUMBER (R_ARM_THM_PC9, 103) /* Cygnus extension to abi: Thumb conditional branch */
FAKE_RELOC (FIRST_INVALID_RELOC2, 104)
FAKE_RELOC (LAST_INVALID_RELOC2, 248)
RELOC_NUMBER (R_ARM_RXPC25, 249)
+2000-01-27 Thomas de Lellis <tdel@windriver.com>
+
+ * arm-dis.c (printf_insn_big_arm): Treat ELF symbols with the
+ ARM_STT_16BIT flag as Thumb code symbols.
+
+ * arm-dis.c (printf_insn_little_arm): Ditto.
+
2000-01-25 Thomas de Lellis <tdel@windriver.com>
* arm-dis.c (printf_insn_thumb): Prevent double dumping
unsigned char b[4];
long given;
int status;
- coff_symbol_type * cs;
- elf_symbol_type * es;
int is_thumb;
if (info->disassembler_options)
{
parse_disassembler_options (info->disassembler_options);
- /* To avoid repeated parsing of this option, we remove it here. */
+ /* To avoid repeated parsing of the options, we remove it here. */
info->disassembler_options = NULL;
}
{
if (bfd_asymbol_flavour (*info->symbols) == bfd_target_coff_flavour)
{
+ coff_symbol_type * cs;
+
cs = coffsymbol (*info->symbols);
is_thumb = ( cs->native->u.syment.n_sclass == C_THUMBEXT
|| cs->native->u.syment.n_sclass == C_THUMBSTAT
}
else if (bfd_asymbol_flavour (*info->symbols) == bfd_target_elf_flavour)
{
+ elf_symbol_type * es;
+
es = *(elf_symbol_type **)(info->symbols);
- is_thumb = ELF_ST_TYPE (es->internal_elf_sym.st_info) ==
- STT_ARM_TFUNC;
+ is_thumb = (ELF_ST_TYPE (es->internal_elf_sym.st_info) == STT_ARM_TFUNC)
+ || (ELF_ST_TYPE (es->internal_elf_sym.st_info) == STT_ARM_16BIT);
}
}
unsigned char b[4];
long given;
int status;
- coff_symbol_type * cs;
- elf_symbol_type * es;
int is_thumb;
if (info->disassembler_options)
{
parse_disassembler_options (info->disassembler_options);
- /* To avoid repeated parsing of this option, we remove it here. */
+ /* To avoid repeated parsing of the options, we remove it here. */
info->disassembler_options = NULL;
}
{
if (bfd_asymbol_flavour (*info->symbols) == bfd_target_coff_flavour)
{
+ coff_symbol_type * cs;
+
cs = coffsymbol (*info->symbols);
is_thumb = ( cs->native->u.syment.n_sclass == C_THUMBEXT
|| cs->native->u.syment.n_sclass == C_THUMBSTAT
}
else if (bfd_asymbol_flavour (*info->symbols) == bfd_target_elf_flavour)
{
+ elf_symbol_type * es;
+
es = *(elf_symbol_type **)(info->symbols);
- is_thumb = ELF_ST_TYPE (es->internal_elf_sym.st_info) ==
- STT_ARM_TFUNC;
+ is_thumb = (ELF_ST_TYPE (es->internal_elf_sym.st_info) == STT_ARM_TFUNC)
+ || (ELF_ST_TYPE (es->internal_elf_sym.st_info) == STT_ARM_16BIT);
}
}