aboutsummaryrefslogtreecommitdiff
path: root/ld/ldtemplate
diff options
context:
space:
mode:
Diffstat (limited to 'ld/ldtemplate')
-rwxr-xr-xld/ldtemplate9
1 files changed, 7 insertions, 2 deletions
diff --git a/ld/ldtemplate b/ld/ldtemplate
index 54e397e..7dc393d 100755
--- a/ld/ldtemplate
+++ b/ld/ldtemplate
@@ -126,9 +126,12 @@ static char *gld<target>_script_option_Ur =
static char *gld<target>_script_option_r =
#include "<ldtarget>.xr"
;
-static char *gld<target>_script_option_n = /* Used with -n and -N flags. */
+static char *gld<target>_script_option_n = /* Used with -n flag. */
#include "<ldtarget>.xn"
;
+static char *gld<target>_script_option_N = /* Used with -N flag. */
+#include "<ldtarget>.xN"
+;
static char *gld<target>_get_script()
{
@@ -140,7 +143,9 @@ static char *gld<target>_get_script()
if (config.relocateable_output == true) {
return gld<target>_script_option_r;
}
- if (config.magic_demand_paged == false)
+ if (!config.text_read_only)
+ return gld<target>_script_option_N;
+ if (!config.magic_demand_paged)
return gld<target>_script_option_n;
return gld<target>_script;
}