Handle new v9 insn argument codes, and delete support for obsolete ones.
[deliverable/binutils-gdb.git] / ld / relax.c
index 5500f5e0f4116167dc48595428b4127a962484ec..5738b5bddb1b6f997a7f10e9dcf4a8b4173a2f0d 100644 (file)
@@ -21,15 +21,15 @@ Tie together all the interseting blocks
 #include "ldmisc.h"
 #include "ldsym.h"
 #include "ldgram.h"
-
+#include "relax.h"
 static void
 DEFUN(build_it,(statement),
       lang_statement_union_type *statement)
 {
   switch (statement->header.type) {
-  case lang_fill_statement_enum: 
-      {
 #if 0
+    {
+
       bfd_byte play_area[SHORT_SIZE];
       unsigned int i;
       bfd_putshort(output_bfd, statement->fill_statement.fill, play_area);
@@ -56,14 +56,15 @@ DEFUN(build_it,(statement),
                                   1);
 
        }
-#endif
+
+      abort();
     }
     break;
+#endif
   case lang_data_statement_enum:
-    {
-abort();
-      
 #if 0
+    {
+
       bfd_vma value = statement->data_statement.value;
       bfd_byte play_area[LONG_SIZE];
       unsigned int size = 0;
@@ -89,15 +90,16 @@ abort();
                               size);
                               
                               
-#endif
 
     }
+#endif
     break;
   case lang_input_section_enum:
+    {
+      /* Create a new seclet in the output section with this
+        attached */
+      if (statement->input_section.ifile->just_syms_flag == false) 
       {
-       /* Create a new seclet in the output section with this
-          attached */
-
        asection *i  = statement->input_section.section;
 
        asection *output_section = i->output_section;
@@ -107,13 +109,34 @@ abort();
        seclet->type = bfd_indirect_seclet;
        seclet->u.indirect.section = i;
        seclet->u.indirect.symbols = statement->input_section.ifile->asymbols;
-       seclet->size = bfd_get_section_size_before_reloc(i);
+       seclet->size = i->_cooked_size;
        seclet->offset = i->output_offset;
        seclet->next = 0;
-       
       }
+       
+    }
     break;
+  case lang_padding_statement_enum:
+    /* Make a new seclet with the right filler */
+    {
+      /* Create a new seclet in the output section with this
+        attached */
 
+      bfd_seclet_type *seclet  =
+       bfd_new_seclet(statement->padding_statement.output_section->owner,
+                      statement->padding_statement.output_section);
+       
+      seclet->type = bfd_fill_seclet;
+      seclet->size = statement->padding_statement.size;
+      seclet->offset = statement->padding_statement.output_offset;
+      seclet->u.fill.value = statement->padding_statement.fill;
+      seclet->next = 0;
+    }
+    break;
+
+
+
+    break;
   default:
     /* All the other ones fall through */
     ;
@@ -126,8 +149,9 @@ abort();
 
 
 void 
-DEFUN(write_relaxnorel,(output_bfd),
-      bfd *output_bfd)
+DEFUN(write_relaxnorel,(output_bfd, data),
+      bfd *output_bfd AND
+      PTR data)
 {
 /* Tie up all the statements to generate an output bfd structure which
    bfd can mull over */
@@ -135,7 +159,7 @@ DEFUN(write_relaxnorel,(output_bfd),
 
   lang_for_each_statement(build_it);
 
-  seclet_dump(output_bfd);
+  seclet_dump(output_bfd, data);
 
 }
 
@@ -154,6 +178,10 @@ DEFUN(relax_section,(this_ptr),
 
   lang_input_section_type *is = &((*this_ptr)->input_section);
   asection *i = is->section;
+  if (!(i->owner->flags & BFD_IS_RELAXABLE)) 
+  {
+    einfo("%B: not assembled with -linkrelax\n", i->owner);    
+  }
 
   return bfd_relax_section(i->owner, i, is->ifile->asymbols);
   
This page took 0.024865 seconds and 4 git commands to generate.