diff options
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 19 | ||||
-rw-r--r-- | binutils/MAINTAINERS | 1 | ||||
-rw-r--r-- | binutils/NEWS | 2 | ||||
-rw-r--r-- | binutils/readelf.c | 116 |
4 files changed, 136 insertions, 2 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 7f0fe94..cd76683 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,22 @@ +2010-03-25 Joseph Myers <joseph@codesourcery.com> + + * MAINTAINERS: Add self as TI C6X maintainer. + * NEWS: Add news entry for TI C6X support. + * readelf.c: Include elf/tic6x.h. + (guess_is_rela): Handle EM_TI_C6000. + (dump_relocations): Likewise. + (get_tic6x_dynamic_type): New. + (get_dynamic_type): Call it. + (get_machine_flags): Handle EF_C6000_REL. + (get_osabi_name): Handle machine-specific values only for relevant + machines. Handle C6X values. + (get_tic6x_segment_type): New. + (get_segment_type): Call it. + (get_tic6x_section_type_name): New. + (get_section_type_name): Call it. + (is_32bit_abs_reloc, is_16bit_abs_reloc, is_none_reloc): Handle + EM_TI_C6000. + 2010-03-25 Thomas Schwinge <thomas@codesourcery.com> * doc/binutils.texi (readelf) <unwind information>: Mention support for diff --git a/binutils/MAINTAINERS b/binutils/MAINTAINERS index 13312d2..ac199b4 100644 --- a/binutils/MAINTAINERS +++ b/binutils/MAINTAINERS @@ -114,6 +114,7 @@ responsibility among the other maintainers. SPU Alan Modra <amodra@gmail.com> TIC4X Svein Seldal <svein@dev.seldal.com> TIC54X Timothy Wall <twall@alum.mit.edu> + TIC6X Joseph Myers <joseph@codesourcery.com> VAX Matt Thomas <matt@netbsd.org> VAX Jan-Benedict Glaw <jbglaw@lug-owl.de> VMS Tristan Gingold <gingold@adacore.com> diff --git a/binutils/NEWS b/binutils/NEWS index 7f8c61d..92f894d 100644 --- a/binutils/NEWS +++ b/binutils/NEWS @@ -1,5 +1,7 @@ -*- text -*- +* Add support for the TMS320C6000 (TI C6X) processor family. + * Readelf can now display ARM unwind tables (.ARM.exidx / .ARM.extab) using the -u / --unwind option. diff --git a/binutils/readelf.c b/binutils/readelf.c index beaf947..ba4fd9b 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -137,6 +137,7 @@ #include "elf/sh.h" #include "elf/sparc.h" #include "elf/spu.h" +#include "elf/tic6x.h" #include "elf/v850.h" #include "elf/vax.h" #include "elf/x86-64.h" @@ -648,6 +649,7 @@ guess_is_rela (unsigned int e_machine) case EM_SPARC32PLUS: case EM_SPARCV9: case EM_SPU: + case EM_TI_C6000: case EM_V850: case EM_CYGNUS_V850: case EM_VAX: @@ -1261,6 +1263,10 @@ dump_relocations (FILE * file, case EM_C166: rtype = elf_xc16x_reloc_type (type); break; + + case EM_TI_C6000: + rtype = elf_tic6x_reloc_type (type); + break; } if (rtype == NULL) @@ -1638,6 +1644,21 @@ get_score_dynamic_type (unsigned long type) } } +static const char * +get_tic6x_dynamic_type (unsigned long type) +{ + switch (type) + { + case DT_C6000_GSYM_OFFSET: return "C6000_GSYM_OFFSET"; + case DT_C6000_GSTR_OFFSET: return "C6000_GSTR_OFFSET"; + case DT_C6000_DSBT_BASE: return "C6000_DSBT_BASE"; + case DT_C6000_DSBT_SIZE: return "C6000_DSBT_SIZE"; + case DT_C6000_PREEMPTMAP: return "C6000_PREEMPTMAP"; + case DT_C6000_DSBT_INDEX: return "C6000_DSBT_INDEX"; + default: + return NULL; + } +} static const char * get_dynamic_type (unsigned long type) @@ -1750,6 +1771,9 @@ get_dynamic_type (unsigned long type) case EM_SCORE: result = get_score_dynamic_type (type); break; + case EM_TI_C6000: + result = get_tic6x_dynamic_type (type); + break; default: result = NULL; break; @@ -2544,6 +2568,10 @@ get_machine_flags (unsigned e_flags, unsigned e_machine) case EM_S390: if (e_flags & EF_S390_HIGH_GPRS) strcat (buf, ", highgprs"); + + case EM_TI_C6000: + if ((e_flags & EF_C6000_REL)) + strcat (buf, ", relocatable module"); } } @@ -2573,9 +2601,42 @@ get_osabi_name (unsigned int osabi) case ELFOSABI_NSK: return "HP - Non-Stop Kernel"; case ELFOSABI_AROS: return "AROS"; case ELFOSABI_FENIXOS: return "FenixOS"; - case ELFOSABI_STANDALONE: return _("Standalone App"); - case ELFOSABI_ARM: return "ARM"; default: + if (osabi >= 64) + switch (elf_header.e_machine) + { + case EM_ARM: + switch (osabi) + { + case ELFOSABI_ARM: return "ARM"; + default: + break; + } + break; + + case EM_MSP430: + case EM_MSP430_OLD: + switch (osabi) + { + case ELFOSABI_STANDALONE: return _("Standalone App"); + default: + break; + } + break; + + case EM_TI_C6000: + switch (osabi) + { + case ELFOSABI_C6000_ELFABI: return _("Bare-metal C6000"); + case ELFOSABI_C6000_LINUX: return "Linux C6000"; + default: + break; + } + break; + + default: + break; + } snprintf (buff, sizeof (buff), _("<unknown: %x>"), osabi); return buff; } @@ -2663,6 +2724,19 @@ get_ia64_segment_type (unsigned long type) } static const char * +get_tic6x_segment_type (unsigned long type) +{ + switch (type) + { + case PT_C6000_PHATTR: return "C6000_PHATTR"; + default: + break; + } + + return NULL; +} + +static const char * get_segment_type (unsigned long p_type) { static char buff[32]; @@ -2703,6 +2777,9 @@ get_segment_type (unsigned long p_type) case EM_IA_64: result = get_ia64_segment_type (p_type); break; + case EM_TI_C6000: + result = get_tic6x_segment_type (p_type); + break; default: result = NULL; break; @@ -2864,6 +2941,33 @@ get_arm_section_type_name (unsigned int sh_type) } static const char * +get_tic6x_section_type_name (unsigned int sh_type) +{ + switch (sh_type) + { + case SHT_C6000_UNWIND: + return "C6000_UNWIND"; + case SHT_C6000_PREEMPTMAP: + return "C6000_PREEMPTMAP"; + case SHT_C6000_ATTRIBUTES: + return "C6000_ATTRIBUTES"; + case SHT_TI_ICODE: + return "TI_ICODE"; + case SHT_TI_XREF: + return "TI_XREF"; + case SHT_TI_HANDLER: + return "TI_HANDLER"; + case SHT_TI_INITINFO: + return "TI_INITINFO"; + case SHT_TI_PHATTRS: + return "TI_PHATTRS"; + default: + break; + } + return NULL; +} + +static const char * get_section_type_name (unsigned int sh_type) { static char buff[32]; @@ -2921,6 +3025,9 @@ get_section_type_name (unsigned int sh_type) case EM_ARM: result = get_arm_section_type_name (sh_type); break; + case EM_TI_C6000: + result = get_tic6x_section_type_name (sh_type); + break; default: result = NULL; break; @@ -8801,6 +8908,8 @@ is_32bit_abs_reloc (unsigned int reloc_type) || reloc_type == 23; /* R_SPARC_UA32. */ case EM_SPU: return reloc_type == 6; /* R_SPU_ADDR32 */ + case EM_TI_C6000: + return reloc_type == 1; /* R_C6000_ABS32. */ case EM_CYGNUS_V850: case EM_V850: return reloc_type == 6; /* R_V850_ABS32. */ @@ -8984,6 +9093,8 @@ is_16bit_abs_reloc (unsigned int reloc_type) case EM_ALTERA_NIOS2: case EM_NIOS32: return reloc_type == 9; /* R_NIOS_16. */ + case EM_TI_C6000: + return reloc_type == 2; /* R_C6000_ABS16. */ case EM_XC16X: case EM_C166: return reloc_type == 2; /* R_XC16C_ABS_16. */ @@ -9020,6 +9131,7 @@ 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_TI_C6000:/* R_C6000_NONE. */ case EM_XC16X: case EM_C166: /* R_XC16X_NONE. */ return reloc_type == 0; |