unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH v6 1/2] Add declare_object_symbol_alias for assembly codes [BZ #28128]
Date: Tue, 31 Aug 2021 06:26:03 -0700	[thread overview]
Message-ID: <CAMe9rOocmovt1G2hStaVc1ykjUa1jvPEb06cO7jBFLGOtu3h8Q@mail.gmail.com> (raw)
In-Reply-To: <874kb5kcfl.fsf@oldenburg.str.redhat.com>

On Tue, Aug 31, 2021 at 5:48 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu:
>
> > diff --git a/include/libc-symbols.h b/include/libc-symbols.h
> > index d41ecf4384..1678071d77 100644
> > --- a/include/libc-symbols.h
> > +++ b/include/libc-symbols.h
> > @@ -324,14 +324,16 @@ for linking")
> >     This is only necessary when defining something in assembly, or playing
> >     funny alias games where the size should be other than what the compiler
> >     thinks it is.  */
> > -#define declare_symbol_alias(symbol, original, type, size) \
> > -  declare_symbol_alias_1 (symbol, original, type, size)
> >  #ifdef __ASSEMBLER__
> > -# define declare_symbol_alias_1(symbol, original, type, size) \
> > +# define declare_object_symbol_alias(symbol, original, size) \
> > +  declare_object_symbol_alias_1 (symbol, original, size)
> > +# define declare_object_symbol_alias_1(symbol, original, s_size) \
> >     strong_alias (original, symbol); \
> > -   .type C_SYMBOL_NAME (symbol), %##type; \
> > -   .size C_SYMBOL_NAME (symbol), size
> > +   .type C_SYMBOL_NAME (symbol), %object; \
> > +   .size C_SYMBOL_NAME (symbol), s_size
> >  #else /* Not __ASSEMBLER__.  */
> > +# define declare_symbol_alias(symbol, original, type, size) \
> > +  declare_symbol_alias_1 (symbol, original, type, size)
> >  # define declare_symbol_alias_1(symbol, original, type, size) \
> >     asm (".globl " __SYMBOL_PREFIX #symbol \
> >       "\n\t" declare_symbol_alias_1_alias (symbol, original) \
>
> (trimming Cc: list)
>
> This change needs to use ASM_LINE_SEP, otherwise part of the directives
> turn into comments on arc and hppa, leading to ABI breakage.
>
> Something like this:
>
> diff --git a/include/libc-symbols.h b/include/libc-symbols.h
> index 1678071d77..2b47144d6f 100644
> --- a/include/libc-symbols.h
> +++ b/include/libc-symbols.h
> @@ -328,8 +328,8 @@ for linking")
>  # define declare_object_symbol_alias(symbol, original, size) \
>    declare_object_symbol_alias_1 (symbol, original, size)
>  # define declare_object_symbol_alias_1(symbol, original, s_size) \
> -   strong_alias (original, symbol); \
> -   .type C_SYMBOL_NAME (symbol), %object; \
> +   strong_alias (original, symbol) ASM_LINE_SEP \
> +   .type C_SYMBOL_NAME (symbol), %object ASM_LINE_SEP \
>     .size C_SYMBOL_NAME (symbol), s_size
>  #else /* Not __ASSEMBLER__.  */
>  # define declare_symbol_alias(symbol, original, type, size) \
>
> With this change, the expected ABI is produced.

Fixed in the next version.

Thanks.

> Thanks,
> Florian
>


-- 
H.J.

  reply	other threads:[~2021-08-31 13:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30 17:38 [PATCH v6 0/2] Extend struct r_debug to support multiple namespaces H.J. Lu via Libc-alpha
2021-08-30 17:38 ` [PATCH v6 1/2] Add declare_object_symbol_alias for assembly codes [BZ #28128] H.J. Lu via Libc-alpha
2021-08-31 12:48   ` Florian Weimer via Libc-alpha
2021-08-31 13:26     ` H.J. Lu via Libc-alpha [this message]
2021-08-30 17:38 ` [PATCH v6 2/2] Extend struct r_debug to support multiple namespaces H.J. Lu via Libc-alpha
2021-09-06  9:39   ` Florian Weimer via Libc-alpha
2021-09-06 13:19     ` H.J. Lu via Libc-alpha
2021-09-06 14:24       ` Florian Weimer via Libc-alpha
2021-09-06 14:31         ` H.J. Lu via Libc-alpha
2021-09-07 15:18           ` H.J. Lu via Libc-alpha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMe9rOocmovt1G2hStaVc1ykjUa1jvPEb06cO7jBFLGOtu3h8Q@mail.gmail.com \
    --to=libc-alpha@sourceware.org \
    --cc=fweimer@redhat.com \
    --cc=hjl.tools@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).