This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH/RFA]: readelf displays values of special symbol types
- From: Hiroyuki Machida <machida at sm dot sony dot co dot jp>
- To: binutils at sources dot redhat dot com
- Date: Mon, 04 Nov 2002 23:38:31 +0900 (JST)
- Subject: [PATCH/RFA]: readelf displays values of special symbol types
Hi,
The attached patch enable READELF to display PROCESSOR-specific,
OS-specific, reserved and unknown symbol type values.
The attached patch is against 2002-09-05 version of READELF.
For exsample , without this, you can't distinguish SHN_MIPS_TEXT and
SHN_MIPS_DATA for IRIX binaries.
[binutils]
* readelf.c (get_symbol_index_type): Add hex number
to PROCESSOR-specific, OS-specific, reserved and unknown
symbol type.
*** readelf.c.orig Tue Sep 10 18:13:21 2002
--- readelf.c Wed Sep 11 14:13:15 2002
*************** get_symbol_index_type (type)
*** 5489,5504 ****
case SHN_COMMON: return "COM";
default:
if (type >= SHN_LOPROC && type <= SHN_HIPROC)
! return "PRC";
else if (type >= SHN_LOOS && type <= SHN_HIOS)
! return "OS ";
else if (type >= SHN_LORESERVE && type <= SHN_HIRESERVE)
! return "RSV";
else
{
static char buff [32];
! sprintf (buff, "%3d", type);
return buff;
}
}
--- 5489,5519 ----
case SHN_COMMON: return "COM";
default:
if (type >= SHN_LOPROC && type <= SHN_HIPROC)
! {
! static char buff [32];
!
! sprintf(buff, "PRC[0x%04x]", type);
! return buff;
! }
else if (type >= SHN_LOOS && type <= SHN_HIOS)
! {
! static char buff [32];
!
! sprintf(buff, "OS [0x%04x]", type);
! return buff;
! }
else if (type >= SHN_LORESERVE && type <= SHN_HIRESERVE)
! {
! static char buff [32];
!
! sprintf(buff, "RSV[0x%04x]", type);
! return buff;
! }
else
{
static char buff [32];
! sprintf (buff, "0x%04x", type);
return buff;
}
}