36 #include "libiberty.h"
53 #define FIRST_EXTENSION_CORE_REGISTER 32
54 #define LAST_EXTENSION_CORE_REGISTER 59
55 #define FIRST_EXTENSION_CONDITION_CODE 0x10
56 #define LAST_EXTENSION_CONDITION_CODE 0x1f
58 #define NUM_EXT_CORE (LAST_EXTENSION_CORE_REGISTER - FIRST_EXTENSION_CORE_REGISTER + 1)
59 #define NUM_EXT_COND (LAST_EXTENSION_CONDITION_CODE - FIRST_EXTENSION_CONDITION_CODE + 1)
60 #define INST_HASH_BITS 6
61 #define INST_HASH_SIZE (1 << INST_HASH_BITS)
62 #define INST_HASH_MASK (INST_HASH_SIZE - 1)
116 #define INST_HASH(MAJOR, MINOR) ((((MAJOR) << 3) ^ (MINOR)) & INST_HASH_MASK)
124 static void create_map(
unsigned char *block,
unsigned long length)
126 unsigned char *
p = block;
167 insn->
next = *bucket;
174 unsigned char number =
p[2];
175 char*
name = (
char *)
p+3;
185 unsigned char number =
p[2];
186 char*
name = (
char *)
p+7;
206 char *aux_name =
strdup ((
char *) (
p+6));
208 newAuxRegister->
name = aux_name;
209 newAuxRegister->
address =
p[2]<<24 |
p[3]<<16 |
p[4]<<8 |
p[5];
228 static void destroy_map(
void)
322 if (0x08 <= opcode && opcode <= 0x0b)
325 unsigned char b,
c,
i;
328 b = (insn & 0x0700) >> 8;
329 c = (insn & 0x00e0) >> 5;
342 unsigned char I,
A,
B;
346 I = (insn & 0x003f0000) >> 16;
347 A = (insn & 0x0000003f);
348 B = ((insn & 0x07000000) >> 24) | ((insn & 0x00007000) >> 9);
363 minor = (
I >> 1) | ((
I & 0x1) << 5);
366 minor = (
I >> 1) | (
I & 0x1) | ((
I & 0x2) << 4);
443 return (
const char *)
r->name;
463 for (sect = text_bfd->sections; sect !=
NULL; sect = sect->
next)
464 if (!strncmp (sect->
name,
465 ".gnu.linkonce.arcextmap.",
466 sizeof (
".gnu.linkonce.arcextmap.") - 1)
467 || !strcmp (sect->
name,
".arcextmap"))
492 printf(
"AUX : %s %ld\n",
r->name,
r->address);
static const char * cc_name(arm_cc cc)
const char * arcExtMap_auxRegName(long address)
#define LAST_EXTENSION_CORE_REGISTER
#define FIRST_EXTENSION_CONDITION_CODE
void dump_ARC_extmap(void)
const char * arcExtMap_instName(int opcode, int insn, int *flags)
#define LAST_EXTENSION_CONDITION_CODE
static const char * ExtReadWrite_image(enum ExtReadWrite val)
static struct arcExtMap arc_extension_map
const char * arcExtMap_condCodeName(int code)
const char * arcExtMap_coreRegName(int regnum)
#define INST_HASH(MAJOR, MINOR)
enum ExtReadWrite arcExtMap_coreReadWrite(int regnum)
#define FIRST_EXTENSION_CORE_REGISTER
void build_ARC_extmap(void *text_bfd)
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
BFD_HOST_U_64_BIT bfd_size_type
bfd_boolean bfd_get_section_contents(bfd *abfd, asection *section, void *location, file_ptr offset, bfd_size_type count)
#define bfd_get_section_size(ptr)
static struct sockaddr static addrlen static backlog const void static flags void flags
struct ExtAuxRegister * next
struct ExtInstruction * next
struct ExtCoreRegister coreRegisters[NUM_EXT_CORE]
struct ExtInstruction * instructions[INST_HASH_SIZE]
char * condCodes[NUM_EXT_COND]
struct ExtAuxRegister * auxRegisters
struct bfd_section * next