summaryrefslogtreecommitdiff
path: root/linkers/rtems-ld.cpp
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-09-07 14:31:18 +1000
committerChris Johns <chrisj@rtems.org>2014-09-07 14:31:18 +1000
commitb28e8b311550ba5296c814dfdfa1136517ce00a1 (patch)
treea5bb25c6b7fce436eaba5ba1e574ec5a26123faf /linkers/rtems-ld.cpp
parent32cd4fcc17bbd969410f5f8d165cb7793cce972c (diff)
Refactor the rld-rtems support to remove the globals.
Diffstat (limited to 'linkers/rtems-ld.cpp')
-rw-r--r--linkers/rtems-ld.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/linkers/rtems-ld.cpp b/linkers/rtems-ld.cpp
index cf28937..dfa5c14 100644
--- a/linkers/rtems-ld.cpp
+++ b/linkers/rtems-ld.cpp
@@ -185,6 +185,8 @@ main (int argc, char* argv[])
rld::symbols::table base_symbols;
rld::symbols::table symbols;
rld::symbols::symtab undefined;
+ std::string rtems_path;
+ std::string rtems_arch_bsp;
std::string entry = "rtems";
std::string exit;
std::string output = "a.out";
@@ -195,7 +197,6 @@ main (int argc, char* argv[])
bool map = false;
bool warnings = false;
bool one_file = false;
- bool arch_bsp_load = false;
libpaths.push_back (".");
@@ -311,12 +312,11 @@ main (int argc, char* argv[])
break;
case 'r':
- rld::rtems::path = optarg;
+ rtems_path = optarg;
break;
case 'B':
- rld::rtems::arch_bsp = optarg;
- arch_bsp_load = true;
+ rtems_arch_bsp = optarg;
break;
case '?':
@@ -353,8 +353,13 @@ main (int argc, char* argv[])
/*
* Load the arch/bsp value if provided.
*/
- if (arch_bsp_load)
- rld::rtems::load_cc ();
+ if (!rtems_arch_bsp.empty ())
+ {
+ if (rtems_path.empty ())
+ throw rld::error ("arch/bsp provide and no RTEMS path", "options");
+ rld::rtems::set_path (rtems_path);
+ rld::rtems::set_arch_bsp (rtems_arch_bsp);
+ }
/*
* Load the remaining command line arguments into the cache as object