summaryrefslogtreecommitdiff
path: root/rtemstoolkit/rld-process.cpp
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-10-30 17:55:18 +1100
committerChris Johns <chrisj@rtems.org>2014-10-30 17:55:18 +1100
commitfdb1fe685ab60de784b5f20413fe54cd70a01ff2 (patch)
tree05b75e65b705a08c46220416423d64331a68752e /rtemstoolkit/rld-process.cpp
parentaac294948caf0e0595a32dab8194d090ce3dd1b9 (diff)
linkers: Add base image symbol to ELF object file generation.
This change adds support to the rtems-syms code to generate a suitable ELF object you can link to the base image kernel in the embed mode or you can load with the run-time load mode. The change fixes a bug in the framework where local ELF symbols were being placed in the external symbol table. The external symbol table has been removed and a global, weak and local set of tables is now provided as this is more aligned with the ELF format.
Diffstat (limited to 'rtemstoolkit/rld-process.cpp')
-rw-r--r--rtemstoolkit/rld-process.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/rtemstoolkit/rld-process.cpp b/rtemstoolkit/rld-process.cpp
index bfd6734..e91796f 100644
--- a/rtemstoolkit/rld-process.cpp
+++ b/rtemstoolkit/rld-process.cpp
@@ -271,7 +271,7 @@ namespace rld
{
if (level < (sizeof (buf) - 1))
{
- memset (buf + level, 0, sizeof (buf) - level);
+ ::memset (buf + level, 0, sizeof (buf) - level);
int read = ::read (fd, buf + level, sizeof (buf) - level - 1);
if (read < 0)
throw rld::error (::strerror (errno), "tempfile read:" + _name);
@@ -285,15 +285,14 @@ namespace rld
char* lf = ::strchr (buf, '\n');
int len = level;
if (lf)
- len = lf - &buf[0] + 1;
- if (lf || !reading)
{
- line.append (buf, len);
- level -= len;
+ len = lf - &buf[0] + 1;
+ reading = false;
}
+ line.append (buf, len);
+ level -= len;
if (level)
::memmove (buf, &buf[len], level + 1);
- reading = false;
}
}
}
@@ -354,7 +353,7 @@ namespace rld
{
read_line (line);
++lc;
- if (line.empty ())
+ if (line.empty () && (level == 0))
break;
if (!prefix.empty ())
out << prefix << ": ";