OSDN Git Service

Implement vtable jumps for x86-64.
authorbo <bo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 9 Jul 2001 09:34:43 +0000 (09:34 +0000)
committerbo <bo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 9 Jul 2001 09:34:43 +0000 (09:34 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43860 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/unix.h

index bd392ef..8e52cfc 100644 (file)
@@ -1,3 +1,7 @@
+2001-07-09  Bo Thorsen  <bo@suse.co.uk>
+
+       * config/i386/unix.h (ASM_OUTPUT_MI_THUNK): Fix x86-64 vtable support.
+
 2001-07-09  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * final.c (output_addr_const): Use target opening and
index 508d4c8..25dec9a 100644 (file)
@@ -106,7 +106,7 @@ do {                                                                            \
     xops[1] = gen_rtx_MEM (SImode, plus_constant (stack_pointer_rtx, 4));   \
   output_asm_insn ("add{l} {%0, %1|%1, %0}", xops);                        \
                                                                            \
-  if (flag_pic)                                                                    \
+  if (flag_pic && !TARGET_64BIT)                                           \
     {                                                                      \
       xops[0] = pic_offset_table_rtx;                                      \
       xops[1] = gen_label_rtx ();                                          \
@@ -124,6 +124,12 @@ do {                                                                           \
       asm_fprintf (FILE, "\tpop{l\t%%ebx|\t%%ebx}\n");                     \
       asm_fprintf (FILE, "\tjmp\t{*%%ecx|%%ecx}\n");                       \
     }                                                                      \
+  else if (flag_pic && TARGET_64BIT)                                       \
+    {                                                                      \
+      fprintf (FILE, "\tjmp *");                                           \
+      assemble_name (FILE, XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0));       \
+      fprintf (FILE, "@GOTPCREL(%RIP)\n");                                 \
+    }                                                                      \
   else                                                                     \
     {                                                                      \
       fprintf (FILE, "\tjmp ");                                                    \