diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2019-04-19 09:19:23 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2019-04-19 09:19:23 +0000 |
commit | f690be6b981ffee6b364f8359f60d7f46cbc6a75 (patch) | |
tree | f39df8458269bc5f366e52d56ef0a4be12c1f62a /lib/csu/mips64 | |
parent | 006c40ffca12a26e3a47be1c111f0bbff412877e (diff) |
Work around a limitation of clang integrated assembler on mips64.
The assembler does not handle undeclared local symbols properly
and generates R_MIPS_CALL16 relocations where it should generate
local GOT references. For now, get along with the problem by
declaring local symbols where necessary.
OK kettenis@ guenther@
Diffstat (limited to 'lib/csu/mips64')
-rw-r--r-- | lib/csu/mips64/md_init.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/csu/mips64/md_init.h b/lib/csu/mips64/md_init.h index 4a5d6bbfce3..990c94cce7e 100644 --- a/lib/csu/mips64/md_init.h +++ b/lib/csu/mips64/md_init.h @@ -1,4 +1,4 @@ -/* $OpenBSD: md_init.h,v 1.16 2019/03/23 15:29:55 visa Exp $ */ +/* $OpenBSD: md_init.h,v 1.17 2019/04/19 09:19:22 visa Exp $ */ /*- * Copyright (c) 2001 Ross Harvey @@ -83,6 +83,7 @@ #define MD_SECT_CALL_FUNC(section, func) \ __asm (".section "#section", \"ax\" \n" \ + " .local " #func " \n" \ " jal " #func " \n" \ ".previous") @@ -101,6 +102,7 @@ " dsrl $a1, $sp, 4 \n" /* align stack on a */ \ " dsll $sp, $a1, 4 \n" /* 16 byte boundary */ \ " move $a1, $v0 \n" \ + " .local ___start \n" \ " dla $t9, ___start \n" \ " jr $t9 \n" \ " .end __start \n" \ @@ -134,6 +136,7 @@ " dsrl $a1, $sp, 4 \n" /* align stack on a */ \ " dsll $sp, $a1, 4 \n" /* 16 byte boundary */ \ " move $a1, $zero \n" \ + " .local ___start \n" \ " dla $t9, ___start \n" \ " jr $t9 \n" \ " .end __start \n" \ |