public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: YunQiang Su <yunqiang.su@cipunited.com>
To: binutils@sourceware.org
Cc: macro@orcam.me.uk, YunQiang Su <yunqiang.su@cipunited.com>
Subject: [PATCH] MIPS: Don't __gnu_lto_slim to .scommon
Date: Mon,  3 Jul 2023 18:36:47 +0800	[thread overview]
Message-ID: <20230703103647.3162351-1-yunqiang.su@cipunited.com> (raw)

The LTO plugin doesn't expect __gnu_lto_slim is marked as COMMON,
and in .scommon section.

Let's skip __gnu_lto_slim when detect symbols that should be moved
to .scommon.

This patch can fix testcase:
	PR ld/15323 (3)
	PR ld/15323 (4)
for MIPS.
---
 bfd/elfxx-mips.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 71f2dc9d779..63742de009c 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -7861,6 +7861,10 @@ _bfd_mips_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
   switch (sym->st_shndx)
     {
     case SHN_COMMON:
+      /* __gnu_lto_slim shouldn't mark as COMMON and move to .scommon:
+	lto plugin doesn't expect so.  */
+      if (strcmp (*namep, "__gnu_lto_slim") == 0)
+	break;
       /* Common symbols less than the GP size are automatically
 	 treated as SHN_MIPS_SCOMMON symbols.  */
       if (sym->st_size > elf_gp_size (abfd)
-- 
2.30.2


             reply	other threads:[~2023-07-03 10:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-03 10:36 YunQiang Su [this message]
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
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=20230703103647.3162351-1-yunqiang.su@cipunited.com \
    --to=yunqiang.su@cipunited.com \
    --cc=binutils@sourceware.org \
    --cc=macro@orcam.me.uk \
    /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).