This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[RFC/PATCH] Setting BSF_FUNCTION in ecoff
- From: Jason Eckhardt <jle at owlnet dot rice dot edu>
- To: <binutils at sources dot redhat dot com>
- Date: Tue, 11 Jun 2002 13:55:20 -0500 (CDT)
- Subject: [RFC/PATCH] Setting BSF_FUNCTION in ecoff
Jason Eckhardt wrote:
>
>I'm working on a binary analyzer which needs to collect
>information about procedures. The tool currently relies on
>checking bfd's BSF_FUNCTION symbol flag to locate these function
>symbols. This seems to work well for every flavor of ELF I've
>tried.
>
>However, for COFF on Alpha (specifically, ecoff-littlealpha),
>function symbols do not have BSF_FUNCTION set. Is this a
>known defect in the ecoff-littlealpha back-end? Or is this
>the expected behavior of all COFF back-ends? If it is the
>expected behavior, is there a simple and reliable way of
>having bfd inform me that a symbol in COFF is a function
>symbol?
>
Following myself up:
In other words, would a naive patch such as the following cause
nuclear holocaust, hell-fire and damnation: (it does what I want,
but no doubt it affects many others -- perhaps negatively).
*** orig.ecoff.c Tue Jun 11 13:29:32 2002
--- ecoff.c Tue Jun 11 13:44:21 2002
*************** ecoff_set_symbol_info (abfd, ecoff_sym,
*** 727,732 ****
--- 727,736 ----
|| ECOFF_IS_STAB (ecoff_sym))
asym->flags |= BSF_DEBUGGING;
}
+
+ if (ecoff_sym->st == stProc || ecoff_sym->st == stStaticProc)
+ asym->flags |= BSF_FUNCTION;
+
switch (ecoff_sym->sc)
{
case scNil: