X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=opcodes%2Farc-ext.c;h=04587bdf5d2d85418203829cf3d2afcdf275bf51;hb=7992accc6e5dc674ab209397acc1d840f869c326;hp=f7d2191f8d205a20d0adb846ea65eb586d01baf5;hpb=945e0f82dad31db89a107b496532886fe215c011;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/arc-ext.c b/opcodes/arc-ext.c index f7d2191f8d..04587bdf5d 100644 --- a/opcodes/arc-ext.c +++ b/opcodes/arc-ext.c @@ -1,5 +1,5 @@ /* ARC target-dependent stuff. Extension structure access functions - Copyright (C) 1995-2016 Free Software Foundation, Inc. + Copyright (C) 1995-2021 Free Software Foundation, Inc. This file is part of libopcodes. @@ -53,16 +53,16 @@ struct ExtAuxRegister { - long address; - char* name; - struct ExtAuxRegister* next; + unsigned address; + char * name; + struct ExtAuxRegister * next; }; struct ExtCoreRegister { short number; enum ExtReadWrite rw; - char* name; + char * name; }; struct arcExtMap @@ -70,7 +70,7 @@ struct arcExtMap struct ExtAuxRegister* auxRegisters; struct ExtInstruction* instructions[INST_HASH_SIZE]; struct ExtCoreRegister coreRegisters[NUM_EXT_CORE]; - char* condCodes[NUM_EXT_COND]; + char * condCodes[NUM_EXT_COND]; }; @@ -170,6 +170,7 @@ create_map (unsigned char *block, arc_extension_map. coreRegisters[number - FIRST_EXTENSION_CORE_REGISTER].name = xstrdup (name); + break; } case EXT_COND_CODE: @@ -190,8 +191,8 @@ create_map (unsigned char *block, char *aux_name = xstrdup ((char *) (p + 6)); newAuxRegister->name = aux_name; - newAuxRegister->address = (p[2] << 24) | (p[3] << 16) - | (p[4] << 8) | p[5]; + newAuxRegister->address = (((unsigned) p[2] << 24) | (p[3] << 16) + | (p[4] << 8) | p[5]); newAuxRegister->next = arc_extension_map.auxRegisters; arc_extension_map.auxRegisters = newAuxRegister; break; @@ -244,17 +245,11 @@ destroy_map (void) /* Free core registers. */ for (i = 0; i < NUM_EXT_CORE; i++) - { - if (arc_extension_map.coreRegisters[i].name) - free (arc_extension_map.coreRegisters[i].name); - } + free (arc_extension_map.coreRegisters[i].name); /* Free condition codes. */ for (i = 0; i < NUM_EXT_COND; i++) - { - if (arc_extension_map.condCodes[i]) - free (arc_extension_map.condCodes[i]); - } + free (arc_extension_map.condCodes[i]); memset (&arc_extension_map, 0, sizeof (arc_extension_map)); } @@ -279,7 +274,7 @@ ExtReadWrite_image (enum ExtReadWrite val) /* Get the name of an extension instruction. */ const extInstruction_t * -arcExtMap_insn (int opcode, int insn) +arcExtMap_insn (int opcode, unsigned long long insn) { /* Here the following tasks need to be done. First of all, the opcode stored in the Extension Map is the real opcode. However, @@ -405,7 +400,7 @@ arcExtMap_condCodeName (int code) /* Get the name of an extension auxiliary register. */ const char * -arcExtMap_auxRegName (long address) +arcExtMap_auxRegName (unsigned address) { /* Walk the list of auxiliary register names and find the name. */ struct ExtAuxRegister *r; @@ -437,7 +432,7 @@ build_ARC_extmap (bfd *text_bfd) sizeof (".gnu.linkonce.arcextmap.") - 1) || !strcmp (sect->name,".arcextmap")) { - bfd_size_type count = bfd_get_section_size (sect); + bfd_size_type count = bfd_section_size (sect); unsigned char* buffer = xmalloc (count); if (buffer) @@ -462,7 +457,7 @@ dump_ARC_extmap (void) while (r) { - printf ("AUX : %s %ld\n", r->name, r->address); + printf ("AUX : %s %u\n", r->name, r->address); r = r->next; }