public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Add readelf support for SHN_MIPS_SCOMMON/SHN_MIPS_SUNDEFINED
@ 2006-07-31 15:34 Thiemo Seufer
  2006-08-02  9:13 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Thiemo Seufer @ 2006-07-31 15:34 UTC (permalink / raw)
  To: binutils

Hello All,

the appended patch adds support to readelf to display the mips specific
small common and small undefined sections.

Ok to apply?


Thiemo


2006-07-31  Thiemo Seufer  <ths@mips.com>
            Nigel Stephens  <nigel@mips.com>

	* readelf.c (dump_relocations): Handle MIPS-specific
	SHN_MIPS_SCOMMON and SHN_MIPS_SUNDEFINED. 
	(get_symbol_index_type): Similarly.

Index: binutils/readelf.c
===================================================================
RCS file: /cvs/src/src/binutils/readelf.c,v
retrieving revision 1.344
diff -u -p -r1.344 readelf.c
--- binutils/readelf.c	10 Jul 2006 21:40:24 -0000	1.344
+++ binutils/readelf.c	31 Jul 2006 14:10:48 -0000
@@ -1206,6 +1206,12 @@ dump_relocations (FILE *file,
 			sec_name = "ABS";
 		      else if (psym->st_shndx == SHN_COMMON)
 			sec_name = "COMMON";
+		      else if (elf_header.e_machine == EM_MIPS
+			       && psym->st_shndx == SHN_MIPS_SCOMMON)
+			sec_name = "SCOMMON";
+		      else if (elf_header.e_machine == EM_MIPS
+			       && psym->st_shndx == SHN_MIPS_SUNDEFINED)
+			sec_name = "SUNDEF";
 		      else if (elf_header.e_machine == EM_X86_64
 			       && psym->st_shndx == SHN_X86_64_LCOMMON)
 			sec_name = "LARGE_COMMON";
@@ -6872,6 +6878,12 @@ get_symbol_index_type (unsigned int type
       else if (elf_header.e_machine == EM_X86_64
 	       && type == SHN_X86_64_LCOMMON)
 	return "LARGE_COM";
+      else if (type == SHN_MIPS_SCOMMON
+	       && elf_header.e_machine == EM_MIPS)
+	return "SCOM";
+      else if (type == SHN_MIPS_SUNDEFINED
+	       && elf_header.e_machine == EM_MIPS)
+	return "SUND";
       else if (type >= SHN_LOPROC && type <= SHN_HIPROC)
 	sprintf (buff, "PRC[0x%04x]", type);
       else if (type >= SHN_LOOS && type <= SHN_HIOS)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Add readelf support for SHN_MIPS_SCOMMON/SHN_MIPS_SUNDEFINED
  2006-07-31 15:34 [PATCH] Add readelf support for SHN_MIPS_SCOMMON/SHN_MIPS_SUNDEFINED Thiemo Seufer
@ 2006-08-02  9:13 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2006-08-02  9:13 UTC (permalink / raw)
  To: Thiemo Seufer; +Cc: binutils

Hi Thiemo,

> 2006-07-31  Thiemo Seufer  <ths@mips.com>
>             Nigel Stephens  <nigel@mips.com>
> 
> 	* readelf.c (dump_relocations): Handle MIPS-specific
> 	SHN_MIPS_SCOMMON and SHN_MIPS_SUNDEFINED. 
> 	(get_symbol_index_type): Similarly.

Approved - please apply.

Cheers
   Nick

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-02  9:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-31 15:34 [PATCH] Add readelf support for SHN_MIPS_SCOMMON/SHN_MIPS_SUNDEFINED Thiemo Seufer
2006-08-02  9:13 ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).