aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2012-01-04 12:59:23 +0000
committerTristan Gingold <gingold@adacore.com>2012-01-04 12:59:23 +0000
commit71141310f5b64e62555792867496b1d580c582f0 (patch)
tree825a22c206780c2132bc75155078963f088770e7
parent8645ff697e0fb097d2b341d5d50dedddf30f9692 (diff)
downloadgdb-71141310f5b64e62555792867496b1d580c582f0.zip
gdb-71141310f5b64e62555792867496b1d580c582f0.tar.gz
gdb-71141310f5b64e62555792867496b1d580c582f0.tar.bz2
2012-01-04 Tristan Gingold <gingold@adacore.com>
* 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.
-rw-r--r--bfd/ChangeLog10
-rw-r--r--bfd/mach-o-x86-64.c35
2 files changed, 45 insertions, 0 deletions
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 <gingold@adacore.com>
+ * 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 <gingold@adacore.com>
+
* 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;