diff options
| author | Ruslan Bukin <br@FreeBSD.org> | 2017-08-10 14:18:09 +0000 |
|---|---|---|
| committer | Ruslan Bukin <br@FreeBSD.org> | 2017-08-10 14:18:09 +0000 |
| commit | af19cc59ca5e72b70169feeaf5fca52b339edcf4 (patch) | |
| tree | b0b0535516d9d523be265cff31fec74e875b4f35 /lib/csu | |
| parent | 4c320ca0d6e471659e083473afe90d13b12dc0ab (diff) | |
Notes
Diffstat (limited to 'lib/csu')
| -rw-r--r-- | lib/csu/riscv/crt1.c | 7 | ||||
| -rw-r--r-- | lib/csu/riscv/crti.S | 13 |
2 files changed, 12 insertions, 8 deletions
diff --git a/lib/csu/riscv/crt1.c b/lib/csu/riscv/crt1.c index 0c3fbe656add..0905e84e7b58 100644 --- a/lib/csu/riscv/crt1.c +++ b/lib/csu/riscv/crt1.c @@ -1,7 +1,7 @@ /* LINTLIBRARY */ /*- * Copyright 1996-1998 John D. Polstra. - * Copyright (c) 2015 Ruslan Bukin <br@bsdpad.com> + * Copyright (c) 2015-2017 Ruslan Bukin <br@bsdpad.com> * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -64,7 +64,10 @@ __asm(" .text \n" " slli t0, a0, 3 \n" /* mult by arg size */ " add a2, a1, t0 \n" /* env is after argv */ " addi a2, a2, 8 \n" /* argv is null terminated */ -" lla gp, _gp \n" /* load global pointer */ +" .option push \n" +" .option norelax \n" +" lla gp, __global_pointer$\n" +" .option pop \n" " call __start"); void diff --git a/lib/csu/riscv/crti.S b/lib/csu/riscv/crti.S index df6027eee8b6..4aad1486c5c6 100644 --- a/lib/csu/riscv/crti.S +++ b/lib/csu/riscv/crti.S @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin <br@bsdpad.com> + * Copyright (c) 2015-2017 Ruslan Bukin <br@bsdpad.com> * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -35,12 +35,13 @@ #include <machine/asm.h> __FBSDID("$FreeBSD$"); -# this puts _gp into .dynsym, so symlook_obj can now find that (see reloc.c) - .weak _gp -_gp: +# this puts __global_pointer$ into .dynsym, so symlook_obj can now find that +# (see reloc.c) + .weak __global_pointer$ +__global_pointer$: .section .init,"ax",@progbits - .align 2 + .align 0 .globl _init .type _init,@function _init: @@ -48,7 +49,7 @@ _init: sd ra, 0(sp) .section .fini,"ax",@progbits - .align 2 + .align 0 .globl _fini .type _fini,@function _fini: |
