diff options
Diffstat (limited to 'sysdeps/sparc')
-rw-r--r-- | sysdeps/sparc/DEFS.h | 10 | ||||
-rwxr-xr-x | sysdeps/sparc/configure | 2 | ||||
-rw-r--r-- | sysdeps/sparc/configure.in | 2 | ||||
-rw-r--r-- | sysdeps/sparc/dl-machine.h | 3 | ||||
-rw-r--r-- | sysdeps/sparc/setjmp.S | 9 |
5 files changed, 19 insertions, 7 deletions
diff --git a/sysdeps/sparc/DEFS.h b/sysdeps/sparc/DEFS.h index ef6966319f..ab70f5550e 100644 --- a/sysdeps/sparc/DEFS.h +++ b/sysdeps/sparc/DEFS.h @@ -1,4 +1,12 @@ -#define FUNC(name) \ +#ifdef HAVE_ELF +# define FUNC(name) \ + .global name; \ + .type name,@function; \ + .align 4; \ + name: +#else +# define FUNC(name) \ .global name; \ .align 4; \ name: +#endif diff --git a/sysdeps/sparc/configure b/sysdeps/sparc/configure index 56168677a2..a8f815a577 100755 --- a/sysdeps/sparc/configure +++ b/sysdeps/sparc/configure @@ -1,4 +1,4 @@ # Local configure fragment for sysdeps/sparc. # The assembler on SPARC needs the -fPIC flag even when it's assembler code. -ASFLAGS_SO = -fPIC +ASFLAGS_SO=-fPIC diff --git a/sysdeps/sparc/configure.in b/sysdeps/sparc/configure.in index 3e2b2f04f9..e71a7e30fa 100644 --- a/sysdeps/sparc/configure.in +++ b/sysdeps/sparc/configure.in @@ -3,4 +3,4 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # Local configure fragment for sysdeps/sparc. # The assembler on SPARC needs the -fPIC flag even when it's assembler code. -ASFLAGS_SO = -fPIC +ASFLAGS_SO=-fPIC diff --git a/sysdeps/sparc/dl-machine.h b/sysdeps/sparc/dl-machine.h index 6f1d7eb02e..e87f1970e7 100644 --- a/sysdeps/sparc/dl-machine.h +++ b/sysdeps/sparc/dl-machine.h @@ -26,7 +26,7 @@ /* Some SPARC opcodes we need to use for self-modifying code. */ #define OPCODE_NOP 0x01000000 /* nop */ -#define OPCODE_CALL 0x04000000 /* call ?; add PC-rel word address */ +#define OPCODE_CALL 0x40000000 /* call ?; add PC-rel word address */ #define OPCODE_SETHI_G1 0x03000000 /* sethi ?, %g1; add value>>10 */ #define OPCODE_JMP_G1 0x81c06000 /* jmp %g1+?; add lo 10 bits of value */ #define OPCODE_SAVE_SP64 0x9de3bfc0 /* save %sp, -64, %sp */ @@ -262,6 +262,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy) .globl _dl_runtime_resolve .type _dl_runtime_resolve, @function _dl_runtime_resolve: + t 1 #call %g0 # Pass two args to fixup: the PLT address computed from the PC saved # in the PLT's call insn, and the reloc offset passed in %g1. diff --git a/sysdeps/sparc/setjmp.S b/sysdeps/sparc/setjmp.S index d9599079c2..f07a348fe3 100644 --- a/sysdeps/sparc/setjmp.S +++ b/sysdeps/sparc/setjmp.S @@ -26,16 +26,19 @@ ENTRY (__sigsetjmp) return PC. Save the signal mask if requested with a tail-call for simplicity; it always returns zero. */ #ifdef PIC + mov %o7,%g1 2: - jmpl 1f,%g2 + call 1f nop 1: sethi %hi(_GLOBAL_OFFSET_TABLE_-(2b-.)),%l7 - sethi %hi(C_SYMBOL_NAME (__sigjmp_save)), %g3 - st %sp, [%o0 + (JB_SP * 4)] or %l7,%lo(_GLOBAL_OFFSET_TABLE_-(2b-.)),%l7 + add %l7,%o7,%l7 + sethi %hi(C_SYMBOL_NAME (__sigjmp_save)), %g3 or %g3,%lo(C_SYMBOL_NAME (__sigjmp_save)), %g3 + st %sp, [%o0 + (JB_SP * 4)] st %fp, [%o0 + (JB_FP * 4)] + mov %g1,%o7 ld [%l7+%g3],%g1 jmp %g1 st %o7, [%o0+(JB_PC*4)] |