2000-08-11 Kazu Hirata <kazu@hxi.com>
[deliverable/binutils-gdb.git] / ld / ldlang.c
index d40ff07a5b339dcd89422dada5e11e589f84d6f6..c3420c5434c4ebf7ca624235571ee388227a2d90 100644 (file)
@@ -30,11 +30,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "ldgram.h"
 #include "ldexp.h"
 #include "ldlang.h"
-#include "ldemul.h"
 #include "ldlex.h"
 #include "ldmisc.h"
 #include "ldctor.h"
 #include "ldfile.h"
+#include "ldemul.h"
 #include "fnmatch.h"
 #include "demangle.h"
 
@@ -58,7 +58,6 @@ static lang_output_section_statement_type *default_common_section;
 static boolean map_option_f;
 static bfd_vma print_dot;
 static lang_input_statement_type *first_file;
-static lang_statement_list_type lang_output_section_statement;
 static CONST char *current_target;
 static CONST char *output_target;
 static lang_statement_list_type statement_list;
@@ -166,6 +165,7 @@ static char * get_first_input_target PARAMS ((void));
                                        
 /* EXPORTS */
 lang_output_section_statement_type *abs_output_section;
+lang_statement_list_type lang_output_section_statement;
 lang_statement_list_type *stat_ptr = &statement_list;
 lang_statement_list_type file_chain = { NULL, NULL };
 const char *entry_symbol = NULL;
@@ -1196,6 +1196,13 @@ wild_doit (ptr, section, output, file)
       /* If supplied an aligment, then force it.  */
       if (output->section_alignment != -1)
        output->bfd_section->alignment_power = output->section_alignment;
+
+      if (section->flags & SEC_BLOCK)
+        {
+          section->output_section->flags |= SEC_BLOCK;
+          /* FIXME: This value should really be obtained from the bfd... */
+          output->block_value = 128;
+        }
     }
 }
 
@@ -1864,8 +1871,10 @@ open_input_bfds (s, force)
 
              /* If we are being called from within a group, and this
                  is an archive which has already been searched, then
-                 force it to be researched.  */
+                 force it to be researched unless the whole archive
+                has been loaded already.  */
              if (force
+                 && !s->input_statement.whole_archive
                  && s->input_statement.loaded
                  && bfd_check_format (s->input_statement.the_bfd,
                                       bfd_archive))
@@ -3813,7 +3822,7 @@ topower (x)
   return 0;
 }
 
-void
+lang_output_section_statement_type *
 lang_enter_output_section_statement (output_section_statement_name,
                                     address_exp, sectype, block_value,
                                     align, subalign, ebase)
@@ -3861,6 +3870,7 @@ lang_enter_output_section_statement (output_section_statement_name,
                     "section alignment", 0));
 
   os->load_base = ebase;
+  return os;
 }
 
 
This page took 0.023415 seconds and 4 git commands to generate.