This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Use 'M' and 'S' in section string instead of 'm' and 's'


Hi!

's' in .section foo, "s" is supposed to be SHF_IA_64_SMALL_DATA according to
Richard, which clashes with use of "s" for SHF_STRINGS.
The following patch uses 'M' for SHF_MERGE, 'S' for SHF_STRINGS but
for compatibility recognizes "am" and "ams" too (SHF_STRINGS has no sense
without SHF_MERGE and if somebody wants to use SHF_MERGE and
SHF_IA_64_SMALL_DATA at the same time "Ms" should be used.
Ok to commit or should I keep the 'm' compatibility support as RH specific
patch (where gcc uses "am" and "ams" for a few months now)?

2001-09-10  Jakub Jelinek  <jakub@redhat.com>

	* config/obj-elf.c (obj_elf_parse_section_letters): Use 'M' instead
	of 'm', 'S' instead of 's'. Support "m" and "ms" for compatibility.

--- gas/config/obj-elf.c.jj	Thu Aug 23 13:06:46 2001
+++ gas/config/obj-elf.c	Mon Sep 10 22:35:18 2001
@@ -750,15 +750,24 @@ obj_elf_parse_section_letters (str, len)
 	case 'x':
 	  attr |= SHF_EXECINSTR;
 	  break;
-	case 'm':
+	case 'M':
 	  attr |= SHF_MERGE;
 	  break;
-	case 's':
+	case 'S':
 	  attr |= SHF_STRINGS;
 	  break;
+	/* Compatibility.  */
+	case 'm':
+	  attr |= SHF_MERGE;
+	  if (len > 1 && str[1] == 's')
+	    {
+	      attr |= SHF_STRINGS;
+	      str++, len--;
+	    }
+	  break;
 	default:
 	  {
-	    char *bad_msg = _("Unrecognized .section attribute: want a,m,s,w,x");
+	    char *bad_msg = _("Unrecognized .section attribute: want a,w,x,M,S");
 #ifdef md_elf_section_letter
 	    int md_attr = md_elf_section_letter (*str, &bad_msg);
 	    if (md_attr >= 0)

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]