📄 elf64-mips.c
字号:
false), /* pcrel_offset */ /* A 6 bit shift field. */ /* FIXME: This is not handled correctly; a special function is needed to put the most significant bit in the right place. */ HOWTO (R_MIPS_SHIFT6, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 6, /* bitsize */ false, /* pc_relative */ 6, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_SHIFT6", /* name */ true, /* partial_inplace */ 0, /* src_mask */ 0x000007c4, /* dst_mask */ false), /* pcrel_offset */ /* 64 bit relocation. */ HOWTO (R_MIPS_64, /* type */ 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_64", /* name */ true, /* partial_inplace */ 0, /* src_mask */ MINUS_ONE, /* dst_mask */ false), /* pcrel_offset */ /* Displacement in the global offset table. */ /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_GOT_DISP, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_GOT_DISP", /* name */ true, /* partial_inplace */ 0, /* src_mask */ 0x0000ffff, /* dst_mask */ false), /* pcrel_offset */ /* Displacement to page pointer in the global offset table. */ /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_GOT_PAGE, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_GOT_PAGE", /* name */ true, /* partial_inplace */ 0, /* src_mask */ 0x0000ffff, /* dst_mask */ false), /* pcrel_offset */ /* Offset from page pointer in the global offset table. */ /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_GOT_OFST, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_GOT_OFST", /* name */ true, /* partial_inplace */ 0, /* src_mask */ 0x0000ffff, /* dst_mask */ false), /* pcrel_offset */ /* High 16 bits of displacement in global offset table. */ /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_GOT_HI16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_GOT_HI16", /* name */ true, /* partial_inplace */ 0, /* src_mask */ 0x0000ffff, /* dst_mask */ false), /* pcrel_offset */ /* Low 16 bits of displacement in global offset table. */ /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_GOT_LO16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_GOT_LO16", /* name */ true, /* partial_inplace */ 0, /* src_mask */ 0x0000ffff, /* dst_mask */ false), /* pcrel_offset */ /* 64 bit substraction. */ /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_SUB, /* type */ 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_SUB", /* name */ true, /* partial_inplace */ 0, /* src_mask */ MINUS_ONE, /* dst_mask */ false), /* pcrel_offset */ /* Insert the addend as an instruction. */ /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_INSERT_A, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_INSERT_A", /* name */ false, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ /* Insert the addend as an instruction, and change all relocations to refer to the old instruction at the address. */ /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_INSERT_B, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_INSERT_B", /* name */ false, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ /* Delete a 32 bit instruction. */ /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_DELETE, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_DELETE", /* name */ false, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ /* Get the higher value of a 64 bit addend. */ /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_HIGHER, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_HIGHER", /* name */ true, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ false), /* pcrel_offset */ /* Get the highest value of a 64 bit addend. */ /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_HIGHEST, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_HIGHEST", /* name */ true, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ false), /* pcrel_offset */ /* High 16 bits of displacement in global offset table. */ /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_CALL_HI16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_CALL_HI16", /* name */ true, /* partial_inplace */ 0, /* src_mask */ 0x0000ffff, /* dst_mask */ false), /* pcrel_offset */ /* Low 16 bits of displacement in global offset table. */ /* FIXME: Not handled correctly. */ HOWTO (R_MIPS_CALL_LO16, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_CALL_LO16", /* name */ true, /* partial_inplace */ 0, /* src_mask */ 0x0000ffff, /* dst_mask */ false), /* pcrel_offset */ /* I'm not sure what the remaining relocs are, but they are defined on Irix 6. */ HOWTO (R_MIPS_SCN_DISP, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_SCN_DISP", /* name */ false, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ HOWTO (R_MIPS_REL16, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_REL16", /* name */ false, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ HOWTO (R_MIPS_ADD_IMMEDIATE, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_ADD_IMMEDIATE", /* name */ false, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ HOWTO (R_MIPS_PJUMP, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_PJUMP", /* name */ false, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ HOWTO (R_MIPS_RELGOT, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_RELGOT", /* name */ false, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ /* Protected jump conversion. This is an optimization hint. No relocation is required for correctness. */ HOWTO (R_MIPS_JALR, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ false, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_MIPS_JALR", /* name */ false, /* partial_inplace */ 0x00000000, /* src_mask */ 0x00000000, /* dst_mask */ false), /* pcrel_offset */};/* Swap in a MIPS 64-bit Rel reloc. */static voidmips_elf64_swap_reloc_in (abfd, src, dst) bfd *abfd; const Elf64_Mips_External_Rel *src; Elf64_Mips_Internal_Rel *dst;{ dst->r_offset = bfd_h_get_64 (abfd, (bfd_byte *) src->r_offset); dst->r_sym = bfd_h_get_32 (abfd, (bfd_byte *) src->r_sym); dst->r_ssym = bfd_h_get_8 (abfd, (bfd_byte *) src->r_ssym); dst->r_type3 = bfd_h_get_8 (abfd, (bfd_byte *) src->r_type3); dst->r_type2 = bfd_h_get_8 (abfd, (bfd_byte *) src->r_type2); dst->r_type = bfd_h_get_8 (abfd, (bfd_byte *) src->r_type);}/* Swap in a MIPS 64-bit Rela reloc. */static voidmips_elf64_swap_reloca_in (abfd, src, dst) bfd *abfd; const Elf64_Mips_External_Rela *src; Elf64_Mips_Internal_Rela *dst;{ dst->r_offset = bfd_h_get_64 (abfd, (bfd_byte *) src->r_offset); dst->r_sym = bfd_h_get_32 (abfd, (bfd_byte *) src->r_sym); dst->r_ssym = bfd_h_get_8 (abfd, (bfd_byte *) src->r_ssym); dst->r_type3 = bfd_h_get_8 (abfd, (bfd_byte *) src->r_type3); dst->r_type2 = bfd_h_get_8 (abfd, (bfd_byte *) src->r_type2); dst->r_type = bfd_h_get_8 (abfd, (bfd_byte *) src->r_type); dst->r_addend = bfd_h_get_signed_64 (abfd, (bfd_byte *) src->r_addend);}/* Swap out a MIPS 64-bit Rel reloc. */static voidmips_elf64_swap_reloc_out (abfd, src, dst) bfd *abfd; const Elf64_Mips_Internal_Rel *src; Elf64_Mips_External_Rel *dst;{ bfd_h_put_64 (abfd, src->r_offset, (bfd_byte *) dst->r_offset); bfd_h_put_32 (abfd, src->r_sym, (bfd_byte *) dst->r_sym); bfd_h_put_8 (abfd, src->r_ssym, (bfd_byte *) dst->r_ssym); bfd_h_put_8 (abfd, src->r_type3, (bfd_byte *) dst->r_type3); bfd_h_put_8 (abfd, src->r_type2, (bfd_byte *) dst->r_type2); bfd_h_put_8 (abfd, src->r_type, (bfd_byte *) dst->r_type);}/* Swap out a MIPS 64-bit Rela reloc. */static voidmips_elf64_swap_reloca_out (abfd, src, dst) bfd *abfd; const Elf64_Mips_Internal_Rela *src; Elf64_Mips_External_Rela *dst;{ bfd_h_put_64 (abfd, src->r_offset, (bfd_byte *) dst->r_offset); bfd_h_put_32 (abfd, src->r_sym, (bfd_byte *) dst->r_sym); bfd_h_put_8 (abfd, src->r_ssym, (bfd_byte *) dst->r_ssym); bfd_h_put_8 (abfd, src->r_type3, (bfd_byte *) dst->r_type3); bfd_h_put_8 (abfd, src->r_type2, (bfd_byte *) dst->r_type2); bfd_h_put_8 (abfd, src->r_type, (bfd_byte *) dst->r_type); bfd_h_put_64 (abfd, src->r_addend, (bfd_byte *) dst->r_addend);}/* Swap in a MIPS 64-bit Rel reloc. */static voidmips_elf64_be_swap_reloc_in (abfd, src, dst) bfd *abfd; const bfd_byte *src; Elf_Internal_Rel *dst;{ Elf64_Mips_Internal_Rel mirel; mips_elf64_swap_reloc_in (abfd, (const Elf64_Mips_External_Rel *) src, &mirel); dst[0].r_offset = mirel.r_offset; dst[0].r_info = ELF32_R_INFO (mirel.r_sym, mirel.r_type); dst[1].r_offset = mirel.r_offset; dst[1].r_info = ELF32_R_INFO (mirel.r_ssym, mirel.r_type2); dst[2].r_offset = mirel.r_offset; dst[2].r_info = ELF32_R_INFO (STN_UNDEF, mirel.r_type3);}/* Swap in a MIPS 64-bit Rela reloc. */static voidmips_elf64_be_swap_reloca_in (abfd, src, dst) bfd *abfd; const bfd_byte *src; Elf_Internal_Rela *dst;{ Elf64_Mips_Internal_Rela mirela; mips_elf64_swap_reloca_in (abfd,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -