This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Committed: Add support for xc16c relocs to readelf.
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Fri, 20 Nov 2009 15:12:40 +0000
- Subject: Committed: Add support for xc16c relocs to readelf.
Hi Guys,
I am going to apply the patch below to add support for the relocs
generated by the xc16x assembler to readelf.
Cheers
Nick
binutils/ChangeLog
2009-11-20 Nick Clifton <nickc@redhat.com>
* readelf.c: Include xc16x.h.
(dump_relocations): Handle relocations for the xc16x target.
(get_machine_name): Accept EM_C166 for xc16x targets.
(is_32bit_abs_reloc): Add support for xc16c 32-bit absolute reloc.
(is_16bit_abs_reloc): Add support for xc16c 16-bit absolute reloc.
(is_none_reloc): Add support for xc16c null reloc.
Index: binutils/readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.470
diff -c -3 -p -r1.470 readelf.c
*** binutils/readelf.c 17 Nov 2009 16:31:48 -0000 1.470
--- binutils/readelf.c 20 Nov 2009 15:08:39 -0000
***************
*** 139,144 ****
--- 139,145 ----
#include "elf/v850.h"
#include "elf/vax.h"
#include "elf/x86-64.h"
+ #include "elf/xc16x.h"
#include "elf/xstormy16.h"
#include "elf/xtensa.h"
*************** dump_relocations (FILE * file,
*** 1221,1226 ****
--- 1222,1232 ----
case EM_RX:
rtype = elf_rx_reloc_type (type);
break;
+
+ case EM_XC16X:
+ case EM_C166:
+ rtype = elf_xc16x_reloc_type (type);
+ break;
}
if (rtype == NULL)
*************** get_machine_name (unsigned e_machine)
*** 1887,1892 ****
--- 1893,1899 ----
case EM_BLACKFIN: return "Analog Devices Blackfin";
case EM_NIOS32: return "Altera Nios";
case EM_ALTERA_NIOS2: return "Altera Nios II";
+ case EM_C166:
case EM_XC16X: return "Infineon Technologies xc16x";
case EM_CYGNUS_MEP: return "Toshiba MeP Media Engine";
case EM_CR16:
*************** is_32bit_abs_reloc (unsigned int reloc_t
*** 8094,8105 ****
case EM_X86_64:
case EM_L1OM:
return reloc_type == 10; /* R_X86_64_32. */
case EM_XSTORMY16:
return reloc_type == 1; /* R_XSTROMY16_32. */
case EM_XTENSA_OLD:
case EM_XTENSA:
return reloc_type == 1; /* R_XTENSA_32. */
-
default:
error (_("Missing knowledge of 32-bit reloc types used in DWARF sections of machine number %d\n"),
elf_header.e_machine);
--- 8101,8114 ----
case EM_X86_64:
case EM_L1OM:
return reloc_type == 10; /* R_X86_64_32. */
+ case EM_XC16X:
+ case EM_C166:
+ return reloc_type == 3; /* R_XC16C_ABS_32. */
case EM_XSTORMY16:
return reloc_type == 1; /* R_XSTROMY16_32. */
case EM_XTENSA_OLD:
case EM_XTENSA:
return reloc_type == 1; /* R_XTENSA_32. */
default:
error (_("Missing knowledge of 32-bit reloc types used in DWARF sections of machine number %d\n"),
elf_header.e_machine);
*************** is_16bit_abs_reloc (unsigned int reloc_t
*** 8267,8272 ****
--- 8276,8284 ----
case EM_ALTERA_NIOS2:
case EM_NIOS32:
return reloc_type == 9; /* R_NIOS_16. */
+ case EM_XC16X:
+ case EM_C166:
+ return reloc_type == 2; /* R_XC16C_ABS_16. */
default:
return FALSE;
}
*************** is_none_reloc (unsigned int reloc_type)
*** 8300,8305 ****
--- 8312,8319 ----
case EM_L1OM: /* R_X86_64_NONE. */
case EM_MN10300: /* R_MN10300_NONE. */
case EM_M32R: /* R_M32R_NONE. */
+ case EM_XC16X:
+ case EM_C166: /* R_XC16X_NONE. */
return reloc_type == 0;
case EM_XTENSA_OLD:
case EM_XTENSA: