mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-12 06:10:10 +00:00
5a82c74822
Also, change sources.redhat.com to sourceware.org. This patch was automatically generated by running the following shell script, which uses GNU sed, and which avoids modifying files imported from upstream: sed -ri ' s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g ' \ $(find $(git ls-files) -prune -type f \ ! -name '*.po' \ ! -name 'ChangeLog*' \ ! -path COPYING ! -path COPYING.LIB \ ! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \ ! -path manual/texinfo.tex ! -path scripts/config.guess \ ! -path scripts/config.sub ! -path scripts/install-sh \ ! -path scripts/mkinstalldirs ! -path scripts/move-if-change \ ! -path INSTALL ! -path locale/programs/charmap-kw.h \ ! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \ ! '(' -name configure \ -execdir test -f configure.ac -o -f configure.in ';' ')' \ ! '(' -name preconfigure \ -execdir test -f preconfigure.ac ';' ')' \ -print) and then by running 'make dist-prepare' to regenerate files built from the altered files, and then executing the following to cleanup: chmod a+x sysdeps/unix/sysv/linux/riscv/configure # Omit irrelevant whitespace and comment-only changes, # perhaps from a slightly-different Autoconf version. git checkout -f \ sysdeps/csky/configure \ sysdeps/hppa/configure \ sysdeps/riscv/configure \ sysdeps/unix/sysv/linux/csky/configure # Omit changes that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines git checkout -f \ sysdeps/powerpc/powerpc64/ppc-mcount.S \ sysdeps/unix/sysv/linux/s390/s390-64/syscall.S # Omit change that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
89 lines
2.9 KiB
ArmAsm
89 lines
2.9 KiB
ArmAsm
/* Copyright (C) 2009-2019 Free Software Foundation, Inc.
|
|
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
|
|
License along with the GNU C Library; if not, see
|
|
<https://www.gnu.org/licenses/>. */
|
|
|
|
#include <sigaltstack-offsets.h>
|
|
|
|
.section .rodata.str1.8,"aMS",@progbits,1
|
|
.align 8
|
|
.LC0:
|
|
.string "longjmp causes uninitialized stack frame"
|
|
|
|
.section .sdata,"aws",@progbits
|
|
.align 8
|
|
.type longjmp_msg,@object
|
|
longjmp_msg:
|
|
data8 .LC0
|
|
.size longjmp_msg, .-longjmp_msg
|
|
|
|
#define __longjmp ____longjmp_chk
|
|
|
|
/* We use 32 bytes (rather than sizeof(stack_t)) so that we keep the stack
|
|
properly aligned. But we still want a sanity check to make sure 32 is
|
|
actually enough. */
|
|
#define STACK_SPACE ((sizeSS + 31) & -32)
|
|
|
|
/* Check the stack pointer held in the jumpbuf. Make sure it's in either the
|
|
current stack (r12) or in the signal stack. */
|
|
#define CHECK_RSP \
|
|
ld8 loc0 = [in0]; \
|
|
;; \
|
|
/* First see if target stack is within current one. */ \
|
|
cmp.ltu p0, p8 = loc0, r12; \
|
|
(p8) br.cond.dptk.many .Lok; \
|
|
\
|
|
/* Check if it's an alternative signal stack. */ \
|
|
mov out0 = r0; \
|
|
add out1 = -STACK_SPACE, r12; \
|
|
;; \
|
|
mov r12 = out1; \
|
|
DO_CALL_VIA_BREAK (SYS_ify (sigaltstack)); \
|
|
;; \
|
|
/* If the syscall failed, then assume it's OK. */ \
|
|
cmp.eq p8, p0 = -1, r10; \
|
|
(p8) br.cond.spnt .Lok; \
|
|
/* Move stack_t into regs. */ \
|
|
add r14 = oSS_FLAGS, r12; /* ss_flags */ \
|
|
add r15 = oSS_SIZE, r12; /* ss_size */ \
|
|
ld8 r16 = [r12]; /* ss_sp */ \
|
|
;; \
|
|
ld4 r17 = [r14]; /* ss_flags */ \
|
|
ld8 r18 = [r15]; /* ss_size */ \
|
|
;; \
|
|
sub r19 = r16, r18; /* sp - size */ \
|
|
/* See if we're currently on the altstack. */ \
|
|
tbit.nz p0, p8 = r17, 0; /* SS_ONSTACK */ \
|
|
(p8) br.cond.spnt .Lfail; \
|
|
/* Verify target is within alternative stack. */ \
|
|
cmp.gtu p7, p0 = loc0, r16; \
|
|
(p7) br.cond.spnt .Lfail; \
|
|
;; \
|
|
cmp.ltu p0, p8 = loc0, r19; \
|
|
(p8) br.cond.sptk.many .Lok; \
|
|
;; \
|
|
\
|
|
/* Still here? Abort! */ \
|
|
.Lfail: \
|
|
add r12 = STACK_SPACE, r12; \
|
|
addl loc0 = @ltoffx(longjmp_msg#), r1;; \
|
|
ld8.mov loc0 = [loc0], longjmp_msg#;; \
|
|
ld8 out0 = [loc0]; \
|
|
br.call.sptk.many b0 = HIDDEN_JUMPTARGET(__fortify_fail)#;; \
|
|
.Lok: \
|
|
add r12 = STACK_SPACE, r12;
|
|
|
|
#include "__longjmp.S"
|