public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Robert Lipe <robertl@dgii.com>
To: egcs@cygnus.com
Subject: proposed sco5.h patch
Date: Tue, 13 Jan 1998 04:52:00 -0000	[thread overview]
Message-ID: <19980113015526.63378@dgii.com> (raw)

The attached patch doesn't seem to cause regressions from the
current version.   It does pave the way for Bruno Haible's 
patch to make exception handling less large.    There are still
issues that Bruno and I are working out, but I think this is 
going to be required regardless of what else we decide.


Tue Jan 13 01:51:45 1998  Robert Lipe   (robertl@dgii.com)

	* sco5.h:  (ASM_OUTPUT_SECTION_NAME) Refresh from ../svr4.h.
		

--- sco5.h__	Mon Jan 12 14:30:15 1998
+++ sco5.h	Mon Jan 12 17:26:59 1998
@@ -508,19 +508,56 @@
 #undef USER_LABEL_PREFIX
 #define USER_LABEL_PREFIX ""
 
+/* 
+ * Compensate for the difference between ELF and COFF assembler syntax.
+ * Otherwise, this is cribbed from ../svr4.h.
+ * We rename 'gcc_except_table' to the shorter name in preparation
+ * for the day when we're ready to do DWARF2 eh unwinding under COFF 
+ */
 #undef ASM_OUTPUT_SECTION_NAME
 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
 do {									\
-  char *snam = NAME ;							\
-  if (strcmp(NAME, ".gcc_except_table") == 0) snam = ".gccexc" ;	\
-  if (TARGET_ELF)							\
-    fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, 		\
-	   (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : 	\
-	   (DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "aw");	\
-  else									\
-    fprintf (FILE, ".section\t%s,\"%s\"\n", snam,			\
-	(DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "x" : 		\
-	(DECL) && DECL_READONLY_SECTION (DECL, RELOC) ? "a" : "w");	\
+  static struct section_info                                            \
+    {                                                                   \
+      struct section_info *next;                                        \
+      char *name;                                                       \
+      enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type;                \
+    } *sections;                                                        \
+  struct section_info *s;                                               \
+  char *mode;                                                           \
+  enum sect_enum type;                                                  \
+  char *sname = NAME ;							\
+  if (strcmp(NAME, ".gcc_except_table") == 0) sname = ".gccexc" ;	\
+                                                                        \
+  for (s = sections; s; s = s->next)                                    \
+    if (!strcmp (NAME, s->name))                                        \
+      break;                                                            \
+                                                                        \
+  if (DECL && TREE_CODE (DECL) == FUNCTION_DECL)                        \
+    type = SECT_EXEC, mode = (TARGET_ELF) ? "ax" : "x" ;                \
+  else if (DECL && DECL_READONLY_SECTION (DECL, RELOC))                 \
+    type = SECT_RO, mode = "a";                                         \
+  else                                                                  \
+    type = SECT_RW, mode = (TARGET_ELF) ? "aw" : "w" ;                  \
+                                                                        \
+  if (s == 0)                                                           \
+    {                                                                   \
+      s = (struct section_info *) xmalloc (sizeof (struct section_info));  \
+      s->name = xmalloc ((strlen (NAME) + 1) * sizeof (*NAME));         \
+      strcpy (s->name, NAME);                                           \
+      s->type = type;                                                   \
+      s->next = sections;                                               \
+      sections = s;                                                     \
+      fprintf (FILE, ".section\t%s,\"%s\"%s\n", sname, mode,		\
+		(TARGET_ELF) ? ",@progbits" : "" );    			\
+    }                                                                   \
+  else                                                                  \
+    {                                                                   \
+      if (DECL && s->type != type)                                      \
+        error_with_decl (DECL, "%s causes a section type conflict");    \
+                                                                        \
+      fprintf (FILE, ".section\t%s\n", sname);                          \
+    }                                                                   \
 } while (0)
 
 #undef ASM_OUTPUT_SKIP


-- 
Robert Lipe       http://www.dgii.com/people/robertl       robertl@dgii.com

             reply	other threads:[~1998-01-13  4:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-13  4:52 Robert Lipe [this message]
1998-01-14  4:17 ` Jeffrey A Law
1998-02-17 16:32 Robert Lipe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19980113015526.63378@dgii.com \
    --to=robertl@dgii.com \
    --cc=egcs@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).