2002-09-20 23:46:03 +00:00
|
|
|
/* Assembly macros for 64-bit PowerPC.
|
2015-01-02 16:28:19 +00:00
|
|
|
Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
2002-09-20 23:46:03 +00:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
License along with the GNU C Library; if not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
2002-09-20 23:46:03 +00:00
|
|
|
|
|
|
|
#include <sysdeps/powerpc/sysdep.h>
|
|
|
|
|
Update.
2004-05-19 Paul Eggert <eggert@cs.ucla.edu>
* malloc/obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
obstack_alignment_mask, obstack_alloc, obstack_base,
obstack_blank, obstack_blank_fast, obstack_chunk_size,
obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
obstack_grow0, obstack_init, obstack_int_grow,
obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
obstack_next_free, obstack_object_size, obstack_ptr_grow,
obstack_ptr_grow_fast, obstack_room): Remove declarations of
nonexistent functions.
2004-05-18 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc64/sysdep.h [__ASSEMBLER__]: Include
<sysdeps/powerpc/sysdep.h> independent of __ASSEMBLER__.
[PIC]: Redundent for powerpc64, removed.
(ENTRY): Generate size and alignment for opd entry.
(EALIGN): Generate size and alignment for opd entry.
(END): Use DOT_LABEL in ASM_SIZE_DIRECTIVE.
(END_GEN_TB): Use DOT_LABEL in ASM_SIZE_DIRECTIVE.
2004-05-20 06:32:24 +00:00
|
|
|
#ifdef __ASSEMBLER__
|
|
|
|
|
PowerPC64 ELFv2 ABI 4/6: Stack frame layout changes
This updates glibc for the changes in the ELFv2 relating to the
stack frame layout. These are described in more detail here:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01149.html
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01146.html
Specifically, the "compiler and linker doublewords" were removed,
which has the effect that the save slot for the TOC register is
now at offset 24 rather than 40 to the stack pointer.
In addition, a function may now no longer necessarily assume that
its caller has set up a 64-byte register save area its use.
To address the first change, the patch goes through all assembler
files and replaces immediate offsets in instructions accessing the
ABI-defined stack slots by symbolic offsets. Those already were
defined in ucontext_i.sym and used in some of the context routines,
but that doesn't really seem like the right place for those defines.
The patch instead defines those symbolic offsets in sysdeps.h,
in two variants for the old and new ABI, and uses them systematically
in all assembler files, not just the context routines.
The second change only affected a few assembler files that used
the save area to temporarily store some registers. In those
cases where this happens within a leaf function, this patch
changes the code to store those registers to the "red zone"
below the stack pointer. Otherwise, the functions already allocate
a stack frame, and the patch changes them to add extra space in
these frames as temporary space for the ELFv2 ABI.
2013-12-04 12:55:03 +00:00
|
|
|
/* Stack frame offsets. */
|
|
|
|
#if _CALL_ELF != 2
|
|
|
|
#define FRAME_MIN_SIZE 112
|
|
|
|
#define FRAME_MIN_SIZE_PARM 112
|
|
|
|
#define FRAME_BACKCHAIN 0
|
|
|
|
#define FRAME_CR_SAVE 8
|
|
|
|
#define FRAME_LR_SAVE 16
|
|
|
|
#define FRAME_TOC_SAVE 40
|
|
|
|
#define FRAME_PARM_SAVE 48
|
|
|
|
#define FRAME_PARM1_SAVE 48
|
|
|
|
#define FRAME_PARM2_SAVE 56
|
|
|
|
#define FRAME_PARM3_SAVE 64
|
|
|
|
#define FRAME_PARM4_SAVE 72
|
|
|
|
#define FRAME_PARM5_SAVE 80
|
|
|
|
#define FRAME_PARM6_SAVE 88
|
|
|
|
#define FRAME_PARM7_SAVE 96
|
|
|
|
#define FRAME_PARM8_SAVE 104
|
|
|
|
#define FRAME_PARM9_SAVE 112
|
|
|
|
#else
|
|
|
|
#define FRAME_MIN_SIZE 32
|
|
|
|
#define FRAME_MIN_SIZE_PARM 96
|
|
|
|
#define FRAME_BACKCHAIN 0
|
|
|
|
#define FRAME_CR_SAVE 8
|
|
|
|
#define FRAME_LR_SAVE 16
|
|
|
|
#define FRAME_TOC_SAVE 24
|
|
|
|
#define FRAME_PARM_SAVE 32
|
|
|
|
#define FRAME_PARM1_SAVE 32
|
|
|
|
#define FRAME_PARM2_SAVE 40
|
|
|
|
#define FRAME_PARM3_SAVE 48
|
|
|
|
#define FRAME_PARM4_SAVE 56
|
|
|
|
#define FRAME_PARM5_SAVE 64
|
|
|
|
#define FRAME_PARM6_SAVE 72
|
|
|
|
#define FRAME_PARM7_SAVE 80
|
|
|
|
#define FRAME_PARM8_SAVE 88
|
|
|
|
#define FRAME_PARM9_SAVE 96
|
|
|
|
#endif
|
|
|
|
|
2004-10-06 22:09:35 +00:00
|
|
|
/* Support macros for CALL_MCOUNT. */
|
PowerPC64 ELFv2 ABI 4/6: Stack frame layout changes
This updates glibc for the changes in the ELFv2 relating to the
stack frame layout. These are described in more detail here:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01149.html
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01146.html
Specifically, the "compiler and linker doublewords" were removed,
which has the effect that the save slot for the TOC register is
now at offset 24 rather than 40 to the stack pointer.
In addition, a function may now no longer necessarily assume that
its caller has set up a 64-byte register save area its use.
To address the first change, the patch goes through all assembler
files and replaces immediate offsets in instructions accessing the
ABI-defined stack slots by symbolic offsets. Those already were
defined in ucontext_i.sym and used in some of the context routines,
but that doesn't really seem like the right place for those defines.
The patch instead defines those symbolic offsets in sysdeps.h,
in two variants for the old and new ABI, and uses them systematically
in all assembler files, not just the context routines.
The second change only affected a few assembler files that used
the save area to temporarily store some registers. In those
cases where this happens within a leaf function, this patch
changes the code to store those registers to the "red zone"
below the stack pointer. Otherwise, the functions already allocate
a stack frame, and the patch changes them to add extra space in
these frames as temporary space for the ELFv2 ABI.
2013-12-04 12:55:03 +00:00
|
|
|
#if _CALL_ELF == 2
|
|
|
|
#define call_mcount_parm_offset (-64)
|
|
|
|
#else
|
|
|
|
#define call_mcount_parm_offset FRAME_PARM_SAVE
|
|
|
|
#endif
|
2004-10-06 22:09:35 +00:00
|
|
|
.macro SAVE_ARG NARG
|
|
|
|
.if \NARG
|
|
|
|
SAVE_ARG \NARG-1
|
PowerPC64 ELFv2 ABI 4/6: Stack frame layout changes
This updates glibc for the changes in the ELFv2 relating to the
stack frame layout. These are described in more detail here:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01149.html
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01146.html
Specifically, the "compiler and linker doublewords" were removed,
which has the effect that the save slot for the TOC register is
now at offset 24 rather than 40 to the stack pointer.
In addition, a function may now no longer necessarily assume that
its caller has set up a 64-byte register save area its use.
To address the first change, the patch goes through all assembler
files and replaces immediate offsets in instructions accessing the
ABI-defined stack slots by symbolic offsets. Those already were
defined in ucontext_i.sym and used in some of the context routines,
but that doesn't really seem like the right place for those defines.
The patch instead defines those symbolic offsets in sysdeps.h,
in two variants for the old and new ABI, and uses them systematically
in all assembler files, not just the context routines.
The second change only affected a few assembler files that used
the save area to temporarily store some registers. In those
cases where this happens within a leaf function, this patch
changes the code to store those registers to the "red zone"
below the stack pointer. Otherwise, the functions already allocate
a stack frame, and the patch changes them to add extra space in
these frames as temporary space for the ELFv2 ABI.
2013-12-04 12:55:03 +00:00
|
|
|
std 2+\NARG,call_mcount_parm_offset-8+8*(\NARG)(1)
|
2004-10-06 22:09:35 +00:00
|
|
|
.endif
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro REST_ARG NARG
|
|
|
|
.if \NARG
|
|
|
|
REST_ARG \NARG-1
|
PowerPC64 ELFv2 ABI 4/6: Stack frame layout changes
This updates glibc for the changes in the ELFv2 relating to the
stack frame layout. These are described in more detail here:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01149.html
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01146.html
Specifically, the "compiler and linker doublewords" were removed,
which has the effect that the save slot for the TOC register is
now at offset 24 rather than 40 to the stack pointer.
In addition, a function may now no longer necessarily assume that
its caller has set up a 64-byte register save area its use.
To address the first change, the patch goes through all assembler
files and replaces immediate offsets in instructions accessing the
ABI-defined stack slots by symbolic offsets. Those already were
defined in ucontext_i.sym and used in some of the context routines,
but that doesn't really seem like the right place for those defines.
The patch instead defines those symbolic offsets in sysdeps.h,
in two variants for the old and new ABI, and uses them systematically
in all assembler files, not just the context routines.
The second change only affected a few assembler files that used
the save area to temporarily store some registers. In those
cases where this happens within a leaf function, this patch
changes the code to store those registers to the "red zone"
below the stack pointer. Otherwise, the functions already allocate
a stack frame, and the patch changes them to add extra space in
these frames as temporary space for the ELFv2 ABI.
2013-12-04 12:55:03 +00:00
|
|
|
ld 2+\NARG,FRAME_MIN_SIZE_PARM+call_mcount_parm_offset-8+8*(\NARG)(1)
|
2010-08-12 16:19:19 +00:00
|
|
|
.endif
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro CFI_SAVE_ARG NARG
|
|
|
|
.if \NARG
|
|
|
|
CFI_SAVE_ARG \NARG-1
|
PowerPC64 ELFv2 ABI 4/6: Stack frame layout changes
This updates glibc for the changes in the ELFv2 relating to the
stack frame layout. These are described in more detail here:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01149.html
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01146.html
Specifically, the "compiler and linker doublewords" were removed,
which has the effect that the save slot for the TOC register is
now at offset 24 rather than 40 to the stack pointer.
In addition, a function may now no longer necessarily assume that
its caller has set up a 64-byte register save area its use.
To address the first change, the patch goes through all assembler
files and replaces immediate offsets in instructions accessing the
ABI-defined stack slots by symbolic offsets. Those already were
defined in ucontext_i.sym and used in some of the context routines,
but that doesn't really seem like the right place for those defines.
The patch instead defines those symbolic offsets in sysdeps.h,
in two variants for the old and new ABI, and uses them systematically
in all assembler files, not just the context routines.
The second change only affected a few assembler files that used
the save area to temporarily store some registers. In those
cases where this happens within a leaf function, this patch
changes the code to store those registers to the "red zone"
below the stack pointer. Otherwise, the functions already allocate
a stack frame, and the patch changes them to add extra space in
these frames as temporary space for the ELFv2 ABI.
2013-12-04 12:55:03 +00:00
|
|
|
cfi_offset(2+\NARG,call_mcount_parm_offset-8+8*(\NARG))
|
2010-08-12 16:19:19 +00:00
|
|
|
.endif
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro CFI_REST_ARG NARG
|
|
|
|
.if \NARG
|
|
|
|
CFI_REST_ARG \NARG-1
|
|
|
|
cfi_restore(2+\NARG)
|
2004-10-06 22:09:35 +00:00
|
|
|
.endif
|
|
|
|
.endm
|
|
|
|
|
2002-09-20 23:46:03 +00:00
|
|
|
/* If compiled for profiling, call `_mcount' at the start of each function.
|
|
|
|
see ppc-mcount.S for more details. */
|
2004-10-06 22:09:35 +00:00
|
|
|
.macro CALL_MCOUNT NARG
|
2002-09-20 23:46:03 +00:00
|
|
|
#ifdef PROF
|
2004-10-06 22:09:35 +00:00
|
|
|
mflr r0
|
|
|
|
SAVE_ARG \NARG
|
PowerPC64 ELFv2 ABI 4/6: Stack frame layout changes
This updates glibc for the changes in the ELFv2 relating to the
stack frame layout. These are described in more detail here:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01149.html
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01146.html
Specifically, the "compiler and linker doublewords" were removed,
which has the effect that the save slot for the TOC register is
now at offset 24 rather than 40 to the stack pointer.
In addition, a function may now no longer necessarily assume that
its caller has set up a 64-byte register save area its use.
To address the first change, the patch goes through all assembler
files and replaces immediate offsets in instructions accessing the
ABI-defined stack slots by symbolic offsets. Those already were
defined in ucontext_i.sym and used in some of the context routines,
but that doesn't really seem like the right place for those defines.
The patch instead defines those symbolic offsets in sysdeps.h,
in two variants for the old and new ABI, and uses them systematically
in all assembler files, not just the context routines.
The second change only affected a few assembler files that used
the save area to temporarily store some registers. In those
cases where this happens within a leaf function, this patch
changes the code to store those registers to the "red zone"
below the stack pointer. Otherwise, the functions already allocate
a stack frame, and the patch changes them to add extra space in
these frames as temporary space for the ELFv2 ABI.
2013-12-04 12:55:03 +00:00
|
|
|
std r0,FRAME_LR_SAVE(r1)
|
|
|
|
stdu r1,-FRAME_MIN_SIZE_PARM(r1)
|
|
|
|
cfi_adjust_cfa_offset(FRAME_MIN_SIZE_PARM)
|
|
|
|
cfi_offset(lr,FRAME_LR_SAVE)
|
2010-08-12 16:19:19 +00:00
|
|
|
CFI_SAVE_ARG \NARG
|
2004-10-06 22:09:35 +00:00
|
|
|
bl JUMPTARGET (_mcount)
|
2010-08-12 16:19:19 +00:00
|
|
|
#ifndef SHARED
|
|
|
|
nop
|
|
|
|
#endif
|
PowerPC64 ELFv2 ABI 4/6: Stack frame layout changes
This updates glibc for the changes in the ELFv2 relating to the
stack frame layout. These are described in more detail here:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01149.html
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01146.html
Specifically, the "compiler and linker doublewords" were removed,
which has the effect that the save slot for the TOC register is
now at offset 24 rather than 40 to the stack pointer.
In addition, a function may now no longer necessarily assume that
its caller has set up a 64-byte register save area its use.
To address the first change, the patch goes through all assembler
files and replaces immediate offsets in instructions accessing the
ABI-defined stack slots by symbolic offsets. Those already were
defined in ucontext_i.sym and used in some of the context routines,
but that doesn't really seem like the right place for those defines.
The patch instead defines those symbolic offsets in sysdeps.h,
in two variants for the old and new ABI, and uses them systematically
in all assembler files, not just the context routines.
The second change only affected a few assembler files that used
the save area to temporarily store some registers. In those
cases where this happens within a leaf function, this patch
changes the code to store those registers to the "red zone"
below the stack pointer. Otherwise, the functions already allocate
a stack frame, and the patch changes them to add extra space in
these frames as temporary space for the ELFv2 ABI.
2013-12-04 12:55:03 +00:00
|
|
|
ld r0,FRAME_MIN_SIZE_PARM+FRAME_LR_SAVE(r1)
|
2004-10-06 22:09:35 +00:00
|
|
|
REST_ARG \NARG
|
|
|
|
mtlr r0
|
PowerPC64 ELFv2 ABI 4/6: Stack frame layout changes
This updates glibc for the changes in the ELFv2 relating to the
stack frame layout. These are described in more detail here:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01149.html
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01146.html
Specifically, the "compiler and linker doublewords" were removed,
which has the effect that the save slot for the TOC register is
now at offset 24 rather than 40 to the stack pointer.
In addition, a function may now no longer necessarily assume that
its caller has set up a 64-byte register save area its use.
To address the first change, the patch goes through all assembler
files and replaces immediate offsets in instructions accessing the
ABI-defined stack slots by symbolic offsets. Those already were
defined in ucontext_i.sym and used in some of the context routines,
but that doesn't really seem like the right place for those defines.
The patch instead defines those symbolic offsets in sysdeps.h,
in two variants for the old and new ABI, and uses them systematically
in all assembler files, not just the context routines.
The second change only affected a few assembler files that used
the save area to temporarily store some registers. In those
cases where this happens within a leaf function, this patch
changes the code to store those registers to the "red zone"
below the stack pointer. Otherwise, the functions already allocate
a stack frame, and the patch changes them to add extra space in
these frames as temporary space for the ELFv2 ABI.
2013-12-04 12:55:03 +00:00
|
|
|
addi r1,r1,FRAME_MIN_SIZE_PARM
|
|
|
|
cfi_adjust_cfa_offset(-FRAME_MIN_SIZE_PARM)
|
2010-08-12 16:19:19 +00:00
|
|
|
cfi_restore(lr)
|
|
|
|
CFI_REST_ARG \NARG
|
2004-10-06 22:09:35 +00:00
|
|
|
#endif
|
|
|
|
.endm
|
2002-09-20 23:46:03 +00:00
|
|
|
|
2013-12-04 12:51:11 +00:00
|
|
|
#if _CALL_ELF != 2
|
|
|
|
|
2013-12-04 12:49:15 +00:00
|
|
|
/* Macro to prepare for calling via a function pointer. */
|
|
|
|
.macro PPC64_LOAD_FUNCPTR PTR
|
|
|
|
ld r12,0(\PTR)
|
|
|
|
ld r2,8(\PTR)
|
|
|
|
mtctr r12
|
|
|
|
ld r11,16(\PTR)
|
|
|
|
.endm
|
|
|
|
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
#ifdef USE_PPC64_OVERLAPPING_OPD
|
|
|
|
# define OPD_ENT(name) .quad BODY_LABEL (name), .TOC.@tocbase
|
|
|
|
#else
|
|
|
|
# define OPD_ENT(name) .quad BODY_LABEL (name), .TOC.@tocbase, 0
|
|
|
|
#endif
|
2002-09-20 23:46:03 +00:00
|
|
|
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
#define ENTRY_1(name) \
|
|
|
|
.type BODY_LABEL(name),@function; \
|
|
|
|
.globl name; \
|
|
|
|
.section ".opd","aw"; \
|
|
|
|
.align 3; \
|
|
|
|
name##: OPD_ENT (name); \
|
|
|
|
.previous;
|
|
|
|
|
|
|
|
#ifdef HAVE_ASM_GLOBAL_DOT_NAME
|
|
|
|
# define DOT_LABEL(X) .##X
|
|
|
|
# define BODY_LABEL(X) .##X
|
|
|
|
# define ENTRY_2(name) \
|
|
|
|
.globl BODY_LABEL(name); \
|
|
|
|
ENTRY_1(name) \
|
|
|
|
.size name, 24;
|
|
|
|
# define END_2(name) \
|
|
|
|
.size BODY_LABEL(name),.-BODY_LABEL(name);
|
|
|
|
#else
|
|
|
|
# define DOT_LABEL(X) X
|
|
|
|
# define BODY_LABEL(X) .LY##X
|
|
|
|
# define ENTRY_2(name) \
|
|
|
|
.type name,@function; \
|
|
|
|
ENTRY_1(name)
|
|
|
|
# define END_2(name) \
|
|
|
|
.size name,.-BODY_LABEL(name); \
|
|
|
|
.size BODY_LABEL(name),.-BODY_LABEL(name);
|
|
|
|
#endif
|
2013-12-04 12:51:11 +00:00
|
|
|
#define LOCALENTRY(name)
|
|
|
|
|
|
|
|
#else /* _CALL_ELF */
|
|
|
|
|
|
|
|
/* Macro to prepare for calling via a function pointer. */
|
|
|
|
.macro PPC64_LOAD_FUNCPTR PTR
|
|
|
|
mr r12,\PTR
|
|
|
|
mtctr r12
|
|
|
|
.endm
|
|
|
|
|
|
|
|
#define DOT_LABEL(X) X
|
|
|
|
#define BODY_LABEL(X) X
|
|
|
|
#define ENTRY_2(name) \
|
|
|
|
.globl name; \
|
|
|
|
.type name,@function;
|
|
|
|
#define END_2(name) \
|
|
|
|
.size name,.-name;
|
|
|
|
#define LOCALENTRY(name) \
|
|
|
|
1: addis r2,r12,.TOC.-1b@ha; \
|
|
|
|
addi r2,r2,.TOC.-1b@l; \
|
|
|
|
.localentry name,.-name;
|
|
|
|
|
|
|
|
#endif /* _CALL_ELF */
|
2002-09-20 23:46:03 +00:00
|
|
|
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
#define ENTRY(name) \
|
2013-12-04 12:49:15 +00:00
|
|
|
.section ".text"; \
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
ENTRY_2(name) \
|
|
|
|
.align ALIGNARG(2); \
|
2006-01-04 20:05:05 +00:00
|
|
|
BODY_LABEL(name): \
|
2013-12-04 12:51:11 +00:00
|
|
|
cfi_startproc; \
|
|
|
|
LOCALENTRY(name)
|
2002-09-20 23:46:03 +00:00
|
|
|
|
|
|
|
#define EALIGN_W_0 /* No words to insert. */
|
|
|
|
#define EALIGN_W_1 nop
|
|
|
|
#define EALIGN_W_2 nop;nop
|
|
|
|
#define EALIGN_W_3 nop;nop;nop
|
|
|
|
#define EALIGN_W_4 EALIGN_W_3;nop
|
|
|
|
#define EALIGN_W_5 EALIGN_W_4;nop
|
|
|
|
#define EALIGN_W_6 EALIGN_W_5;nop
|
|
|
|
#define EALIGN_W_7 EALIGN_W_6;nop
|
|
|
|
|
|
|
|
/* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
past a 2^alignt boundary. */
|
2002-09-20 23:46:03 +00:00
|
|
|
#define EALIGN(name, alignt, words) \
|
2013-12-04 12:49:15 +00:00
|
|
|
.section ".text"; \
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
ENTRY_2(name) \
|
|
|
|
.align ALIGNARG(alignt); \
|
|
|
|
EALIGN_W_##words; \
|
2006-01-04 20:05:05 +00:00
|
|
|
BODY_LABEL(name): \
|
2013-12-04 12:51:11 +00:00
|
|
|
cfi_startproc; \
|
|
|
|
LOCALENTRY(name)
|
2002-09-20 23:46:03 +00:00
|
|
|
|
|
|
|
/* Local labels stripped out by the linker. */
|
|
|
|
#undef L
|
|
|
|
#define L(x) .L##x
|
|
|
|
|
|
|
|
#define tostring(s) #s
|
|
|
|
#define stringify(s) tostring(s)
|
|
|
|
#define XGLUE(a,b) a##b
|
|
|
|
#define GLUE(a,b) XGLUE(a,b)
|
|
|
|
#define LT_LABEL(name) GLUE(.LT,name)
|
|
|
|
#define LT_LABELSUFFIX(name,suffix) GLUE(GLUE(.LT,name),suffix)
|
|
|
|
|
|
|
|
/* Support Traceback tables */
|
|
|
|
#define TB_ASM 0x000c000000000000
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
#define TB_GLOBALLINK 0x0000800000000000
|
2002-09-20 23:46:03 +00:00
|
|
|
#define TB_IS_EPROL 0x0000400000000000
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
#define TB_HAS_TBOFF 0x0000200000000000
|
2002-09-20 23:46:03 +00:00
|
|
|
#define TB_INT_PROC 0x0000100000000000
|
|
|
|
#define TB_HAS_CTL 0x0000080000000000
|
|
|
|
#define TB_TOCLESS 0x0000040000000000
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
#define TB_FP_PRESENT 0x0000020000000000
|
|
|
|
#define TB_LOG_ABORT 0x0000010000000000
|
|
|
|
#define TB_INT_HANDL 0x0000008000000000
|
|
|
|
#define TB_NAME_PRESENT 0x0000004000000000
|
|
|
|
#define TB_USES_ALLOCA 0x0000002000000000
|
2002-09-20 23:46:03 +00:00
|
|
|
#define TB_SAVES_CR 0x0000000200000000
|
|
|
|
#define TB_SAVES_LR 0x0000000100000000
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
#define TB_STORES_BC 0x0000000080000000
|
2002-09-20 23:46:03 +00:00
|
|
|
#define TB_FIXUP 0x0000000040000000
|
|
|
|
#define TB_FP_SAVED(fprs) (((fprs) & 0x3f) << 24)
|
|
|
|
#define TB_GPR_SAVED(gprs) (((fprs) & 0x3f) << 16)
|
|
|
|
#define TB_FIXEDPARMS(parms) (((parms) & 0xff) << 8)
|
|
|
|
#define TB_FLOATPARMS(parms) (((parms) & 0x7f) << 1)
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
#define TB_PARMSONSTK 0x0000000000000001
|
2002-09-20 23:46:03 +00:00
|
|
|
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
#define PPC_HIGHER(v) (((v) >> 32) & 0xffff)
|
|
|
|
#define TB_DEFAULT TB_ASM | TB_HAS_TBOFF | TB_NAME_PRESENT
|
2002-09-20 23:46:03 +00:00
|
|
|
|
|
|
|
#define TRACEBACK(name) \
|
|
|
|
LT_LABEL(name): ; \
|
|
|
|
.long 0 ; \
|
|
|
|
.quad TB_DEFAULT ; \
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
.long LT_LABEL(name)-BODY_LABEL(name) ; \
|
2002-09-20 23:46:03 +00:00
|
|
|
.short LT_LABELSUFFIX(name,_name_end)-LT_LABELSUFFIX(name,_name_start) ; \
|
|
|
|
LT_LABELSUFFIX(name,_name_start): ;\
|
|
|
|
.ascii stringify(name) ; \
|
|
|
|
LT_LABELSUFFIX(name,_name_end): ; \
|
|
|
|
.align 2 ;
|
|
|
|
|
|
|
|
#define TRACEBACK_MASK(name,mask) \
|
|
|
|
LT_LABEL(name): ; \
|
|
|
|
.long 0 ; \
|
|
|
|
.quad TB_DEFAULT | mask ; \
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
.long LT_LABEL(name)-BODY_LABEL(name) ; \
|
2002-09-20 23:46:03 +00:00
|
|
|
.short LT_LABELSUFFIX(name,_name_end)-LT_LABELSUFFIX(name,_name_start) ; \
|
|
|
|
LT_LABELSUFFIX(name,_name_start): ;\
|
|
|
|
.ascii stringify(name) ; \
|
|
|
|
LT_LABELSUFFIX(name,_name_end): ; \
|
|
|
|
.align 2 ;
|
|
|
|
|
|
|
|
/* END generates Traceback tables */
|
|
|
|
#undef END
|
|
|
|
#define END(name) \
|
2006-01-04 20:05:05 +00:00
|
|
|
cfi_endproc; \
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
TRACEBACK(name) \
|
|
|
|
END_2(name)
|
2002-09-20 23:46:03 +00:00
|
|
|
|
|
|
|
/* This form supports more informative traceback tables */
|
|
|
|
#define END_GEN_TB(name,mask) \
|
2006-01-04 20:05:05 +00:00
|
|
|
cfi_endproc; \
|
2002-09-20 23:46:03 +00:00
|
|
|
TRACEBACK_MASK(name,mask) \
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
END_2(name)
|
2002-09-20 23:46:03 +00:00
|
|
|
|
2014-11-07 17:34:52 +00:00
|
|
|
#if !IS_IN(rtld) && defined (ENABLE_LOCK_ELISION)
|
|
|
|
# define ABORT_TRANSACTION \
|
|
|
|
cmpdi 13,0; \
|
|
|
|
beq 1f; \
|
|
|
|
lwz 0,TM_CAPABLE(13); \
|
|
|
|
cmpwi 0,0; \
|
|
|
|
beq 1f; \
|
|
|
|
li 0,_ABORT_SYSCALL; \
|
|
|
|
tabort. 0; \
|
|
|
|
.align 4; \
|
|
|
|
1:
|
|
|
|
#else
|
|
|
|
# define ABORT_TRANSACTION
|
|
|
|
#endif
|
|
|
|
|
2002-09-20 23:46:03 +00:00
|
|
|
#define DO_CALL(syscall) \
|
2014-11-07 17:34:52 +00:00
|
|
|
ABORT_TRANSACTION \
|
2002-09-20 23:46:03 +00:00
|
|
|
li 0,syscall; \
|
|
|
|
sc
|
|
|
|
|
|
|
|
/* ppc64 is always PIC */
|
2003-01-09 20:30:21 +00:00
|
|
|
#undef JUMPTARGET
|
2002-09-20 23:46:03 +00:00
|
|
|
#define JUMPTARGET(name) DOT_LABEL(name)
|
|
|
|
|
|
|
|
#define PSEUDO(name, syscall_name, args) \
|
|
|
|
.section ".text"; \
|
|
|
|
ENTRY (name) \
|
|
|
|
DO_CALL (SYS_ify (syscall_name));
|
|
|
|
|
2010-08-12 16:19:19 +00:00
|
|
|
#ifdef SHARED
|
|
|
|
#define TAIL_CALL_SYSCALL_ERROR \
|
|
|
|
b JUMPTARGET(__syscall_error)
|
|
|
|
#else
|
|
|
|
/* Static version might be linked into a large app with a toc exceeding
|
|
|
|
64k. We can't put a toc adjusting stub on a plain branch, so can't
|
|
|
|
tail call __syscall_error. */
|
|
|
|
#define TAIL_CALL_SYSCALL_ERROR \
|
|
|
|
.ifdef .Local_syscall_error; \
|
|
|
|
b .Local_syscall_error; \
|
|
|
|
.else; \
|
|
|
|
.Local_syscall_error: \
|
|
|
|
mflr 0; \
|
PowerPC64 ELFv2 ABI 4/6: Stack frame layout changes
This updates glibc for the changes in the ELFv2 relating to the
stack frame layout. These are described in more detail here:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01149.html
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01146.html
Specifically, the "compiler and linker doublewords" were removed,
which has the effect that the save slot for the TOC register is
now at offset 24 rather than 40 to the stack pointer.
In addition, a function may now no longer necessarily assume that
its caller has set up a 64-byte register save area its use.
To address the first change, the patch goes through all assembler
files and replaces immediate offsets in instructions accessing the
ABI-defined stack slots by symbolic offsets. Those already were
defined in ucontext_i.sym and used in some of the context routines,
but that doesn't really seem like the right place for those defines.
The patch instead defines those symbolic offsets in sysdeps.h,
in two variants for the old and new ABI, and uses them systematically
in all assembler files, not just the context routines.
The second change only affected a few assembler files that used
the save area to temporarily store some registers. In those
cases where this happens within a leaf function, this patch
changes the code to store those registers to the "red zone"
below the stack pointer. Otherwise, the functions already allocate
a stack frame, and the patch changes them to add extra space in
these frames as temporary space for the ELFv2 ABI.
2013-12-04 12:55:03 +00:00
|
|
|
std 0,FRAME_LR_SAVE(1); \
|
|
|
|
stdu 1,-FRAME_MIN_SIZE(1); \
|
|
|
|
cfi_adjust_cfa_offset(FRAME_MIN_SIZE); \
|
|
|
|
cfi_offset(lr,FRAME_LR_SAVE); \
|
2010-08-12 16:19:19 +00:00
|
|
|
bl JUMPTARGET(__syscall_error); \
|
|
|
|
nop; \
|
PowerPC64 ELFv2 ABI 4/6: Stack frame layout changes
This updates glibc for the changes in the ELFv2 relating to the
stack frame layout. These are described in more detail here:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01149.html
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01146.html
Specifically, the "compiler and linker doublewords" were removed,
which has the effect that the save slot for the TOC register is
now at offset 24 rather than 40 to the stack pointer.
In addition, a function may now no longer necessarily assume that
its caller has set up a 64-byte register save area its use.
To address the first change, the patch goes through all assembler
files and replaces immediate offsets in instructions accessing the
ABI-defined stack slots by symbolic offsets. Those already were
defined in ucontext_i.sym and used in some of the context routines,
but that doesn't really seem like the right place for those defines.
The patch instead defines those symbolic offsets in sysdeps.h,
in two variants for the old and new ABI, and uses them systematically
in all assembler files, not just the context routines.
The second change only affected a few assembler files that used
the save area to temporarily store some registers. In those
cases where this happens within a leaf function, this patch
changes the code to store those registers to the "red zone"
below the stack pointer. Otherwise, the functions already allocate
a stack frame, and the patch changes them to add extra space in
these frames as temporary space for the ELFv2 ABI.
2013-12-04 12:55:03 +00:00
|
|
|
ld 0,FRAME_MIN_SIZE+FRAME_LR_SAVE(1); \
|
|
|
|
addi 1,1,FRAME_MIN_SIZE; \
|
|
|
|
cfi_adjust_cfa_offset(-FRAME_MIN_SIZE); \
|
2010-08-12 16:19:19 +00:00
|
|
|
mtlr 0; \
|
|
|
|
cfi_restore(lr); \
|
|
|
|
blr; \
|
|
|
|
.endif
|
|
|
|
#endif
|
|
|
|
|
2002-09-20 23:46:03 +00:00
|
|
|
#define PSEUDO_RET \
|
Update.
2003-01-11 Jim Meyering <jim@meyering.net>
* io/ftw.c [HAVE_CONFIG_H]: Include <config.h>.
[HAVE_SYS_PARAM_H || _LIBC]: Guard inclusion of <sys/param.h>.
Include <sys/stat.h>, not <include/sys/stat.h>, if !_LIBC.
[!_LIBC] (__chdir, __closedir, __fchdir, __getcwd, __opendir): Define.
[!_LIBC] (__readdir64, __tdestroy, __tfind, __tsearch): Define.
[!_LIBC] (internal_function, dirent64, MAX): Define.
(__set_errno): Define if not already defined.
(open_dir_stream): When FTW_CHDIR is enabled, invoke opendir on
the basename, not the entire file name.
(process_entry): When FTW_CHDIR is enabled, invoke XSTAT or LXSTAT on
the basename, not the entire file name.
2003-01-12 Ulrich Drepper <drepper@redhat.com>
* string/tester.c (test_strcpy): Disable last added strcpy until
it is fixed.
2003-01-11 Philip Blundell <philb@gnu.org>
* sysdeps/unix/sysv/linux/arm/socket.S: Add cancellation support.
2003-01-11 Andreas Schwab <schwab@suse.de>
* Makerules: Add vpath for %.dynsym and %.so so that the
implicit rule chaining for check-abi works.
2003-01-11 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/unix/sysv/linux/sh/sysdep.h (SYSCALL_ERROR_HANDLER):
Add non-PIC case.
2003-01-11 Jakub Jelinek <jakub@redhat.com>
* elf/tls-macros.h [__ia64__] (__TLS_CALL_CLOBBERS): Define.
[__ia64__] (TLS_LE, TLS_IE): Fix typos. Add ;; at start of asm if
gp is used early.
[__ia64__] (TLS_LD, TLS_GD): Likewise. Use __TLS_CALL_CLOBBERS.
* elf/Makefile ($(objpfx)tst-tlsmod5.so, $(objpfx)tst-tlsmod6.so):
Ensure libc.so in DT_NEEDED.
* sysdeps/alpha/dl-machine.h (elf_machine_rela): Move
CHECK_STATIC_TLS before l_tls_offset use.
* sysdeps/i386/dl-machine.h (elf_machine_rel, elf_machine_rela):
Likewise.
* sysdeps/sh/dl-machine.h (elf_machine_rela): Likewise.
* sysdeps/generic/dl-tls.c (_dl_allocate_tls_storage) [TLS_DTV_AT_TP]:
Allocate TLS_PRE_TCB_SIZE bytes below result.
(_dl_deallocate_tls) [TLS_DTV_AT_TP]: Adjust before freeing.
* sysdeps/generic/libc-tls.c (__libc_setup_tls): If
TLS_INIT_TP_EXPENSIVE is not defined, allocate even if no PT_TLS
segment has been found. If TLS_DTV_AT_TP, allocate TLS_PRE_TCB_SIZE
bytes below result and add tcb_offset to memsz.
* sysdeps/ia64/dl-tls.h (__tls_get_addr): New prototype.
* sysdeps/ia64/dl-machine.h: Include tls.h.
(elf_machine_type_class): Return ELF_RTYPE_CLASS_PLT for TLS relocs
too.
(elf_machine_rela): Assume if sym_map != NULL sym is non-NULL too.
Handle R_IA64_DTPMOD*, R_IA64_DTPREL* and R_IA64_TPREL* relocations.
* sysdeps/ia64/libc-tls.c: New file.
2003-01-10 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc64/sysdep.h (PSEUDO_RET): Add branch hit.
* sysdeps/unix/sysv/linux/powerpc/bits/stat.h (STAT_VER_LINUX):
Fix type. Move definition out of #if.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/ftruncate64.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S: Add cancellation
support.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list: Remove
ftruncate64, pread64, pwrite64, truncate64 entries.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
(INLINE_SYSCALL): New version that supports function call like
syscalls. Add __builtin_expect.
(LOADARGS_n): Add argument size safety checks.
(INTERNAL_SYSCALL): New Macro.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/truncate64.c: New file.
* sysdeps/unix/sysv/linux/powerpc/sys/procfs.h [__PPC_ELF_H]: Avoid
redefinition of elf_fpreg_t and elf_fpregset_t.
2003-01-12 Ulrich Drepper <drepper@redhat.com>
* elf/dl-close.c (_dl_close): Add several asserts. Correct and
simplify test for unloading. If loader of a DSO is unloaded do not
use its scope anymore. Fall back to own scope and adjust opencounts.
Fix several comments.
* elf/dl-deps.c (_dl_map_object_deps): Always allocate memory for
the l_searchlist, not only for l_initfini.
* elf/dl-lookup.c (add_dependencies): Avoid creating relocation
dependencies if objects cannot be removed. Remove object with the
definition as not unloadable if necessary.
* elf/reldep6.c: Create relocation dependency before closing the first
module.
2003-01-10 Guido Gnther <agx@sigxcpu.org>
* elf/Makefile: Add rules to build and run reldep9 test.
* elf/reldep9.c: New file.
* elf/reldep9mod1.c: New file.
* elf/reldep9mod2.c: New file.
* elf/reldep9mod3.c: New file.
2003-01-09 Jakub Jelinek <jakub@redhat.com>
* elf/Makefile: Add rules to build and run nodelete2 test.
* elf/nodelete2.c: New file.
* elf/nodel2mod1.c: New file.
* elf/nodel2mod2.c: New file.
* elf/nodel2mod3.c: New file.
2003-01-09 Jakub Jelinek <jakub@redhat.com>
2003-01-12 10:11:16 +00:00
|
|
|
bnslr+; \
|
2010-08-12 16:19:19 +00:00
|
|
|
TAIL_CALL_SYSCALL_ERROR
|
2002-09-20 23:46:03 +00:00
|
|
|
|
|
|
|
#define ret PSEUDO_RET
|
|
|
|
|
|
|
|
#undef PSEUDO_END
|
|
|
|
#define PSEUDO_END(name) \
|
|
|
|
END (name)
|
|
|
|
|
2003-03-23 19:44:31 +00:00
|
|
|
#define PSEUDO_NOERRNO(name, syscall_name, args) \
|
|
|
|
.section ".text"; \
|
|
|
|
ENTRY (name) \
|
|
|
|
DO_CALL (SYS_ify (syscall_name));
|
|
|
|
|
|
|
|
#define PSEUDO_RET_NOERRNO \
|
|
|
|
blr
|
|
|
|
|
|
|
|
#define ret_NOERRNO PSEUDO_RET_NOERRNO
|
|
|
|
|
|
|
|
#undef PSEUDO_END_NOERRNO
|
2003-03-24 19:36:57 +00:00
|
|
|
#define PSEUDO_END_NOERRNO(name) \
|
2003-03-23 19:44:31 +00:00
|
|
|
END (name)
|
|
|
|
|
Update.
2003-08-16 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc32/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_RET_ERRVAL, ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/powerpc/powerpc64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_RET_ERRVAL, ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/alpha/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/mips/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/sparc/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h (PSEUDO_ERRVAL):
Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysdep.h (PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/sysv/linux/syscalls.list (posix_fadvise64,
posix_fadvise64_64): Remove.
* sysdeps/unix/sysv/linux/alpha/syscalls.list (posix_fadvise64): Add
V flag.
* sysdeps/unix/sysv/linux/ia64/syscalls.list (posix_fadvise64):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/x86_64/syscalls.list (posix_fadvise64):
Likewise.
* sysdeps/unix/sysv/linux/i386/posix_fadvise64_64.S: Moved to...
* sysdeps/unix/sysv/linux/i386/posix_fadvise64.S: ...here.
(__posix_fadvise64_l64): Fix a typo in fadvise64 syscall invocation.
(__posix_fadvise64_l32): New function.
* sysdeps/unix/sysv/linux/i386/Makefile: Revert last change.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions (libc): Export
posix_fadvise64@@GLIBC_2.3.3.
* sysdeps/unix/sysv/linux/s390/s390-32/Versions (libc): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/Versions (libc): Likewise.
* sysdeps/unix/sysv/linux/posix_fadvise.c (posix_fadvise): Return
error value.
* sysdeps/unix/sysv/linux/posix_fadvise64.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
(SYSCALL_ERROR_HANDLER): Use TLS errno/__libc_errno if USE___THREAD.
2003-08-15 Jakub Jelinek <jakub@redhat.com>
* sysdeps/sparc/sparc32/dl-machine.h (WEAKADDR): Remove.
(elf_machine_matches_host): Remove weak extern stuff.
Use GL(dl_hwcap) unconditionally and GL(dl_hwcap_mask) if SHARED.
(elf_machine_runtime_setup, sparc_fixup_plt): Remove weak extern
stuff. Use GL(dl_hwcap) unconditionally.
2003-08-17 00:37:19 +00:00
|
|
|
#define PSEUDO_ERRVAL(name, syscall_name, args) \
|
|
|
|
.section ".text"; \
|
|
|
|
ENTRY (name) \
|
|
|
|
DO_CALL (SYS_ify (syscall_name));
|
|
|
|
|
|
|
|
#define PSEUDO_RET_ERRVAL \
|
|
|
|
blr
|
|
|
|
|
|
|
|
#define ret_ERRVAL PSEUDO_RET_ERRVAL
|
|
|
|
|
|
|
|
#undef PSEUDO_END_ERRVAL
|
|
|
|
#define PSEUDO_END_ERRVAL(name) \
|
|
|
|
END (name)
|
|
|
|
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
#else /* !__ASSEMBLER__ */
|
2002-09-20 23:46:03 +00:00
|
|
|
|
2013-12-04 12:51:11 +00:00
|
|
|
#if _CALL_ELF != 2
|
|
|
|
|
2013-12-04 12:49:15 +00:00
|
|
|
#define PPC64_LOAD_FUNCPTR(ptr) \
|
|
|
|
"ld 12,0(" #ptr ");\n" \
|
|
|
|
"ld 2,8(" #ptr ");\n" \
|
|
|
|
"mtctr 12;\n" \
|
|
|
|
"ld 11,16(" #ptr ");"
|
|
|
|
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
#ifdef USE_PPC64_OVERLAPPING_OPD
|
|
|
|
# define OPD_ENT(name) ".quad " BODY_PREFIX #name ", .TOC.@tocbase;"
|
|
|
|
#else
|
|
|
|
# define OPD_ENT(name) ".quad " BODY_PREFIX #name ", .TOC.@tocbase, 0;"
|
|
|
|
#endif
|
|
|
|
|
2013-12-04 12:49:15 +00:00
|
|
|
#define ENTRY_1(name) \
|
|
|
|
".type " BODY_PREFIX #name ",@function;\n" \
|
|
|
|
".globl " #name ";\n" \
|
|
|
|
".pushsection \".opd\",\"aw\";\n" \
|
|
|
|
".align 3;\n" \
|
|
|
|
#name ":\n" \
|
|
|
|
OPD_ENT (name) "\n" \
|
|
|
|
".popsection;"
|
|
|
|
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
#ifdef HAVE_ASM_GLOBAL_DOT_NAME
|
|
|
|
# define DOT_PREFIX "."
|
|
|
|
# define BODY_PREFIX "."
|
|
|
|
# define ENTRY_2(name) \
|
|
|
|
".globl " BODY_PREFIX #name ";\n" \
|
2013-12-04 12:49:15 +00:00
|
|
|
ENTRY_1(name) "\n" \
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
".size " #name ", 24;"
|
|
|
|
# define END_2(name) \
|
|
|
|
".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";"
|
|
|
|
#else
|
|
|
|
# define DOT_PREFIX ""
|
|
|
|
# define BODY_PREFIX ".LY"
|
2013-12-04 12:49:15 +00:00
|
|
|
# define ENTRY_2(name) \
|
|
|
|
".type " #name ",@function;\n" \
|
|
|
|
ENTRY_1(name)
|
Update.
2004-09-07 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc64/configure.in: New file.
* config.h.in (USE_PPC64_OVERLAPPING_OPD): Add.
* configure.in (HAVE_ASM_GLOBAL_DOT_NAME): Remove.
* sysdeps/powerpc/powerpc64/sysdep.h: Formatting.
(OPD_ENT, BODY_LABEL, ENTRY_1, ENTRY_2, END_2, DOT_PREFIX,
BODY_PREFIX): Define.
(ENTRY, DOT_LABEL, END, TRACEBACK, END_GEN_TB, EALIGN): Support
HAVE_ASM_GLOBAL_DOT_NAME or no dot symbols,
USE_PPC64_OVERLAPPING_OPD or never overlapping .opd entries.
* sysdeps/powerpc/powerpc64/dl-machine.h: Include sysdep.h.
(TRAMPOLINE_TEMPLATE, RTLD_START): Use the new sysdep.h macros.
2004-09-08 07:02:28 +00:00
|
|
|
# define END_2(name) \
|
|
|
|
".size " #name ",.-" BODY_PREFIX #name ";\n" \
|
|
|
|
".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";"
|
|
|
|
#endif
|
2013-12-04 12:51:11 +00:00
|
|
|
#define LOCALENTRY(name)
|
|
|
|
|
|
|
|
#else /* _CALL_ELF */
|
|
|
|
|
|
|
|
#define PPC64_LOAD_FUNCPTR(ptr) \
|
|
|
|
"mr 12," #ptr ";\n" \
|
|
|
|
"mtctr 12;"
|
|
|
|
|
|
|
|
#define DOT_PREFIX ""
|
|
|
|
#define BODY_PREFIX ""
|
|
|
|
#define ENTRY_2(name) \
|
|
|
|
".type " #name ",@function;\n" \
|
|
|
|
".globl " #name ";"
|
|
|
|
#define END_2(name) \
|
|
|
|
".size " #name ",.-" #name ";"
|
|
|
|
#define LOCALENTRY(name) \
|
|
|
|
"1: addis 2,12,.TOC.-1b@ha;\n" \
|
|
|
|
"addi 2,2,.TOC.-1b@l;\n" \
|
|
|
|
".localentry " #name ",.-" #name ";"
|
|
|
|
|
|
|
|
#endif /* _CALL_ELF */
|
2002-09-20 23:46:03 +00:00
|
|
|
|
|
|
|
#endif /* __ASSEMBLER__ */
|