GNU Binutils with patches for OS216
Révision | d347c9df495036dcbe5bc710ac5a07079bdd59ad (tree) |
---|---|
l'heure | 2016-04-29 22:05:12 |
Auteur | Pitchumani Sivanupandi <pitchumani.s@atme...> |
Commiter | Nick Clifton |
Enhance readelf's recognition of AVR relocation types.
* readelf.c (is_32bit_pcrel_reloc): Return true if reloc is 32-bit
PC relocation for AVR target.
(is_none_reloc): Return true if reloc is any of AVR diff
relocations.
@@ -1,3 +1,10 @@ | ||
1 | +2016-04-29 Pitchumani Sivanupandi <pitchumani.s@atmel.com> | |
2 | + | |
3 | + * readelf.c (is_32bit_pcrel_reloc): Return true if reloc is 32-bit | |
4 | + PC relocation for AVR target. | |
5 | + (is_none_reloc): Return true if reloc is any of AVR diff | |
6 | + relocations. | |
7 | + | |
1 | 8 | 2016-04-29 Nick Clifton <nickc@redhat.com> |
2 | 9 | |
3 | 10 | PR 19938 |
@@ -11489,6 +11489,7 @@ target_specific_reloc_handling (Elf_Internal_Rela * reloc, | ||
11489 | 11489 | static bfd_boolean |
11490 | 11490 | is_32bit_abs_reloc (unsigned int reloc_type) |
11491 | 11491 | { |
11492 | + /* Please keep this table alpha-sorted for ease of visual lookup. */ | |
11492 | 11493 | switch (elf_header.e_machine) |
11493 | 11494 | { |
11494 | 11495 | case EM_386: |
@@ -11502,6 +11503,8 @@ is_32bit_abs_reloc (unsigned int reloc_type) | ||
11502 | 11503 | return reloc_type == 2; /* R_960_32. */ |
11503 | 11504 | case EM_AARCH64: |
11504 | 11505 | return reloc_type == 258; /* R_AARCH64_ABS32 */ |
11506 | + case EM_ADAPTEVA_EPIPHANY: | |
11507 | + return reloc_type == 3; | |
11505 | 11508 | case EM_ALPHA: |
11506 | 11509 | return reloc_type == 1; /* R_ALPHA_REFLONG. */ |
11507 | 11510 | case EM_ARC: |
@@ -11514,8 +11517,6 @@ is_32bit_abs_reloc (unsigned int reloc_type) | ||
11514 | 11517 | case EM_AVR_OLD: |
11515 | 11518 | case EM_AVR: |
11516 | 11519 | return reloc_type == 1; |
11517 | - case EM_ADAPTEVA_EPIPHANY: | |
11518 | - return reloc_type == 3; | |
11519 | 11520 | case EM_BLACKFIN: |
11520 | 11521 | return reloc_type == 0x12; /* R_byte4_data. */ |
11521 | 11522 | case EM_CRIS: |
@@ -11674,6 +11675,7 @@ static bfd_boolean | ||
11674 | 11675 | is_32bit_pcrel_reloc (unsigned int reloc_type) |
11675 | 11676 | { |
11676 | 11677 | switch (elf_header.e_machine) |
11678 | + /* Please keep this table alpha-sorted for ease of visual lookup. */ | |
11677 | 11679 | { |
11678 | 11680 | case EM_386: |
11679 | 11681 | case EM_IAMCU: |
@@ -11691,6 +11693,9 @@ is_32bit_pcrel_reloc (unsigned int reloc_type) | ||
11691 | 11693 | return reloc_type == 49; /* R_ARC_32_PCREL. */ |
11692 | 11694 | case EM_ARM: |
11693 | 11695 | return reloc_type == 3; /* R_ARM_REL32 */ |
11696 | + case EM_AVR_OLD: | |
11697 | + case EM_AVR: | |
11698 | + return reloc_type == 36; /* R_AVR_32_PCREL. */ | |
11694 | 11699 | case EM_MICROBLAZE: |
11695 | 11700 | return reloc_type == 2; /* R_MICROBLAZE_32_PCREL. */ |
11696 | 11701 | case EM_OR1K: |
@@ -11831,17 +11836,18 @@ is_24bit_abs_reloc (unsigned int reloc_type) | ||
11831 | 11836 | static bfd_boolean |
11832 | 11837 | is_16bit_abs_reloc (unsigned int reloc_type) |
11833 | 11838 | { |
11839 | + /* Please keep this table alpha-sorted for ease of visual lookup. */ | |
11834 | 11840 | switch (elf_header.e_machine) |
11835 | 11841 | { |
11836 | 11842 | case EM_ARC: |
11837 | 11843 | case EM_ARC_COMPACT: |
11838 | 11844 | case EM_ARC_COMPACT2: |
11839 | 11845 | return reloc_type == 2; /* R_ARC_16. */ |
11846 | + case EM_ADAPTEVA_EPIPHANY: | |
11847 | + return reloc_type == 5; | |
11840 | 11848 | case EM_AVR_OLD: |
11841 | 11849 | case EM_AVR: |
11842 | 11850 | return reloc_type == 4; /* R_AVR_16. */ |
11843 | - case EM_ADAPTEVA_EPIPHANY: | |
11844 | - return reloc_type == 5; | |
11845 | 11851 | case EM_CYGNUS_D10V: |
11846 | 11852 | case EM_D10V: |
11847 | 11853 | return reloc_type == 3; /* R_D10V_16. */ |
@@ -11855,6 +11861,12 @@ is_16bit_abs_reloc (unsigned int reloc_type) | ||
11855 | 11861 | case EM_M32C_OLD: |
11856 | 11862 | case EM_M32C: |
11857 | 11863 | return reloc_type == 1; /* R_M32C_16 */ |
11864 | + case EM_CYGNUS_MN10200: | |
11865 | + case EM_MN10200: | |
11866 | + return reloc_type == 2; /* R_MN10200_16. */ | |
11867 | + case EM_CYGNUS_MN10300: | |
11868 | + case EM_MN10300: | |
11869 | + return reloc_type == 2; /* R_MN10300_16. */ | |
11858 | 11870 | case EM_MSP430: |
11859 | 11871 | if (uses_msp430x_relocs ()) |
11860 | 11872 | return reloc_type == 2; /* R_MSP430_ABS16. */ |
@@ -11870,17 +11882,11 @@ is_16bit_abs_reloc (unsigned int reloc_type) | ||
11870 | 11882 | return reloc_type == 2; /* R_OR1K_16. */ |
11871 | 11883 | case EM_TI_C6000: |
11872 | 11884 | return reloc_type == 2; /* R_C6000_ABS16. */ |
11885 | + case EM_VISIUM: | |
11886 | + return reloc_type == 2; /* R_VISIUM_16. */ | |
11873 | 11887 | case EM_XC16X: |
11874 | 11888 | case EM_C166: |
11875 | 11889 | return reloc_type == 2; /* R_XC16C_ABS_16. */ |
11876 | - case EM_CYGNUS_MN10200: | |
11877 | - case EM_MN10200: | |
11878 | - return reloc_type == 2; /* R_MN10200_16. */ | |
11879 | - case EM_CYGNUS_MN10300: | |
11880 | - case EM_MN10300: | |
11881 | - return reloc_type == 2; /* R_MN10300_16. */ | |
11882 | - case EM_VISIUM: | |
11883 | - return reloc_type == 2; /* R_VISIUM_16. */ | |
11884 | 11890 | case EM_XGATE: |
11885 | 11891 | return reloc_type == 3; /* R_XGATE_16. */ |
11886 | 11892 | default: |
@@ -11896,44 +11902,53 @@ is_none_reloc (unsigned int reloc_type) | ||
11896 | 11902 | { |
11897 | 11903 | switch (elf_header.e_machine) |
11898 | 11904 | { |
11899 | - case EM_68K: /* R_68K_NONE. */ | |
11900 | 11905 | case EM_386: /* R_386_NONE. */ |
11901 | - case EM_SPARC32PLUS: | |
11902 | - case EM_SPARCV9: | |
11903 | - case EM_SPARC: /* R_SPARC_NONE. */ | |
11904 | - case EM_MIPS: /* R_MIPS_NONE. */ | |
11905 | - case EM_PARISC: /* R_PARISC_NONE. */ | |
11906 | - case EM_ALPHA: /* R_ALPHA_NONE. */ | |
11906 | + case EM_68K: /* R_68K_NONE. */ | |
11907 | 11907 | case EM_ADAPTEVA_EPIPHANY: |
11908 | - case EM_PPC: /* R_PPC_NONE. */ | |
11909 | - case EM_PPC64: /* R_PPC64_NONE. */ | |
11908 | + case EM_ALPHA: /* R_ALPHA_NONE. */ | |
11909 | + case EM_ALTERA_NIOS2: /* R_NIOS2_NONE. */ | |
11910 | 11910 | case EM_ARC: /* R_ARC_NONE. */ |
11911 | - case EM_ARC_COMPACT: /* R_ARC_NONE. */ | |
11912 | 11911 | case EM_ARC_COMPACT2: /* R_ARC_NONE. */ |
11912 | + case EM_ARC_COMPACT: /* R_ARC_NONE. */ | |
11913 | 11913 | case EM_ARM: /* R_ARM_NONE. */ |
11914 | - case EM_IA_64: /* R_IA64_NONE. */ | |
11915 | - case EM_SH: /* R_SH_NONE. */ | |
11916 | - case EM_S390_OLD: | |
11917 | - case EM_S390: /* R_390_NONE. */ | |
11914 | + case EM_C166: /* R_XC16X_NONE. */ | |
11918 | 11915 | case EM_CRIS: /* R_CRIS_NONE. */ |
11919 | - case EM_X86_64: /* R_X86_64_NONE. */ | |
11920 | - case EM_L1OM: /* R_X86_64_NONE. */ | |
11916 | + case EM_FT32: /* R_FT32_NONE. */ | |
11917 | + case EM_IA_64: /* R_IA64_NONE. */ | |
11921 | 11918 | case EM_K1OM: /* R_X86_64_NONE. */ |
11919 | + case EM_L1OM: /* R_X86_64_NONE. */ | |
11920 | + case EM_M32R: /* R_M32R_NONE. */ | |
11921 | + case EM_MIPS: /* R_MIPS_NONE. */ | |
11922 | 11922 | case EM_MN10300: /* R_MN10300_NONE. */ |
11923 | - case EM_FT32: /* R_FT32_NONE. */ | |
11924 | 11923 | case EM_MOXIE: /* R_MOXIE_NONE. */ |
11925 | - case EM_M32R: /* R_M32R_NONE. */ | |
11926 | - case EM_TI_C6000:/* R_C6000_NONE. */ | |
11924 | + case EM_NIOS32: /* R_NIOS_NONE. */ | |
11925 | + case EM_OR1K: /* R_OR1K_NONE. */ | |
11926 | + case EM_PARISC: /* R_PARISC_NONE. */ | |
11927 | + case EM_PPC64: /* R_PPC64_NONE. */ | |
11928 | + case EM_PPC: /* R_PPC_NONE. */ | |
11929 | + case EM_S390: /* R_390_NONE. */ | |
11930 | + case EM_S390_OLD: | |
11931 | + case EM_SH: /* R_SH_NONE. */ | |
11932 | + case EM_SPARC32PLUS: | |
11933 | + case EM_SPARC: /* R_SPARC_NONE. */ | |
11934 | + case EM_SPARCV9: | |
11927 | 11935 | case EM_TILEGX: /* R_TILEGX_NONE. */ |
11928 | 11936 | case EM_TILEPRO: /* R_TILEPRO_NONE. */ |
11937 | + case EM_TI_C6000:/* R_C6000_NONE. */ | |
11938 | + case EM_X86_64: /* R_X86_64_NONE. */ | |
11929 | 11939 | case EM_XC16X: |
11930 | - case EM_C166: /* R_XC16X_NONE. */ | |
11931 | - case EM_ALTERA_NIOS2: /* R_NIOS2_NONE. */ | |
11932 | - case EM_NIOS32: /* R_NIOS_NONE. */ | |
11933 | - case EM_OR1K: /* R_OR1K_NONE. */ | |
11934 | 11940 | return reloc_type == 0; |
11941 | + | |
11935 | 11942 | case EM_AARCH64: |
11936 | 11943 | return reloc_type == 0 || reloc_type == 256; |
11944 | + case EM_AVR_OLD: | |
11945 | + case EM_AVR: | |
11946 | + return (reloc_type == 0 /* R_AVR_NONE. */ | |
11947 | + || reloc_type == 30 /* R_AVR_DIFF8. */ | |
11948 | + || reloc_type == 31 /* R_AVR_DIFF16. */ | |
11949 | + || reloc_type == 32 /* R_AVR_DIFF32. */); | |
11950 | + case EM_METAG: | |
11951 | + return reloc_type == 3; /* R_METAG_NONE. */ | |
11937 | 11952 | case EM_NDS32: |
11938 | 11953 | return (reloc_type == 0 /* R_XTENSA_NONE. */ |
11939 | 11954 | || reloc_type == 204 /* R_NDS32_DIFF8. */ |
@@ -11946,8 +11961,6 @@ is_none_reloc (unsigned int reloc_type) | ||
11946 | 11961 | || reloc_type == 17 /* R_XTENSA_DIFF8. */ |
11947 | 11962 | || reloc_type == 18 /* R_XTENSA_DIFF16. */ |
11948 | 11963 | || reloc_type == 19 /* R_XTENSA_DIFF32. */); |
11949 | - case EM_METAG: | |
11950 | - return reloc_type == 3; /* R_METAG_NONE. */ | |
11951 | 11964 | } |
11952 | 11965 | return FALSE; |
11953 | 11966 | } |