aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-03-18 02:55:51 +0000
committerAlan Modra <amodra@gmail.com>2002-03-18 02:55:51 +0000
commit862120bdbe9b36aa448b8372b120cd3dada51d14 (patch)
treee38e5e0a750b72bc64445e6060d832c8df2e4d38 /ld
parent1868c04ebae02e64e51631c2614703b4a294be6b (diff)
downloadgdb-862120bdbe9b36aa448b8372b120cd3dada51d14.zip
gdb-862120bdbe9b36aa448b8372b120cd3dada51d14.tar.gz
gdb-862120bdbe9b36aa448b8372b120cd3dada51d14.tar.bz2
* ldmain.c (main): Move .text readonly flag fudges from here..
* ldlang.c (lang_process): ..to here.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/ldlang.c16
-rw-r--r--ld/ldmain.c14
3 files changed, 21 insertions, 14 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index b85af57..fbee9a6 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -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
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 4c4d880..b176f2d 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -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
diff --git a/ld/ldmain.c b/ld/ldmain.c
index 0579727..221f9d1 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -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