From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36908 invoked by alias); 12 Jul 2019 14:10:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 36682 invoked by uid 89); 12 Jul 2019 14:10:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SEM_URI,SEM_URIRED,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-lj1-f169.google.com Received: from mail-lj1-f169.google.com (HELO mail-lj1-f169.google.com) (209.85.208.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Jul 2019 14:10:06 +0000 Received: by mail-lj1-f169.google.com with SMTP id 16so9465845ljv.10 for ; Fri, 12 Jul 2019 07:10:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=3MXyRLAIODoS8q/VqgVfe0Y2HXz7J3jaw0hGwjmf9L8=; b=hKgv5EyDkxpNOWQ1jDXWEQWXJcWirZ9pn6IkMFhuZ9kqhGzzbIHjIJe4MMLiv0qax4 bzpibwOgJSpbGVObbtzStlxY/JSWbLtnX1M4CpAch5XrwHIsuzXnewVPNw0jk5dMKLZt cRJXwUmEjDIn+JXFU/WnEYn1cjKRbL2zq8LyBfKEqq9zjZO5UbM1ATnc6OFylogLXohV LWSO2b2+eDq620qpqu7Qp8F9A3b3IBnljca35/zOsaXCnAMWWBUS1RSrcq2kjQYJTwOt 4tdPEi+1Da33lg/cnrG3E6ZWJsFupqNn6v30FdSxREmiYWiqBg73HKywug7KZI1L0TB8 oP6Q== MIME-Version: 1.0 References: <20190515124006.25840-1-christophe.lyon@st.com> <20190515124006.25840-6-christophe.lyon@st.com> In-Reply-To: From: Christophe Lyon Date: Fri, 12 Jul 2019 14:25:00 -0000 Message-ID: Subject: Re: [ARM/FDPIC v5 05/21] [ARM] FDPIC: Fix __do_global_dtors_aux and frame_dummy generation To: Christophe Lyon , gcc Patches , Richard Sandiford Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00978.txt.bz2 On Fri, 12 Jul 2019 at 08:06, Richard Sandiford wrote: > > Christophe Lyon writes: > > In FDPIC, we need to make sure __do_global_dtors_aux and frame_dummy > > are referenced by their address, not by pointers to the function > > descriptors. > > > > 2019-XX-XX Christophe Lyon > > Micka=C3=ABl Gu=C3=AAn=C3=A9 > > > > * libgcc/crtstuff.c: Add support for FDPIC. > > > > Change-Id: I0bc4b1232fbf3c69068fb23a1b9cafc895d141b1 > > > > diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c > > index 4927a9f..159b461 100644 > > --- a/libgcc/crtstuff.c > > +++ b/libgcc/crtstuff.c > > @@ -429,9 +429,18 @@ __do_global_dtors_aux (void) > > #ifdef FINI_SECTION_ASM_OP > > CRT_CALL_STATIC_FUNCTION (FINI_SECTION_ASM_OP, __do_global_dtors_aux) > > #elif defined (FINI_ARRAY_SECTION_ASM_OP) > > +#if defined(__FDPIC__) > > +__asm__( > > + " .section .fini_array\n" > > + " .align 2\n" > > + " .word __do_global_dtors_aux\n" > > +); > > +asm (TEXT_SECTION_ASM_OP); > > +#else /* defined(__FDPIC__) */ > > static func_ptr __do_global_dtors_aux_fini_array_entry[] > > __attribute__ ((__used__, section(".fini_array"), aligned(sizeof(fun= c_ptr)))) > > =3D { __do_global_dtors_aux }; > > +#endif /* defined(__FDPIC__) */ > > #else /* !FINI_SECTION_ASM_OP && !FINI_ARRAY_SECTION_ASM_OP */ > > static void __attribute__((used)) > > __do_global_dtors_aux_1 (void) > > It'd be good to avoid hard-coding the pointer size. Would it work to do: > > __asm__("\t.equ\.t__do_global_dtors_aux_alias, __do_global_dtors_aux\n"); > extern char __do_global_dtors_aux_alias; > static void *__do_global_dtors_aux_fini_array_entry[] > __attribute__ ((__used__, section(".fini_array"), aligned(sizeof(void = *)))) > =3D { &__do_global_dtors_aux_alias }; > > ? Similarly for the init_array. > I'll take a look, thanks. > AFAICT this and 02/21 are the only patches that aren't Arm-specific, > is that right? Yes for compiler/libs changes. There are also testsuite changes that potentially include other targets in patches 16,17,18. Thanks, Christophe > Thanks, > Richard