diff options
Diffstat (limited to 'bfd/elfxx-mips.c')
-rw-r--r-- | bfd/elfxx-mips.c | 224 |
1 files changed, 112 insertions, 112 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 92dd4c2..4b1ec67 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -787,14 +787,14 @@ static bfd *reldyn_sorting_bfd; /* True if ABFD is for CPUs with load interlocking that include non-MIPS1 CPUs and R3900. */ #define LOAD_INTERLOCKS_P(abfd) \ - ( ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) != E_MIPS_ARCH_1) \ - || ((elf_elfheader (abfd)->e_flags & EF_MIPS_MACH) == E_MIPS_MACH_3900)) + ( ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) != EF_MIPS_ARCH_1) \ + || ((elf_elfheader (abfd)->e_flags & EF_MIPS_MACH) == EF_MIPS_MACH_3900)) /* True if ABFD is for CPUs that are faster if JAL is converted to BAL. This should be safe for all architectures. We enable this predicate for RM9000 for now. */ #define JAL_TO_BAL_P(abfd) \ - ((elf_elfheader (abfd)->e_flags & EF_MIPS_MACH) == E_MIPS_MACH_9000) + ((elf_elfheader (abfd)->e_flags & EF_MIPS_MACH) == EF_MIPS_MACH_9000) /* True if ABFD is for CPUs that are faster if JALR is converted to BAL. This should be safe for all architectures. We enable this predicate for @@ -812,7 +812,7 @@ static bfd *reldyn_sorting_bfd; /* Nonzero if ABFD is using the O32 ABI. */ #define ABI_O32_P(abfd) \ - ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == E_MIPS_ABI_O32) + ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == EF_MIPS_ABI_O32) /* Nonzero if ABFD is using the N32 ABI. */ #define ABI_N32_P(abfd) \ @@ -831,8 +831,8 @@ static bfd *reldyn_sorting_bfd; /* Nonzero if ABFD is MIPS R6. */ #define MIPSR6_P(abfd) \ - ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32R6 \ - || (elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64R6) + ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_32R6 \ + || (elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_64R6) /* The IRIX compatibility level we are striving for. */ #define IRIX_COMPAT(abfd) \ @@ -6994,107 +6994,107 @@ _bfd_elf_mips_mach (flagword flags) { switch (flags & EF_MIPS_MACH) { - case E_MIPS_MACH_3900: + case EF_MIPS_MACH_3900: return bfd_mach_mips3900; - case E_MIPS_MACH_4010: + case EF_MIPS_MACH_4010: return bfd_mach_mips4010; - case E_MIPS_MACH_ALLEGREX: + case EF_MIPS_MACH_ALLEGREX: return bfd_mach_mips_allegrex; - case E_MIPS_MACH_4100: + case EF_MIPS_MACH_4100: return bfd_mach_mips4100; - case E_MIPS_MACH_4111: + case EF_MIPS_MACH_4111: return bfd_mach_mips4111; - case E_MIPS_MACH_4120: + case EF_MIPS_MACH_4120: return bfd_mach_mips4120; - case E_MIPS_MACH_4650: + case EF_MIPS_MACH_4650: return bfd_mach_mips4650; - case E_MIPS_MACH_5400: + case EF_MIPS_MACH_5400: return bfd_mach_mips5400; - case E_MIPS_MACH_5500: + case EF_MIPS_MACH_5500: return bfd_mach_mips5500; - case E_MIPS_MACH_5900: + case EF_MIPS_MACH_5900: return bfd_mach_mips5900; - case E_MIPS_MACH_9000: + case EF_MIPS_MACH_9000: return bfd_mach_mips9000; - case E_MIPS_MACH_SB1: + case EF_MIPS_MACH_SB1: return bfd_mach_mips_sb1; - case E_MIPS_MACH_LS2E: + case EF_MIPS_MACH_LS2E: return bfd_mach_mips_loongson_2e; - case E_MIPS_MACH_LS2F: + case EF_MIPS_MACH_LS2F: return bfd_mach_mips_loongson_2f; - case E_MIPS_MACH_GS464: + case EF_MIPS_MACH_GS464: return bfd_mach_mips_gs464; - case E_MIPS_MACH_GS464E: + case EF_MIPS_MACH_GS464E: return bfd_mach_mips_gs464e; - case E_MIPS_MACH_GS264E: + case EF_MIPS_MACH_GS264E: return bfd_mach_mips_gs264e; - case E_MIPS_MACH_OCTEON3: + case EF_MIPS_MACH_OCTEON3: return bfd_mach_mips_octeon3; - case E_MIPS_MACH_OCTEON2: + case EF_MIPS_MACH_OCTEON2: return bfd_mach_mips_octeon2; - case E_MIPS_MACH_OCTEON: + case EF_MIPS_MACH_OCTEON: return bfd_mach_mips_octeon; - case E_MIPS_MACH_XLR: + case EF_MIPS_MACH_XLR: return bfd_mach_mips_xlr; - case E_MIPS_MACH_IAMR2: + case EF_MIPS_MACH_IAMR2: return bfd_mach_mips_interaptiv_mr2; default: switch (flags & EF_MIPS_ARCH) { default: - case E_MIPS_ARCH_1: + case EF_MIPS_ARCH_1: return bfd_mach_mips3000; - case E_MIPS_ARCH_2: + case EF_MIPS_ARCH_2: return bfd_mach_mips6000; - case E_MIPS_ARCH_3: + case EF_MIPS_ARCH_3: return bfd_mach_mips4000; - case E_MIPS_ARCH_4: + case EF_MIPS_ARCH_4: return bfd_mach_mips8000; - case E_MIPS_ARCH_5: + case EF_MIPS_ARCH_5: return bfd_mach_mips5; - case E_MIPS_ARCH_32: + case EF_MIPS_ARCH_32: return bfd_mach_mipsisa32; - case E_MIPS_ARCH_64: + case EF_MIPS_ARCH_64: return bfd_mach_mipsisa64; - case E_MIPS_ARCH_32R2: + case EF_MIPS_ARCH_32R2: return bfd_mach_mipsisa32r2; - case E_MIPS_ARCH_64R2: + case EF_MIPS_ARCH_64R2: return bfd_mach_mipsisa64r2; - case E_MIPS_ARCH_32R6: + case EF_MIPS_ARCH_32R6: return bfd_mach_mipsisa32r6; - case E_MIPS_ARCH_64R6: + case EF_MIPS_ARCH_64R6: return bfd_mach_mipsisa64r6; } } @@ -7119,13 +7119,13 @@ elf_mips_abi_name (bfd *abfd) return "64"; else return "none"; - case E_MIPS_ABI_O32: + case EF_MIPS_ABI_O32: return "O32"; - case E_MIPS_ABI_O64: + case EF_MIPS_ABI_O64: return "O64"; - case E_MIPS_ABI_EABI32: + case EF_MIPS_ABI_EABI32: return "EABI32"; - case E_MIPS_ABI_EABI64: + case EF_MIPS_ABI_EABI64: return "EABI64"; default: return "unknown abi"; @@ -7280,7 +7280,7 @@ _bfd_mips_elf_eh_frame_address_size (bfd *abfd, const asection *sec) { if (elf_elfheader (abfd)->e_ident[EI_CLASS] == ELFCLASS64) return 8; - if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == E_MIPS_ABI_EABI64) + if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == EF_MIPS_ABI_EABI64) { bool long32_p, long64_p; @@ -12319,68 +12319,68 @@ mips_set_isa_flags (bfd *abfd) { default: if (ABI_N32_P (abfd) || ABI_64_P (abfd)) - val = MIPS_DEFAULT_R6 ? E_MIPS_ARCH_64R6 : E_MIPS_ARCH_3; + val = MIPS_DEFAULT_R6 ? EF_MIPS_ARCH_64R6 : EF_MIPS_ARCH_3; else - val = MIPS_DEFAULT_R6 ? E_MIPS_ARCH_32R6 : E_MIPS_ARCH_1; + val = MIPS_DEFAULT_R6 ? EF_MIPS_ARCH_32R6 : EF_MIPS_ARCH_1; break; case bfd_mach_mips3000: - val = E_MIPS_ARCH_1; + val = EF_MIPS_ARCH_1; break; case bfd_mach_mips3900: - val = E_MIPS_ARCH_1 | E_MIPS_MACH_3900; + val = EF_MIPS_ARCH_1 | EF_MIPS_MACH_3900; break; case bfd_mach_mips6000: - val = E_MIPS_ARCH_2; + val = EF_MIPS_ARCH_2; break; case bfd_mach_mips4010: - val = E_MIPS_ARCH_2 | E_MIPS_MACH_4010; + val = EF_MIPS_ARCH_2 | EF_MIPS_MACH_4010; break; case bfd_mach_mips_allegrex: - val = E_MIPS_ARCH_2 | E_MIPS_MACH_ALLEGREX; + val = EF_MIPS_ARCH_2 | EF_MIPS_MACH_ALLEGREX; break; case bfd_mach_mips4000: case bfd_mach_mips4300: case bfd_mach_mips4400: case bfd_mach_mips4600: - val = E_MIPS_ARCH_3; + val = EF_MIPS_ARCH_3; break; case bfd_mach_mips4100: - val = E_MIPS_ARCH_3 | E_MIPS_MACH_4100; + val = EF_MIPS_ARCH_3 | EF_MIPS_MACH_4100; break; case bfd_mach_mips4111: - val = E_MIPS_ARCH_3 | E_MIPS_MACH_4111; + val = EF_MIPS_ARCH_3 | EF_MIPS_MACH_4111; break; case bfd_mach_mips4120: - val = E_MIPS_ARCH_3 | E_MIPS_MACH_4120; + val = EF_MIPS_ARCH_3 | EF_MIPS_MACH_4120; break; case bfd_mach_mips4650: - val = E_MIPS_ARCH_3 | E_MIPS_MACH_4650; + val = EF_MIPS_ARCH_3 | EF_MIPS_MACH_4650; break; case bfd_mach_mips5400: - val = E_MIPS_ARCH_4 | E_MIPS_MACH_5400; + val = EF_MIPS_ARCH_4 | EF_MIPS_MACH_5400; break; case bfd_mach_mips5500: - val = E_MIPS_ARCH_4 | E_MIPS_MACH_5500; + val = EF_MIPS_ARCH_4 | EF_MIPS_MACH_5500; break; case bfd_mach_mips5900: - val = E_MIPS_ARCH_3 | E_MIPS_MACH_5900; + val = EF_MIPS_ARCH_3 | EF_MIPS_MACH_5900; break; case bfd_mach_mips9000: - val = E_MIPS_ARCH_4 | E_MIPS_MACH_9000; + val = EF_MIPS_ARCH_4 | EF_MIPS_MACH_9000; break; case bfd_mach_mips5000: @@ -12390,84 +12390,84 @@ mips_set_isa_flags (bfd *abfd) case bfd_mach_mips12000: case bfd_mach_mips14000: case bfd_mach_mips16000: - val = E_MIPS_ARCH_4; + val = EF_MIPS_ARCH_4; break; case bfd_mach_mips5: - val = E_MIPS_ARCH_5; + val = EF_MIPS_ARCH_5; break; case bfd_mach_mips_loongson_2e: - val = E_MIPS_ARCH_3 | E_MIPS_MACH_LS2E; + val = EF_MIPS_ARCH_3 | EF_MIPS_MACH_LS2E; break; case bfd_mach_mips_loongson_2f: - val = E_MIPS_ARCH_3 | E_MIPS_MACH_LS2F; + val = EF_MIPS_ARCH_3 | EF_MIPS_MACH_LS2F; break; case bfd_mach_mips_sb1: - val = E_MIPS_ARCH_64 | E_MIPS_MACH_SB1; + val = EF_MIPS_ARCH_64 | EF_MIPS_MACH_SB1; break; case bfd_mach_mips_gs464: - val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_GS464; + val = EF_MIPS_ARCH_64R2 | EF_MIPS_MACH_GS464; break; case bfd_mach_mips_gs464e: - val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_GS464E; + val = EF_MIPS_ARCH_64R2 | EF_MIPS_MACH_GS464E; break; case bfd_mach_mips_gs264e: - val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_GS264E; + val = EF_MIPS_ARCH_64R2 | EF_MIPS_MACH_GS264E; break; case bfd_mach_mips_octeon: case bfd_mach_mips_octeonp: - val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON; + val = EF_MIPS_ARCH_64R2 | EF_MIPS_MACH_OCTEON; break; case bfd_mach_mips_octeon3: - val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON3; + val = EF_MIPS_ARCH_64R2 | EF_MIPS_MACH_OCTEON3; break; case bfd_mach_mips_xlr: - val = E_MIPS_ARCH_64 | E_MIPS_MACH_XLR; + val = EF_MIPS_ARCH_64 | EF_MIPS_MACH_XLR; break; case bfd_mach_mips_octeon2: - val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON2; + val = EF_MIPS_ARCH_64R2 | EF_MIPS_MACH_OCTEON2; break; case bfd_mach_mipsisa32: - val = E_MIPS_ARCH_32; + val = EF_MIPS_ARCH_32; break; case bfd_mach_mipsisa64: - val = E_MIPS_ARCH_64; + val = EF_MIPS_ARCH_64; break; case bfd_mach_mipsisa32r2: case bfd_mach_mipsisa32r3: case bfd_mach_mipsisa32r5: - val = E_MIPS_ARCH_32R2; + val = EF_MIPS_ARCH_32R2; break; case bfd_mach_mips_interaptiv_mr2: - val = E_MIPS_ARCH_32R2 | E_MIPS_MACH_IAMR2; + val = EF_MIPS_ARCH_32R2 | EF_MIPS_MACH_IAMR2; break; case bfd_mach_mipsisa64r2: case bfd_mach_mipsisa64r3: case bfd_mach_mipsisa64r5: - val = E_MIPS_ARCH_64R2; + val = EF_MIPS_ARCH_64R2; break; case bfd_mach_mipsisa32r6: - val = E_MIPS_ARCH_32R6; + val = EF_MIPS_ARCH_32R6; break; case bfd_mach_mipsisa64r6: - val = E_MIPS_ARCH_64R6; + val = EF_MIPS_ARCH_64R6; break; } elf_elfheader (abfd)->e_flags &= ~(EF_MIPS_ARCH | EF_MIPS_MACH); @@ -14719,17 +14719,17 @@ update_mips_abiflags_isa (bfd *abfd, Elf_Internal_ABIFlags_v0 *abiflags) int new_isa = 0; switch (elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) { - case E_MIPS_ARCH_1: new_isa = LEVEL_REV (1, 0); break; - case E_MIPS_ARCH_2: new_isa = LEVEL_REV (2, 0); break; - case E_MIPS_ARCH_3: new_isa = LEVEL_REV (3, 0); break; - case E_MIPS_ARCH_4: new_isa = LEVEL_REV (4, 0); break; - case E_MIPS_ARCH_5: new_isa = LEVEL_REV (5, 0); break; - case E_MIPS_ARCH_32: new_isa = LEVEL_REV (32, 1); break; - case E_MIPS_ARCH_32R2: new_isa = LEVEL_REV (32, 2); break; - case E_MIPS_ARCH_32R6: new_isa = LEVEL_REV (32, 6); break; - case E_MIPS_ARCH_64: new_isa = LEVEL_REV (64, 1); break; - case E_MIPS_ARCH_64R2: new_isa = LEVEL_REV (64, 2); break; - case E_MIPS_ARCH_64R6: new_isa = LEVEL_REV (64, 6); break; + case EF_MIPS_ARCH_1: new_isa = LEVEL_REV (1, 0); break; + case EF_MIPS_ARCH_2: new_isa = LEVEL_REV (2, 0); break; + case EF_MIPS_ARCH_3: new_isa = LEVEL_REV (3, 0); break; + case EF_MIPS_ARCH_4: new_isa = LEVEL_REV (4, 0); break; + case EF_MIPS_ARCH_5: new_isa = LEVEL_REV (5, 0); break; + case EF_MIPS_ARCH_32: new_isa = LEVEL_REV (32, 1); break; + case EF_MIPS_ARCH_32R2: new_isa = LEVEL_REV (32, 2); break; + case EF_MIPS_ARCH_32R6: new_isa = LEVEL_REV (32, 6); break; + case EF_MIPS_ARCH_64: new_isa = LEVEL_REV (64, 1); break; + case EF_MIPS_ARCH_64R2: new_isa = LEVEL_REV (64, 2); break; + case EF_MIPS_ARCH_64R6: new_isa = LEVEL_REV (64, 6); break; default: _bfd_error_handler /* xgettext:c-format */ @@ -14755,13 +14755,13 @@ static bool mips_32bit_flags_p (flagword flags) { return ((flags & EF_MIPS_32BITMODE) != 0 - || (flags & EF_MIPS_ABI) == E_MIPS_ABI_O32 - || (flags & EF_MIPS_ABI) == E_MIPS_ABI_EABI32 - || (flags & EF_MIPS_ARCH) == E_MIPS_ARCH_1 - || (flags & EF_MIPS_ARCH) == E_MIPS_ARCH_2 - || (flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32 - || (flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32R2 - || (flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32R6); + || (flags & EF_MIPS_ABI) == EF_MIPS_ABI_O32 + || (flags & EF_MIPS_ABI) == EF_MIPS_ABI_EABI32 + || (flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_1 + || (flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_2 + || (flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_32 + || (flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_32R2 + || (flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_32R6); } /* Infer the content of the ABI flags based on the elf header. */ @@ -16372,13 +16372,13 @@ _bfd_mips_elf_print_private_bfd_data (bfd *abfd, void *ptr) /* xgettext:c-format */ fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags); - if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == E_MIPS_ABI_O32) + if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == EF_MIPS_ABI_O32) fprintf (file, _(" [abi=O32]")); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == E_MIPS_ABI_O64) + else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == EF_MIPS_ABI_O64) fprintf (file, _(" [abi=O64]")); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == E_MIPS_ABI_EABI32) + else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == EF_MIPS_ABI_EABI32) fprintf (file, _(" [abi=EABI32]")); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == E_MIPS_ABI_EABI64) + else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI) == EF_MIPS_ABI_EABI64) fprintf (file, _(" [abi=EABI64]")); else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI)) fprintf (file, _(" [abi unknown]")); @@ -16389,27 +16389,27 @@ _bfd_mips_elf_print_private_bfd_data (bfd *abfd, void *ptr) else fprintf (file, _(" [no abi set]")); - if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_1) + if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_1) fprintf (file, " [mips1]"); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_2) + else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_2) fprintf (file, " [mips2]"); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_3) + else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_3) fprintf (file, " [mips3]"); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_4) + else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_4) fprintf (file, " [mips4]"); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_5) + else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_5) fprintf (file, " [mips5]"); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32) + else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_32) fprintf (file, " [mips32]"); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64) + else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_64) fprintf (file, " [mips64]"); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32R2) + else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_32R2) fprintf (file, " [mips32r2]"); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64R2) + else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_64R2) fprintf (file, " [mips64r2]"); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32R6) + else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_32R6) fprintf (file, " [mips32r6]"); - else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64R6) + else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == EF_MIPS_ARCH_64R6) fprintf (file, " [mips64r6]"); else fprintf (file, _(" [unknown ISA]")); |