summaryrefslogtreecommitdiff
path: root/rtemstoolkit/rld-elf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rtemstoolkit/rld-elf.cpp')
-rw-r--r--rtemstoolkit/rld-elf.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/rtemstoolkit/rld-elf.cpp b/rtemstoolkit/rld-elf.cpp
index 2d3d090..60ba484 100644
--- a/rtemstoolkit/rld-elf.cpp
+++ b/rtemstoolkit/rld-elf.cpp
@@ -1082,6 +1082,28 @@ namespace rld
return writable;
}
+ size_t
+ file::machine_size () const
+ {
+ size_t bytes;
+ switch (object_class ())
+ {
+ case ELFCLASS64:
+ bytes = sizeof (uint64_t);
+ break;
+ default:
+ bytes = sizeof (uint32_t);
+ break;
+ }
+ return bytes;
+ }
+
+ bool
+ file::is_little_endian () const
+ {
+ return data_type () == ELFDATA2LSB;
+ }
+
void
file::check (const char* where) const
{