From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16659 invoked by alias); 13 Jun 2018 15:32:14 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 16528 invoked by uid 89); 13 Jun 2018 15:32:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy= X-HELO: mga01.intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 From: "H.J. Lu" To: libc-alpha@sourceware.org Subject: [PATCH 04/24] x86: Add _CET_ENDBR to functions in crti.S Date: Wed, 13 Jun 2018 15:32:00 -0000 Message-Id: <20180613153207.57232-5-hjl.tools@gmail.com> In-Reply-To: <20180613153207.57232-1-hjl.tools@gmail.com> References: <20180613153207.57232-1-hjl.tools@gmail.com> X-SW-Source: 2018-06/txt/msg00327.txt.bz2 Add _CET_ENDBR to functions in crti.S, which are called indirectly, to support IBT. Tested on i686 and x86-64. * sysdeps/i386/crti.S (_init): Add _CET_ENDBR. (_fini): Likewise. * sysdeps/x86_64/crti.S (_init): Likewise. (_fini): Likewise. --- sysdeps/i386/crti.S | 2 ++ sysdeps/x86_64/crti.S | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sysdeps/i386/crti.S b/sysdeps/i386/crti.S index ffbc92c22f..65ddc1c934 100644 --- a/sysdeps/i386/crti.S +++ b/sysdeps/i386/crti.S @@ -61,6 +61,7 @@ .hidden _init .type _init, @function _init: + _CET_ENDBR pushl %ebx /* Maintain 16-byte stack alignment for called functions. */ subl $8, %esp @@ -81,6 +82,7 @@ _init: .hidden _fini .type _fini, @function _fini: + _CET_ENDBR pushl %ebx subl $8, %esp LOAD_PIC_REG (bx) diff --git a/sysdeps/x86_64/crti.S b/sysdeps/x86_64/crti.S index f26915e956..067ac14884 100644 --- a/sysdeps/x86_64/crti.S +++ b/sysdeps/x86_64/crti.S @@ -61,6 +61,7 @@ .hidden _init .type _init, @function _init: + _CET_ENDBR /* Maintain 16-byte stack alignment for called functions. */ subq $8, %rsp #if PREINIT_FUNCTION_WEAK @@ -79,4 +80,5 @@ _init: .hidden _fini .type _fini, @function _fini: + _CET_ENDBR subq $8, %rsp -- 2.17.1