From 44a72f51d94cd196480a753edc9c982f651f7f76 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 20 Nov 2009 15:13:17 +0000 Subject: [PATCH] * 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. --- binutils/ChangeLog | 9 +++++++++ binutils/readelf.c | 16 +++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 586c3fbec..6eb215432 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,12 @@ +2009-11-20 Nick Clifton + + * 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. + 2009-11-20 Ben Elliston * Makefile.am (syslex.o): Use $(NO_WERROR) not -Wno-error. diff --git a/binutils/readelf.c b/binutils/readelf.c index 1fdde3b55..1d3332ea1 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -139,6 +139,7 @@ #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" @@ -1221,6 +1222,11 @@ dump_relocations (FILE * file, 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) @@ -1887,6 +1893,7 @@ get_machine_name (unsigned e_machine) 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: @@ -8094,12 +8101,14 @@ is_32bit_abs_reloc (unsigned int reloc_type) 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); @@ -8267,6 +8276,9 @@ is_16bit_abs_reloc (unsigned int reloc_type) 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; } @@ -8300,6 +8312,8 @@ is_none_reloc (unsigned int reloc_type) 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: -- 2.11.4.GIT