bit-rot in target before_parse function
authorAlan Modra <amodra@gmail.com>
Sun, 22 May 2022 04:30:06 +0000 (14:00 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 26 May 2022 11:04:32 +0000 (20:34 +0930)
Copy initialisation over from the elf.em before_parse.  Commit
ba951afb999 2022-05-03 changed behaviour on arm and score regarding
exec stack.  This patch restores the previous behaviour.

* emultempl/aarch64elf.em (before_parse): Init separate_code,
warn_execstack, no_warn_rwx_segments and default_execstack.
* emultempl/armelf.em (before_parse): Likewise.
* emultempl/scoreelf.em (before_parse): Likewise.
* testsuite/ld-elf/elf.exp (target_defaults_to_execstack): Return
true for arm and nacl.

ld/emultempl/aarch64elf.em
ld/emultempl/armelf.em
ld/emultempl/scoreelf.em
ld/testsuite/ld-elf/elf.exp

index 26e3dd243fc03d53a211b43810c3a5790192eecc..1968f12cf2914d6561888cad90ea6d862968868a 100644 (file)
@@ -54,6 +54,10 @@ fragment <<EOF
 EOF
 fi
 fragment <<EOF
+  link_info.separate_code = DEFAULT_LD_Z_SEPARATE_CODE;
+  link_info.warn_execstack = DEFAULT_LD_WARN_EXECSTACK;
+  link_info.no_warn_rwx_segments = ! DEFAULT_LD_WARN_RWX_SEGMENTS;
+  link_info.default_execstack = DEFAULT_LD_EXECSTACK;
 }
 
 static void
index 885067fa256a97c29837383a7c2c71a021341c43..8f5334df1983fed1955b4887074cb3df35b252a6 100644 (file)
@@ -67,6 +67,10 @@ fragment <<EOF
 EOF
 fi
 fragment <<EOF
+  link_info.separate_code = DEFAULT_LD_Z_SEPARATE_CODE;
+  link_info.warn_execstack = DEFAULT_LD_WARN_EXECSTACK;
+  link_info.no_warn_rwx_segments = ! DEFAULT_LD_WARN_RWX_SEGMENTS;
+  link_info.default_execstack = DEFAULT_LD_EXECSTACK;
 }
 
 static void
index f5dd06246de71a5b96d8fa4964864b39dc4d15e6..d781dd96057c09f2422b447164c5051e67dad7a1 100644 (file)
@@ -47,6 +47,10 @@ fragment <<EOF
 EOF
 fi
 fragment <<EOF
+  link_info.separate_code = DEFAULT_LD_Z_SEPARATE_CODE;
+  link_info.warn_execstack = DEFAULT_LD_WARN_EXECSTACK;
+  link_info.no_warn_rwx_segments = ! DEFAULT_LD_WARN_RWX_SEGMENTS;
+  link_info.default_execstack = DEFAULT_LD_EXECSTACK;
 }
 
 static void
index ebb5ba090bf90e9afd8044b2513809ccd2241726..621d4e121d7442c6921e33c00fd9e07c8a45851b 100644 (file)
@@ -182,8 +182,6 @@ if { [check_gc_sections_available] && ![istarget "v850-*-*"] } {
 
 proc target_defaults_to_execstack {} {
     if {   [istarget "aarch64*-*-*"]
-       || [istarget "arm*-*-*"]
-       || [istarget "*-*-nacl"]
        || [istarget "arc*-*-*"]
        || [istarget "ia64*-*-*"]
        || [istarget "nios2*-*-*"]