This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Use ldu in 64-bit Darwin stubs
- From: Stan Shebs <shebs at apple dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 05 Nov 2004 16:59:50 -0800
- Subject: Use ldu in 64-bit Darwin stubs
This patch is a small but key step in making PIC (-dynamic) codegen
work for 64-bit executables in Darwin 8.0 aka Tiger; it simply uses
an ldu instead of an lwzu to load up a register. With this, dynamic
executables have been observed to run, albeit in conjunction with
many other pieces not yet available to the general public, sorry.
Tested on powerpc-darwin and committed to trunk.
Stan
2004-11-05 Stan Shebs <shebs@apple.com>
* config/rs6000/rs6000.c (machopic_output_stub): Output
ldu instead of lwzu for 64-bit stubs.
Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.332.2.46.2.67
diff -p -r1.332.2.46.2.67 rs6000.c
*** rs6000.c 28 Oct 2004 23:51:18 -0000 1.332.2.46.2.67
--- rs6000.c 31 Oct 2004 22:03:42 -0000
*************** machopic_output_stub (FILE *file, const
*** 17931,17937 ****
fprintf (file, "\taddis r11,r11,ha16(%s-%s)\n",
lazy_ptr_name, local_label_0);
fprintf (file, "\tmtlr r0\n");
! fprintf (file, "\tlwzu r12,lo16(%s-%s)(r11)\n",
lazy_ptr_name, local_label_0);
fprintf (file, "\tmtctr r12\n");
fprintf (file, "\tbctr\n");
--- 17931,17938 ----
fprintf (file, "\taddis r11,r11,ha16(%s-%s)\n",
lazy_ptr_name, local_label_0);
fprintf (file, "\tmtlr r0\n");
! fprintf (file, "\t%s r12,lo16(%s-%s)(r11)\n",
! (TARGET_64BIT ? "ldu" : "lwzu"),
lazy_ptr_name, local_label_0);
fprintf (file, "\tmtctr r12\n");
fprintf (file, "\tbctr\n");