summaryrefslogtreecommitdiffstats
path: root/linkers
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2018-05-08 15:09:44 +1000
committerChris Johns <chrisj@rtems.org>2018-06-15 15:54:25 +1000
commit8dd3803af1618bcc2734f488988b9106e47024fb (patch)
tree067f287ce90ceacbdcb9cc43394aa05fd13e6401 /linkers
parentrtemstoolkit/elf: Add data size and endian support to the ELF interface. (diff)
downloadrtems-tools-8dd3803af1618bcc2734f488988b9106e47024fb.tar.bz2
linkers/exe-info: Set the data endian for getting the init/fini sec data.
Diffstat (limited to 'linkers')
-rw-r--r--linkers/rtems-exeinfo.cpp11
-rw-r--r--linkers/wscript3
2 files changed, 6 insertions, 8 deletions
diff --git a/linkers/rtems-exeinfo.cpp b/linkers/rtems-exeinfo.cpp
index c79ea94..b0388af 100644
--- a/linkers/rtems-exeinfo.cpp
+++ b/linkers/rtems-exeinfo.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Chris Johns <chrisj@rtems.org>
+ * Copyright (c) 2016-2018, Chris Johns <chrisj@rtems.org>
*
* RTEMS Tools Project (http://www.rtems.org/)
* This file is part of the RTEMS Tools package in 'rtems-tools'.
@@ -171,7 +171,7 @@ namespace rld
section::section (const files::section& sec, files::byteorder byteorder)
: sec (sec),
- data (sec.size),
+ data (sec.size, byteorder == rld::files::little_endian),
byteorder (byteorder)
{
}
@@ -376,12 +376,9 @@ namespace rld
std::cout << label << " sections: " << ifsecs.size () << std::endl;
- for (sections::iterator ii = ifsecs.begin ();
- ii != ifsecs.end ();
- ++ii)
+ for (auto& sec : ifsecs)
{
- section& sec = *ii;
- const size_t machine_size = sizeof (uint32_t);
+ const size_t machine_size = exe.elf ().machine_size ();
const int count = sec.data.level () / machine_size;
std::cout << " " << sec.sec.name << std::endl;
diff --git a/linkers/wscript b/linkers/wscript
index 46c8532..ecb0335 100644
--- a/linkers/wscript
+++ b/linkers/wscript
@@ -56,6 +56,7 @@ def build(bld):
rtemstoolkit = '../rtemstoolkit'
conf['includes'] = [rtemstoolkit,
rtemstoolkit + '/elftoolchain/libelf',
+ rtemstoolkit + '/elftoolchain/libdwarf',
rtemstoolkit + '/elftoolchain/common',
rtemstoolkit + '/libiberty']
if bld.env.DEST_OS == 'win32':
@@ -63,7 +64,7 @@ def build(bld):
conf['warningflags'] = ['-Wall', '-Wextra', '-pedantic']
conf['optflags'] = bld.env.C_OPTS
conf['cflags'] = ['-pipe', '-g'] + conf['optflags']
- conf['cxxflags'] = ['-pipe', '-g'] + conf['optflags']
+ conf['cxxflags'] = ['-pipe', '-g', '--std=c++11'] + conf['optflags']
conf['linkflags'] = ['-g']
#