summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn van Groningen2013-08-01 11:58:12 +0000
committerJohn van Groningen2013-08-01 11:58:12 +0000
commit60631883ddc23baaf6c6ecc23c36d03cf158072a (patch)
tree47f3a168be6ebc687ba4545dc820c74212ed2e5c
parentfix offsets in descriptors, for position independent code on linux (diff)
fix offsets in descriptors, for position independent code on linux
-rw-r--r--cgcode.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/cgcode.c b/cgcode.c
index 513bd2f..cbf4ee9 100644
--- a/cgcode.c
+++ b/cgcode.c
@@ -2522,11 +2522,13 @@ void code_eq_nulldesc (char descriptor_name[],int a_offset)
graph_2=g_load_id (0,graph_1);
#ifdef NEW_DESCRIPTORS
graph_5=g_load_des_id (-2,graph_2);
-# ifdef MACH_O64
+# ifdef MACH_O64
graph_5=g_lsl (g_load_i (4),graph_5);
-# else
+# elif defined (G_A64) && defined (LINUX)
+ graph_5=g_lsl (g_load_i (pic_flag ? 4 : 3),graph_5);
+# else
graph_5=g_lsl (g_load_i (3),graph_5);
-# endif
+# endif
graph_6=g_sub (graph_5,graph_2);
#else
graph_5=g_load_des_id (2-2,graph_2);
@@ -3873,6 +3875,8 @@ static void code_jmp_ap_ (int n_apply_args)
if (profile_function_label!=NULL)
# ifdef MACH_O64
i_jmp_id_profile (8-2,REGISTER_A2,0);
+# elif defined (G_A64) && defined (LINUX)
+ i_jmp_id_profile (pic_flag ? 8-2 : 4-2,REGISTER_A2,0);
# else
i_jmp_id_profile (4-2,REGISTER_A2,0);
# endif
@@ -3880,6 +3884,8 @@ static void code_jmp_ap_ (int n_apply_args)
# endif
# ifdef MACH_O64
i_jmp_id (8-2,REGISTER_A2,0);
+# elif defined (G_A64) && defined (LINUX)
+ i_jmp_id (pic_flag ? 8-2 : 4-2,REGISTER_A2,0);
# else
i_jmp_id (4-2,REGISTER_A2,0);
# endif