[PATCH] Readelf patch to group common symbols.

Prafulla Thakare PrafullaT@KPITCummins.com
Mon Dec 13 13:32:00 GMT 2004


Hi,

Please find attached the patch for readelf. This is developed to group
all the 
common symbols from different compilation unit if built in debug mode. 
Switch "--common-symb" or "-P" is added to readelf. The common symbol 
information is derived from .debug_info and symtab section.

It displays the following information about any common symbol: 
1. Name of Common symbol \
2. Basetype 
3. Base_size 
4. Size 
5. Elements (Number of elements if array or one) 
6. Value 

Following is the simple test case:
/***********************************************************************
*********/
//Test.c
int iVar;
int main()
{
return 0;
}
/*
$sh-elf-gcc -g Test.c
$sh-elf-readelf a.out --common-symb 
Output:
Common Symbols List:
Common symbol        Basetype 		Base_size 	Size
Elements  Value
iVar                 int                  4 		 4
1 	    2f24
*/
/***********************************************************************
*********/

Regards,
Prafulla Thakare
KPIT Cummins InfoSystems Ltd.
Pune, India

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free download of GNU based tool-chains for Renesas' SH and H8 Series. 
The following site also offers free technical support to its users. 
Visit http://www.kpitgnutools.com for details. 
Latest versions of KPIT GNU tools are released on Oct 1, 2004.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-------------- next part --------------
A non-text attachment was scrubbed...
Name: comm_sym.patch
Type: application/octet-stream
Size: 22190 bytes
Desc: comm_sym.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20041213/3260aae4/attachment.obj>


More information about the Binutils mailing list