public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PR11601, Solaris assembler compatibility doesn't work
@ 2023-05-18  2:52 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-05-18  2:52 UTC (permalink / raw)
  To: binutils

Well, it doesn't work on x86 or ppc, which both have # starting
comments anywhere on a line.  I think it is therefore only useful on
sparc.

	PR 11601
	* config/obj-elf.c (obj_elf_section_word): Only compile for sparc.
	(obj_elf_section): Only support solaris .section directive on
	sparc.
	* doc/as.texi (Section): Mention that solaris .section
	directive is only supported for sparc.

diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index a4cf12b144a..bf3ef541ab7 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -974,6 +974,7 @@ obj_elf_section_type (char *str, size_t len, bool warn)
   return 0;
 }
 
+#ifdef TC_SPARC
 static bfd_vma
 obj_elf_section_word (char *str, size_t len, int *type)
 {
@@ -1006,6 +1007,7 @@ obj_elf_section_word (char *str, size_t len, int *type)
 
   return 0;
 }
+#endif
 
 /* Get name of section.  */
 const char *
@@ -1388,6 +1390,7 @@ obj_elf_section (int push)
 		input_line_pointer = save;
 	    }
 	}
+#ifdef TC_SPARC
       else
 	{
 	  do
@@ -1413,6 +1416,7 @@ obj_elf_section (int push)
 	  while (*input_line_pointer++ == ',');
 	  --input_line_pointer;
 	}
+#endif
     }
 
  done:
diff --git a/gas/doc/as.texi b/gas/doc/as.texi
index ea40a9ed75e..ea18df24b14 100644
--- a/gas/doc/as.texi
+++ b/gas/doc/as.texi
@@ -6958,7 +6958,7 @@ the section name is not recognized, the default will be for the section to have
 none of the above flags: it will not be allocated in memory, nor writable, nor
 executable.  The section will contain data.
 
-For ELF targets, the assembler supports another type of @code{.section}
+For SPARC ELF targets, the assembler supports another type of @code{.section}
 directive for compatibility with the Solaris assembler:
 
 @smallexample

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-18  2:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-18  2:52 PR11601, Solaris assembler compatibility doesn't work Alan Modra

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).