[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/26389] New: nm print "c" for a common symbol with -flto an

From: mliska at suse dot cz
Subject: [Bug binutils/26389] New: nm print "c" for a common symbol with -flto and -fcommon
Date: Fri, 14 Aug 2020 10:23:06 +0000


            Bug ID: 26389
           Summary: nm print "c" for a common symbol with -flto and
           Product: binutils
           Version: 2.34
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: mliska at suse dot cz
  Target Milestone: ---

Starting from Alan's 49d9fd42acefc1c0ee282b5808874a1074bf1ecd, the following

$ cat conf.c
char nm_test_var;

$ gcc -flto -fcommon -c conf.c
$ ./binutils/nm-new conf.o
00000000 c nm_test_var

while before the revision the following is printed:
$ nm conf.o
00000000 C nm_test_var

Note that the "c" value is not supported by libtool and so a configure
detection fails for various packages.

I think we want to print "C" for a common symbol from LTO plugin. So one needs
something like:

 bfd/syms.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bfd/syms.c b/bfd/syms.c
index c1de8ebab1..baa22cfcd9 100644
--- a/bfd/syms.c
+++ b/bfd/syms.c
@@ -653,7 +653,9 @@ bfd_decode_symclass (asymbol *symbol)

   if (symbol->section && bfd_is_com_section (symbol->section))
-      if (symbol->section == bfd_com_section_ptr)
+      if (symbol->section == bfd_com_section_ptr
+         || (symbol->section->name
+             && strcmp (symbol->section->name, "plug") == 0))
        return 'C';
        return 'c';

And, can you please document the "c" in manual page?

You are receiving this mail because:
You are on the CC list for the bug.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]