summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2016-11-28 10:11:10 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2016-11-28 10:11:10 +0000
commit18a30962822a6371092be67b24eccfe583b311a0 (patch)
tree41afce862a4633caea2857e38aab59b78a37dc25
parent63bf01100379127e8ccef9875c75090674c1e620 (diff)
downloadbcm5719-llvm-18a30962822a6371092be67b24eccfe583b311a0.tar.gz
bcm5719-llvm-18a30962822a6371092be67b24eccfe583b311a0.zip
[ELF] - Set Config->SingleRoRx differently. NFC.
Previously Config->SingleRoRx was set in createFiles() and used HasSections. This change moves it to readConfigs at place of common flags handling, and adds logic that sets this flag separatelly from ScriptParser if SECTIONS present. llvm-svn: 288021
-rw-r--r--lld/ELF/Driver.cpp7
-rw-r--r--lld/ELF/LinkerScript.cpp5
2 files changed, 6 insertions, 6 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index f603d5d7335..ab3b77fc2bf 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -530,6 +530,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args) {
Config->PrintGcSections = Args.hasArg(OPT_print_gc_sections);
Config->Relocatable = Args.hasArg(OPT_relocatable);
Config->SaveTemps = Args.hasArg(OPT_save_temps);
+ Config->SingleRoRx = Args.hasArg(OPT_no_rosegment);
Config->Shared = Args.hasArg(OPT_shared);
Config->Target1Rel = getArg(Args, OPT_target1_rel, OPT_target1_abs, false);
Config->Threads = getArg(Args, OPT_threads, OPT_no_threads, true);
@@ -696,12 +697,6 @@ void LinkerDriver::createFiles(opt::InputArgList &Args) {
}
}
- // -no-rosegment is used to avoid placing read only non-executable sections in
- // their own segment. We do the same if SECTIONS command is present in linker
- // script. See comment for computeFlags().
- Config->SingleRoRx =
- Args.hasArg(OPT_no_rosegment) || ScriptConfig->HasSections;
-
if (Files.empty() && ErrorCount == 0)
error("no input files");
}
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 07497f4fcc4..51689c2b011 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -1262,6 +1262,11 @@ void ScriptParser::readSearchDir() {
void ScriptParser::readSections() {
Opt.HasSections = true;
+ // -no-rosegment is used to avoid placing read only non-executable sections in
+ // their own segment. We do the same if SECTIONS command is present in linker
+ // script. See comment for computeFlags().
+ Config->SingleRoRx = true;
+
expect("{");
while (!Error && !consume("}")) {
StringRef Tok = next();
OpenPOWER on IntegriCloud