From: Alan Modra Date: Fri, 21 Nov 2025 22:37:01 +0000 (+1030) Subject: ecoff foreign syms X-Git-Tag: binutils-2_46~857 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b7c567507f2f83e62f949a10d27cc60a3261eb2;p=thirdparty%2Fbinutils-gdb.git 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 --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;