summaryrefslogtreecommitdiffstats
path: root/lib/csu/ia64/crt1.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csu/ia64/crt1.c')
-rw-r--r--lib/csu/ia64/crt1.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/csu/ia64/crt1.c b/lib/csu/ia64/crt1.c
index f8b02ab..b12b4f3 100644
--- a/lib/csu/ia64/crt1.c
+++ b/lib/csu/ia64/crt1.c
@@ -70,7 +70,14 @@ _start(char **ap,
char **argv;
char **env;
- __asm __volatile("movl gp=_GLOBAL_OFFSET_TABLE_");
+ /* Calculate gp */
+ __asm __volatile(" \
+ movl gp=@gprel(1f) ; \
+ ;; ; \
+ 1: mov r14=ip ; \
+ ;; ; \
+ sub gp=r14,gp ; \
+ ;; ");
argc = * (long *) ap;
argv = ap + 1;
OpenPOWER on IntegriCloud