ecoff foreign syms

Alan Modra amodra@gmail.com
Fri Nov 21 23:29:28 GMT 2025


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 --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;

-- 
Alan Modra


More information about the Binutils mailing list