* ld.texinfo: Document new -z lazy option.
[deliverable/binutils-gdb.git] / ld / emultempl / pe.em
index df7692d680c169052d99cc8a1306482dc00d2882..33ac71e5460169654846bb761784edb5dd4f9162 100644 (file)
@@ -1,5 +1,6 @@
 # This shell script emits a C file. -*- C -*-
 # It does some substitutions.
+test -z "${ENTRY}" && ENTRY="_mainCRTStartup"
 if [ -z "$MACHINE" ]; then
   OUTPUT_ARCH=${ARCH}
 else
@@ -143,6 +144,8 @@ gld_${EMULATION_NAME}_before_parse (void)
 #else
   lang_default_entry ("_WinMainCRTStartup");
 #endif
+#else
+  lang_default_entry ("${ENTRY}");
 #endif
 #endif
 }
@@ -280,7 +283,7 @@ static definfo init[] =
   D(MajorImageVersion,"__major_image_version__", 1),
   D(MinorImageVersion,"__minor_image_version__", 0),
 #ifdef TARGET_IS_armpe
-  D(MajorSubsystemVersion,"__major_subsystem_version__", 2),
+  D(MajorSubsystemVersion,"__major_subsystem_version__", 3),
 #else
   D(MajorSubsystemVersion,"__major_subsystem_version__", 4),
 #endif
@@ -1515,7 +1518,7 @@ gld_${EMULATION_NAME}_finish (void)
    sort_sections.  */
 
 static bfd_boolean
-gld_${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s)
+gld_${EMULATION_NAME}_place_orphan (asection *s)
 {
   const char *secname;
   const char *orig_secname;
@@ -1552,7 +1555,7 @@ gld_${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s
         If the section already exists but does not have any flags set,
         then it has been created by the linker, probably as a result of
         a --section-start command line switch.  */
-      lang_add_section (&add_child, s, os, file);
+      lang_add_section (&add_child, s, os);
     }
   else
     {
@@ -1618,7 +1621,7 @@ gld_${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s
            place->os = lang_output_section_find (place->name);
          after = place->os;
          if (after == NULL)
-           after = lang_output_section_find_by_flags (s, &place->os);
+           after = lang_output_section_find_by_flags (s, &place->os, NULL);
          if (after == NULL)
            /* *ABS* is always the first output section statement.  */
            after = (&lang_output_section_statement.head
@@ -1638,8 +1641,7 @@ gld_${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s
 
       /* All sections in an executable must be aligned to a page boundary.  */
       address = exp_unop (ALIGN_K, exp_nameop (NAME, "__section_alignment__"));
-      os = lang_insert_orphan (file, s, secname, after, place, address,
-                              &add_child);
+      os = lang_insert_orphan (s, secname, after, place, address, &add_child);
     }
 
   {
@@ -1662,7 +1664,7 @@ gld_${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s
 
            ls = &(*pl)->input_section;
 
-           lname = bfd_get_section_name (ls->ifile->the_bfd, ls->section);
+           lname = bfd_get_section_name (ls->section->owner, ls->section);
            if (strchr (lname, '$') == NULL)
              {
                if (found_dollar)
This page took 0.025087 seconds and 4 git commands to generate.