OSDN Git Service

* config/obj-elf.c (obj_elf_change_section): Make non-static.
authorscox <scox>
Sat, 17 Aug 2002 15:09:29 +0000 (15:09 +0000)
committerscox <scox>
Sat, 17 Aug 2002 15:09:29 +0000 (15:09 +0000)
config/tc-mips.c (s_change_section): New function to support
IRIX .section pseudo-op.

gas/ChangeLog
gas/config/obj-elf.c
gas/config/tc-mips.c

index 1b92555..c865ccd 100644 (file)
@@ -1,3 +1,9 @@
+2002-08-17  Stan Cox  <scox@redhat.com>
+
+       * config/obj-elf.c (obj_elf_change_section): Make non-static.
+       config/tc-mips.c (s_change_section): New function to support
+       IRIX .section pseudo-op.
+
 2002-08-16  Nick Clifton  <nickc@redhat.com>
 
        * config/tc-v850.c (md_assemble): Fix assembling of "callt 0x3f".
index 2266952..375dcff 100644 (file)
@@ -77,7 +77,7 @@ static void obj_elf_ident PARAMS ((int));
 static void obj_elf_weak PARAMS ((int));
 static void obj_elf_local PARAMS ((int));
 static void obj_elf_visibility PARAMS ((int));
-static void obj_elf_change_section
+void obj_elf_change_section
   PARAMS ((const char *, int, int, int, const char *, int, int));
 static int obj_elf_parse_section_letters PARAMS ((char *, size_t));
 static int obj_elf_section_word PARAMS ((char *, size_t));
@@ -664,7 +664,7 @@ static struct special_section const special_sections[] =
   { NULL,      0,              0                               }
 };
 
-static void
+void
 obj_elf_change_section (name, type, attr, entsize, group_name, linkonce, push)
      const char *name;
      int type;
index c548dde..771869c 100644 (file)
@@ -744,6 +744,7 @@ static symbolS *get_symbol PARAMS ((void));
 static void mips_align PARAMS ((int to, int fill, symbolS *label));
 static void s_align PARAMS ((int));
 static void s_change_sec PARAMS ((int));
+static void s_change_section PARAMS ((int));
 static void s_cons PARAMS ((int));
 static void s_float_cons PARAMS ((int));
 static void s_mips_globl PARAMS ((int));
@@ -883,6 +884,7 @@ static const pseudo_typeS mips_pseudo_table[] =
   {"long", s_cons, 2},
   {"octa", s_cons, 4},
   {"quad", s_cons, 3},
+  {"section", s_change_section, 0},
   {"short", s_cons, 1},
   {"single", s_float_cons, 'f'},
   {"stabn", s_mips_stab, 'n'},
@@ -11247,6 +11249,61 @@ s_change_sec (sec)
 
   auto_align = 1;
 }
+  
+void
+s_change_section (ignore)
+     int ignore ATTRIBUTE_UNUSED;
+{
+  expressionS rep_exp;
+  
+  char *section_name;
+  char c;
+  char *next_c;
+  char *p;
+  int section_type;
+  int section_flag;
+  int section_entry_size;
+  int section_alignment;
+  int log = -1;
+  flagword flags;
+  
+  section_name = input_line_pointer;
+  c = get_symbol_end ();
+  next_c = input_line_pointer + 1;
+  /* just after name is now '\0' */
+  p = input_line_pointer;
+
+  /* Do we have .section Name<,"flags">  */
+  if (c == '\n' || (c == ',' && *next_c == '"') || c == '"')
+    {
+      *p = c;
+      input_line_pointer = section_name;
+      obj_elf_section (ignore);
+      return;
+    }
+  input_line_pointer++;
+
+  /* Do we have .section Name<,type><,flag><,entry_size><,alignment>  */
+  if (c == ',')
+    section_type = get_absolute_expression ();
+  else
+    section_type = 0;
+  if (*input_line_pointer++ == ',')
+    section_flag = get_absolute_expression ();
+  else
+    section_flag = 0;
+  if (*input_line_pointer++ == ',')
+    section_entry_size = get_absolute_expression ();
+  else
+    section_entry_size = 0;
+  if (*input_line_pointer++ == ',')
+    section_alignment = get_absolute_expression ();
+  else
+    section_alignment = 0;
+
+  obj_elf_change_section (section_name, section_type, section_flag,
+                         section_entry_size, 0, 0, 0);
+}
 
 void
 mips_enable_auto_align ()