* ldmain.c (main): Move .text readonly flag fudges from here..
authorAlan Modra <amodra@gmail.com>
Mon, 18 Mar 2002 02:55:51 +0000 (02:55 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 18 Mar 2002 02:55:51 +0000 (02:55 +0000)
* ldlang.c (lang_process): ..to here.

ld/ChangeLog
ld/ldlang.c
ld/ldmain.c

index b85af57f54ae9cef0cccd8e6d4293c9c0da0f04d..fbee9a65a69d8d2efb23771ee838065bffdccb49 100644 (file)
@@ -1,3 +1,8 @@
+2002-03-18  Alan Modra  <amodra@bigpond.net.au>
+
+       * ldmain.c (main): Move .text readonly flag fudges from here..
+       * ldlang.c (lang_process): ..to here.
+
 2002-03-14  Alan Modra  <amodra@bigpond.net.au>
 
        * ldlang.c (lang_check): Remove the word size check added in last
index 4c4d880519506d2281ec288daa7505e18afe4531..b176f2d86cbaf3726c3d9d55fc71a48a0f020f50 100644 (file)
@@ -4198,6 +4198,22 @@ lang_process ()
   /* Find any sections not attached explicitly and handle them.  */
   lang_place_orphans ();
 
+  if (! link_info.relocateable)
+    {
+      /* Look for a text section and set the readonly attribute in it.  */
+      asection *found = bfd_get_section_by_name (output_bfd, ".text");
+
+      if (found != (asection *) NULL)
+       {
+         if (config.text_read_only)
+           found->flags |= SEC_READONLY;
+         else
+           found->flags &= ~SEC_READONLY;
+       }
+    }
+
+  /* Do anything special before sizing sections.  This is where ELF
+     and other back-ends size dynamic sections.  */
   ldemul_before_allocation ();
 
   /* We must record the program headers before we try to fix the
index 0579727289ba0be513bc3971ff05102dbfb67175..221f9d1f39d6606c9cc1a0cf1517f79b17233f32 100644 (file)
@@ -404,20 +404,6 @@ main (argc, argv)
   /* Print error messages for any missing symbols, for any warning
      symbols, and possibly multiple definitions.  */
 
-  if (! link_info.relocateable)
-    {
-      /* Look for a text section and switch the readonly attribute in it.  */
-      asection *found = bfd_get_section_by_name (output_bfd, ".text");
-
-      if (found != (asection *) NULL)
-       {
-         if (config.text_read_only)
-           found->flags |= SEC_READONLY;
-         else
-           found->flags &= ~SEC_READONLY;
-       }
-    }
-
   if (link_info.relocateable)
     output_bfd->flags &= ~EXEC_P;
   else
This page took 0.031301 seconds and 4 git commands to generate.