[binutils-gdb] ecoff foreign syms

Alan Modra amodra@sourceware.org
Fri Nov 21 23:34:06 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9b7c567507f2f83e62f949a10d27cc60a3261eb2

commit 9b7c567507f2f83e62f949a10d27cc60a3261eb2
Author: Alan Modra <amodra@gmail.com>
Date:   Sat Nov 22 09:07:01 2025 +1030

    ecoff foreign syms
    
    This fixes the alpha-linux-gnuecoff failures exposed by commit
    35e1c33162bf.
    
            * ecoff.c (ecoff_get_extr): Choose better symbol class for
            non-ecoff symbols.

Diff:
---
 bfd/ecoff.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/bfd/ecoff.c b/bfd/ecoff.c
index d22a9145f72..37cfa4a84a4 100644
--- a/bfd/ecoff.c
+++ b/bfd/ecoff.c
@@ -2339,7 +2339,18 @@ ecoff_get_extr (asymbol *sym, EXTR *esym)
       esym->ifd = ifdNil;
       /* FIXME: we can do better than this for st and sc.  */
       esym->asym.st = stGlobal;
-      esym->asym.sc = scAbs;
+      if (bfd_is_und_section (sym->section))
+	esym->asym.sc = scUndefined;
+      else if (bfd_is_com_section (sym->section))
+	esym->asym.sc = scCommon;
+      else if (bfd_is_abs_section (sym->section))
+	esym->asym.sc = scAbs;
+      else if ((sym->section->flags & SEC_HAS_CONTENTS) == 0)
+	esym->asym.sc = scBss;
+      else if ((sym->section->flags & SEC_CODE) != 0)
+	esym->asym.sc = scText;
+      else
+	esym->asym.sc = scData;
       esym->asym.reserved = 0;
       esym->asym.index = indexNil;
       return true;


More information about the Binutils-cvs mailing list