From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by sourceware.org (Postfix) with ESMTPS id A04253858037 for ; Tue, 16 Nov 2021 22:12:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A04253858037 Received: by mail-yb1-xb33.google.com with SMTP id g17so1020299ybe.13 for ; Tue, 16 Nov 2021 14:12:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=wMlNzA1gNigJeCN9pU3F1BfP+PCkhYD7DTkF4bRDJA8=; b=gzcVqQkbhO2AO67ZlX4VwpKNqF8kQ+sDHIcfOV44VzDQS0y06JMT3Cs61hbyTWuu02 ONBukqRORsQjVlg/5wD3Yxm5PEgZdy0jT7itHHTR5DU/xeOfUAC99/VNX/0eCsAuFubG WrqmeGv5LATzEscEhtD+Od8DMGSP2pgil7wU2QqjG91m0YltJ3jzTszcImc4zsLP29wb qp6MsEvJlHvvx5EP2rdOZvGYzrBDgAtcwHqIiT69z09l3guJYfqh0tKrWo4EywkWFP7J NIjI7H+Ek3NZCARrctu+vhf9ypH4hUW5y+fywzFIDw8WH/mvqKnSQb7v8OKKqvWg3+jb KHdQ== X-Gm-Message-State: AOAM531nWKoY5BhZ3OFKVY2zE1DUbc9z2F1XPFtzGo4ZfwIPntBDtj+K fEV0munH7jj8G9KzZtF2bIQfOylbz6EZZyq5HUbCEg== X-Google-Smtp-Source: ABdhPJxnksL1NhLHIo2erwiUFAXkPnmXtNBTJe7YIxZeM9VyLf2ZY2DFdK1Vp7ZSRm7hkq3HfHzwnOa+iMfhmEwTGXE= X-Received: by 2002:a25:2c92:: with SMTP id s140mr12744083ybs.308.1637100761935; Tue, 16 Nov 2021 14:12:41 -0800 (PST) MIME-Version: 1.0 References: <20211108113316.8867-1-adhemerval.zanella@linaro.org> <20211108224808.iqpddl4vgnx2gwol@google.com> <87zgq33n1k.fsf@linux.ibm.com> <87wnl73la2.fsf@linux.ibm.com> <87tugbakst.fsf@oldenburg.str.redhat.com> In-Reply-To: <87tugbakst.fsf@oldenburg.str.redhat.com> From: =?UTF-8?B?RsSBbmctcnXDrCBTw7JuZw==?= Date: Tue, 16 Nov 2021 14:12:30 -0800 Message-ID: Subject: Re: [PATCH] powerpc: Define USE_PPC64_NOTOC iff compiler and linker also supports it To: Tulio Magno Quites Machado Filho Cc: Nemanja Ivanovic , Florian Weimer , Tulio Magno Quites Machado Filho via Libc-alpha , Alan Modra Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.9 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2021 22:12:44 -0000 On Tue, Nov 16, 2021 at 12:49 PM Florian Weimer via Libc-alpha wrote: > > * Tulio Magno Quites Machado Filho via Libc-alpha: > > > Tulio Magno Quites Machado Filho via Libc-alpha writes: > > > >> Alan Modra via Libc-alpha writes: > >> > >>> I have a question about powerpc64/ppc-mcount.S. Why is the assembly > >>> wrapper using ENTRY and a NOTOC call? By using ENTRY you are saying > >>> that calls to _mcount must have r2 valid. Given that r2 is valid, wh= y > >>> then use NOTOC? > >> > >> I wouldn't be surprised if that was a misinterpretation of the ABI on = my part. > >> > >> Looking at table 2.20 "Protocols for Local Function Calls", I think th= is is a > >> scenario that falls to the last row of this table, where we have: > > > > OK, I should be looking at table 2.19 because this is not a call within= the > > same compilation unit. > > I'm not entirely sure about that. I think =E2=80=9Clocal=E2=80=9D in thi= s context means > =E2=80=9Cthe caller has complete information about the callee=E2=80=9D, a= nd this is true > for most direct calls within libc.so.6. It's also necessary to make > LTO-based calling convention optimizations effective. > > Thanks, > Florian > I think "external" in the context means the symbol may be preemptible at link time (and therefore at run time). "local" in the context means it must be non-preemptible. STV_DEFAULT STB_GLOBAL (-shared or non-definition) symbols may be preemptible (the compiler needs to be conservative and assumes that the linker option --version-script, --dynamic-list, -Bsymbolic-functions may not be specified) and use the external call protocol.