From 71141310f5b64e62555792867496b1d580c582f0 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 4 Jan 2012 12:59:23 +0000 Subject: 2012-01-04 Tristan Gingold * mach-o-x86-64.c (bfd_mach_o_x86_64_swap_reloc_out): Handle BFD_RELOC_32, BFD_RELOC_MACH_O_X86_64_PCREL32_1, BFD_RELOC_MACH_O_X86_64_PCREL32_2, BFD_RELOC_MACH_O_X86_64_PCREL32_4, BFD_RELOC_MACH_O_X86_64_BRANCH32, BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, BFD_RELOC_MACH_O_X86_64_GOT. --- bfd/ChangeLog | 10 ++++++++++ bfd/mach-o-x86-64.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 4eac2d4..2328a47 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,15 @@ 2012-01-04 Tristan Gingold + * mach-o-x86-64.c (bfd_mach_o_x86_64_swap_reloc_out): Handle + BFD_RELOC_32, BFD_RELOC_MACH_O_X86_64_PCREL32_1, + BFD_RELOC_MACH_O_X86_64_PCREL32_2, + BFD_RELOC_MACH_O_X86_64_PCREL32_4, + BFD_RELOC_MACH_O_X86_64_BRANCH32, + BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, + BFD_RELOC_MACH_O_X86_64_GOT. + +2012-01-04 Tristan Gingold + * mach-o.h (bfd_mach_o_fvmlib_command): New structure. (bfd_mach_o_load_command): Add fvmlib field. diff --git a/bfd/mach-o-x86-64.c b/bfd/mach-o-x86-64.c index cc31a1c..48e51e2 100644 --- a/bfd/mach-o-x86-64.c +++ b/bfd/mach-o-x86-64.c @@ -224,21 +224,56 @@ bfd_mach_o_x86_64_swap_reloc_out (arelent *rel, bfd_mach_o_reloc_info *rinfo) rinfo->r_scattered = 0; switch (rel->howto->type) { + case BFD_RELOC_32: + rinfo->r_type = BFD_MACH_O_X86_64_RELOC_UNSIGNED; + rinfo->r_pcrel = 0; + rinfo->r_length = 2; + break; case BFD_RELOC_64: rinfo->r_type = BFD_MACH_O_X86_64_RELOC_UNSIGNED; rinfo->r_pcrel = 0; rinfo->r_length = 3; break; case BFD_RELOC_32_PCREL: + rinfo->r_type = BFD_MACH_O_X86_64_RELOC_SIGNED; + rinfo->r_pcrel = 1; + rinfo->r_length = 2; + break; + case BFD_RELOC_MACH_O_X86_64_PCREL32_1: + rinfo->r_type = BFD_MACH_O_X86_64_RELOC_SIGNED_1; + rinfo->r_pcrel = 1; + rinfo->r_length = 2; + break; + case BFD_RELOC_MACH_O_X86_64_PCREL32_2: + rinfo->r_type = BFD_MACH_O_X86_64_RELOC_SIGNED_2; + rinfo->r_pcrel = 1; + rinfo->r_length = 2; + break; + case BFD_RELOC_MACH_O_X86_64_PCREL32_4: + rinfo->r_type = BFD_MACH_O_X86_64_RELOC_SIGNED_4; + rinfo->r_pcrel = 1; + rinfo->r_length = 2; + break; + case BFD_RELOC_MACH_O_X86_64_BRANCH32: rinfo->r_type = BFD_MACH_O_X86_64_RELOC_BRANCH; rinfo->r_pcrel = 1; rinfo->r_length = 2; break; + case BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32: + rinfo->r_type = BFD_MACH_O_X86_64_RELOC_SUBTRACTOR; + rinfo->r_pcrel = 0; + rinfo->r_length = 2; + break; case BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64: rinfo->r_type = BFD_MACH_O_X86_64_RELOC_SUBTRACTOR; rinfo->r_pcrel = 0; rinfo->r_length = 3; break; + case BFD_RELOC_MACH_O_X86_64_GOT: + rinfo->r_type = BFD_MACH_O_X86_64_RELOC_GOT; + rinfo->r_pcrel = 1; + rinfo->r_length = 2; + break; case BFD_RELOC_MACH_O_X86_64_GOT_LOAD: rinfo->r_type = BFD_MACH_O_X86_64_RELOC_GOT_LOAD; rinfo->r_pcrel = 1; -- cgit v1.1