summaryrefslogtreecommitdiff
path: root/rld-files.cpp
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2012-11-29 19:02:28 +1100
committerChris Johns <chrisj@rtems.org>2012-11-29 19:02:28 +1100
commit8485a331346f2729c835f03f6bd6939780bccbe5 (patch)
tree0c8f001619ec847291fe724a193714c613e6a76d /rld-files.cpp
parent14ba72fd1b30dfbe8a0635e0ae78a812b1dd4a46 (diff)
Add the index to the section.
The index is referenced in the symbol and relocation records of ELF files therefore we need to search for them.
Diffstat (limited to 'rld-files.cpp')
-rw-r--r--rld-files.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/rld-files.cpp b/rld-files.cpp
index 05f54b3..94508a1 100644
--- a/rld-files.cpp
+++ b/rld-files.cpp
@@ -902,6 +902,7 @@ namespace rld
section::section (const elf::section& es)
: name (es.name ()),
+ index (es.index ()),
type (es.type ()),
size (es.size ()),
alignment (es.alignment ()),
@@ -930,6 +931,22 @@ namespace rld
return size;
}
+ const section*
+ find (const sections& secs, const int index)
+ {
+ for (sections::const_iterator si = secs.begin ();
+ si != secs.end ();
+ ++si)
+ {
+ const section& sec = *si;
+
+ if (index == sec.index)
+ return &sec;
+ }
+
+ return 0;
+ }
+
object::object (archive& archive_, file& name_)
: image (name_),
archive_ (&archive_),