Message ID | 20180505154639.GA23073@intel.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 70324 invoked by alias); 5 May 2018 15:46:43 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 70311 invoked by uid 89); 5 May 2018 15:46:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, NO_DNS_FOR_FROM autolearn=ham version=3.3.2 spammy=Mark, measure X-HELO: mga17.intel.com X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False X-ExtLoop1: 1 Date: Sat, 5 May 2018 08:46:39 -0700 From: "H.J. Lu" <hongjiu.lu@intel.com> To: GNU C Library <libc-alpha@sourceware.org> Subject: [PATCH] x86-64/memset: Mark the debugger symbol as hidden Message-ID: <20180505154639.GA23073@intel.com> Reply-To: "H.J. Lu" <hjl.tools@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.3 (2018-01-21) |
Commit Message
Lu, Hongjiu
May 5, 2018, 3:46 p.m. UTC
When MEMSET_SYMBOL (__memset, erms) is provided for debugger, mark it as hidden so that it will be local to the library. Any comments? H.J. --- * sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S (MEMSET_SYMBOL (__memset, erms)): Mark the debugger symbol as hidden. --- sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On Sat, May 5, 2018 at 8:46 AM, H.J. Lu <hongjiu.lu@intel.com> wrote: > When MEMSET_SYMBOL (__memset, erms) is provided for debugger, mark it > as hidden so that it will be local to the library. > > Any comments? > > H.J. > --- > * sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S > (MEMSET_SYMBOL (__memset, erms)): Mark the debugger symbol as > hidden. > --- > sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S b/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S > index d0fe79c9f1..a0560cd5c8 100644 > --- a/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S > +++ b/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S > @@ -131,7 +131,8 @@ END (__memset_chk_erms) > /* Only used to measure performance of REP STOSB. */ > ENTRY (__memset_erms) > # else > -/* Provide a symbol to debugger. */ > +/* Provide a hidden symbol to debugger. */ > + .hidden MEMSET_SYMBOL (__memset, erms) > ENTRY (MEMSET_SYMBOL (__memset, erms)) > # endif > L(stosb): > -- > 2.17.0 > I am checking it in.
On 07/05/2018 14:59, H.J. Lu wrote: > On Sat, May 5, 2018 at 8:46 AM, H.J. Lu <hongjiu.lu@intel.com> wrote: >> When MEMSET_SYMBOL (__memset, erms) is provided for debugger, mark it >> as hidden so that it will be local to the library. >> >> Any comments? >> >> H.J. >> --- >> * sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S >> (MEMSET_SYMBOL (__memset, erms)): Mark the debugger symbol as >> hidden. >> --- >> sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S b/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S >> index d0fe79c9f1..a0560cd5c8 100644 >> --- a/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S >> +++ b/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S >> @@ -131,7 +131,8 @@ END (__memset_chk_erms) >> /* Only used to measure performance of REP STOSB. */ >> ENTRY (__memset_erms) >> # else >> -/* Provide a symbol to debugger. */ >> +/* Provide a hidden symbol to debugger. */ >> + .hidden MEMSET_SYMBOL (__memset, erms) >> ENTRY (MEMSET_SYMBOL (__memset, erms)) >> # endif >> L(stosb): >> -- >> 2.17.0 >> > > I am checking it in. > Why is this need only for this symbol in particular and not for all other ifunc variations? What debugger is missing and does it potentially might affect other architectures as well?
On Mon, May 7, 2018 at 11:22 AM, Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote: > > > On 07/05/2018 14:59, H.J. Lu wrote: >> On Sat, May 5, 2018 at 8:46 AM, H.J. Lu <hongjiu.lu@intel.com> wrote: >>> When MEMSET_SYMBOL (__memset, erms) is provided for debugger, mark it >>> as hidden so that it will be local to the library. >>> >>> Any comments? >>> >>> H.J. >>> --- >>> * sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S >>> (MEMSET_SYMBOL (__memset, erms)): Mark the debugger symbol as >>> hidden. >>> --- >>> sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S b/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S >>> index d0fe79c9f1..a0560cd5c8 100644 >>> --- a/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S >>> +++ b/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S >>> @@ -131,7 +131,8 @@ END (__memset_chk_erms) >>> /* Only used to measure performance of REP STOSB. */ >>> ENTRY (__memset_erms) >>> # else >>> -/* Provide a symbol to debugger. */ >>> +/* Provide a hidden symbol to debugger. */ >>> + .hidden MEMSET_SYMBOL (__memset, erms) >>> ENTRY (MEMSET_SYMBOL (__memset, erms)) >>> # endif >>> L(stosb): >>> -- >>> 2.17.0 >>> >> >> I am checking it in. >> > > Why is this need only for this symbol in particular and not for all other > ifunc variations? What debugger is missing and does it potentially might > affect other architectures as well? This is specific to memset-vec-unaligned-erms.S. The code looks like function 1 entry: .. ret local label: ... ret function 2 entry: ... jump to local label If "local label" isn't in the symbol table, gdb will think you jump to "function 1" when single-stepping over "jump to local label".
On 07/05/2018 15:31, H.J. Lu wrote: > On Mon, May 7, 2018 at 11:22 AM, Adhemerval Zanella > <adhemerval.zanella@linaro.org> wrote: >> >> >> On 07/05/2018 14:59, H.J. Lu wrote: >>> On Sat, May 5, 2018 at 8:46 AM, H.J. Lu <hongjiu.lu@intel.com> wrote: >>>> When MEMSET_SYMBOL (__memset, erms) is provided for debugger, mark it >>>> as hidden so that it will be local to the library. >>>> >>>> Any comments? >>>> >>>> H.J. >>>> --- >>>> * sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S >>>> (MEMSET_SYMBOL (__memset, erms)): Mark the debugger symbol as >>>> hidden. >>>> --- >>>> sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S | 3 ++- >>>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S b/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S >>>> index d0fe79c9f1..a0560cd5c8 100644 >>>> --- a/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S >>>> +++ b/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S >>>> @@ -131,7 +131,8 @@ END (__memset_chk_erms) >>>> /* Only used to measure performance of REP STOSB. */ >>>> ENTRY (__memset_erms) >>>> # else >>>> -/* Provide a symbol to debugger. */ >>>> +/* Provide a hidden symbol to debugger. */ >>>> + .hidden MEMSET_SYMBOL (__memset, erms) >>>> ENTRY (MEMSET_SYMBOL (__memset, erms)) >>>> # endif >>>> L(stosb): >>>> -- >>>> 2.17.0 >>>> >>> >>> I am checking it in. >>> >> >> Why is this need only for this symbol in particular and not for all other >> ifunc variations? What debugger is missing and does it potentially might >> affect other architectures as well? > > This is specific to memset-vec-unaligned-erms.S. The code looks like > > function 1 entry: > .. > ret > > local label: > ... > ret > > function 2 entry: > ... > jump to local label > > If "local label" isn't in the symbol table, gdb will think you jump to > "function 1" > when single-stepping over "jump to local label". > Right, thanks for the explanation.
diff --git a/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S b/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S index d0fe79c9f1..a0560cd5c8 100644 --- a/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S +++ b/sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S @@ -131,7 +131,8 @@ END (__memset_chk_erms) /* Only used to measure performance of REP STOSB. */ ENTRY (__memset_erms) # else -/* Provide a symbol to debugger. */ +/* Provide a hidden symbol to debugger. */ + .hidden MEMSET_SYMBOL (__memset, erms) ENTRY (MEMSET_SYMBOL (__memset, erms)) # endif L(stosb):