bfd/
[deliverable/binutils-gdb.git] / ld / emultempl / ppc64elf.em
index f022a182d73246999a24b051d25c561008edf26d..f64a3d2c2ed20e01e943011b60af060d032d99eb 100644 (file)
@@ -15,7 +15,7 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
 #
 
 # This file is sourced from elf32.em, and defines extra powerpc64-elf
@@ -102,22 +102,22 @@ ppc_before_allocation (void)
 {
   if (stub_file != NULL)
     {
-      if (!no_opd_opt
-         && !ppc64_elf_edit_opd (output_bfd, &link_info, non_overlapping_opd))
+      if (!ppc64_elf_edit_opd (output_bfd, &link_info, no_opd_opt,
+                              non_overlapping_opd))
        einfo ("%X%P: can not edit %s %E\n", "opd");
 
       if (ppc64_elf_tls_setup (output_bfd, &link_info) && !no_tls_opt)
        {
          /* Size the sections.  This is premature, but we want to know the
             TLS segment layout so that certain optimizations can be done.  */
-         lang_size_sections (stat_ptr->head, abs_output_section,
-                             &stat_ptr->head, 0, 0, NULL, TRUE);
+         expld.phase = lang_mark_phase_enum;
+         expld.dataseg.phase = exp_dataseg_none;
+         one_lang_size_sections_pass (NULL, TRUE);
 
          if (!ppc64_elf_tls_optimize (output_bfd, &link_info))
            einfo ("%X%P: TLS problem %E\n");
 
          /* We must not cache anything from the preliminary sizing.  */
-         elf_tdata (output_bfd)->program_header_size = 0;
          lang_reset_memory_regions ();
        }
 
@@ -260,17 +260,7 @@ ppc_layout_sections_again (void)
      add even more stubs.  */
   need_laying_out = 0;
 
-  lang_reset_memory_regions ();
-
-  /* Resize the sections.  */
-  lang_size_sections (stat_ptr->head, abs_output_section,
-                     &stat_ptr->head, 0, 0, NULL, TRUE);
-
-  /* Recalculate TOC base.  */
-  ldemul_after_allocation ();
-
-  /* Do the assignments again.  */
-  lang_do_assignments (stat_ptr->head, abs_output_section, NULL, 0);
+  gld${EMULATION_NAME}_layout_sections_again ();
 }
 
 
@@ -314,7 +304,7 @@ build_section_lists (lang_statement_union_type *statement)
 /* Final emulation specific call.  */
 
 static void
-gld${EMULATION_NAME}_finish (void)
+ppc_finish (void)
 {
   /* e_entry on PowerPC64 points to the function descriptor for
      _start.  If _start is missing, default to the first function
@@ -389,6 +379,7 @@ gld${EMULATION_NAME}_finish (void)
     }
 
   ppc64_elf_restore_symbols (&link_info);
+  finish_default ();
 }
 
 
@@ -576,6 +567,6 @@ PARSE_AND_LIST_ARGS_CASES='
 #
 LDEMUL_BEFORE_ALLOCATION=ppc_before_allocation
 LDEMUL_AFTER_ALLOCATION=gld${EMULATION_NAME}_after_allocation
-LDEMUL_FINISH=gld${EMULATION_NAME}_finish
+LDEMUL_FINISH=ppc_finish
 LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=ppc_create_output_section_statements
 LDEMUL_NEW_VERS_PATTERN=gld${EMULATION_NAME}_new_vers_pattern
This page took 0.025332 seconds and 4 git commands to generate.