public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: YunQiang Su <wzssyqa@gmail.com>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: YunQiang Su <yunqiang.su@cipunited.com>, binutils@sourceware.org
Subject: Re: [PATCH v2] MIPS: Don't move __gnu_lto_slim to .scommon
Date: Thu, 20 Jul 2023 01:26:19 +0800	[thread overview]
Message-ID: <CAKcpw6Wr-Ot+0CBTO722xCVJB1D3r6=zcNk4KTY7xuNVtL6XMw@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2307191549010.58367@angie.orcam.me.uk>

Maciej W. Rozycki <macro@orcam.me.uk> 于2023年7月19日周三 22:55写道:
>
> On Wed, 5 Jul 2023, YunQiang Su wrote:
>
> > > The LTO plugin doesn't expect __gnu_lto_slim is marked as
> > > COMMOM or moved .scommon section.
> > >
> >
> > @Maciej W. Rozycki This is a tiny patch, and I think that it should be
> > in 2.41 release.
> > Any idea?
>
>  What produces this symbol and why is it a common symbol in the first
> place if it's not supposed to?
>

The symbol is produced by GCC LTO, and it has SHN_COMMON, while no
SEC_IS_COMMON flag is set.

When gcc -r -flto, this symbol is collected into .scommon and marked
as SEC_IS_COMMON,
which is rejected by linker.

I have no idea why gcc lto uses SHN_COMMON, while it is used by other
architectures.
That's why I block  `__gnu_lto_slim` out .scommon and SEC_IS_COMMON flag.

See bfd/linker.c (_bfd_generic_link_add_one_symbol):
  else if (bfd_is_com_section (section))
    {
      row = COMMON_ROW;
      if (!bfd_link_relocatable (info)
          && name != NULL
          && name[0] == '_'
          && name[1] == '_'
          && strcmp (name + (name[2] == '_'), "__gnu_lto_slim") == 0)
        _bfd_error_handler
          (_("%pB: plugin needed to handle lto object"), abfd);
    }

>  NB the mail server for your @gmail.com address rejects e-mail coming from
> my system.  Please sort this out with your ISP.
>
>   Maciej



-- 
YunQiang Su

  reply	other threads:[~2023-07-19 17:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-03 10:36 [PATCH] MIPS: Don't " YunQiang Su
2023-07-03 10:50 ` [PATCH v2] MIPS: Don't move " YunQiang Su
2023-07-05  1:42   ` YunQiang Su
2023-07-13  5:39     ` YunQiang Su
2023-07-19 14:55     ` Maciej W. Rozycki
2023-07-19 17:26       ` YunQiang Su [this message]
2023-07-20  9:05         ` Alan Modra
2023-07-20  9:34           ` Maciej W. Rozycki
2023-07-20 11:23             ` Alan Modra
2023-07-20 14:32               ` Maciej W. Rozycki
2023-07-20 22:44                 ` Alan Modra

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

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

  git send-email \
    --in-reply-to='CAKcpw6Wr-Ot+0CBTO722xCVJB1D3r6=zcNk4KTY7xuNVtL6XMw@mail.gmail.com' \
    --to=wzssyqa@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=macro@orcam.me.uk \
    --cc=yunqiang.su@cipunited.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).