diff options
author | Chris Johns <chrisj@rtems.org> | 2012-12-12 21:51:03 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2012-12-12 21:51:03 +1100 |
commit | e735d244c24b606a1d3c9a79ef731de29a7b2ef6 (patch) | |
tree | f6ba87f1f51a7255d2da20b46063ba30dab29cb5 /rld-files.cpp | |
parent | 4c10232ae7298504c124c33a8c0dc27c86dad5b5 (diff) |
Relocation fixes.
These changes implement a suitable relocation output in the image.
The code is still not working 100% but these changes are a big
improvement.
Diffstat (limited to 'rld-files.cpp')
-rw-r--r-- | rld-files.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/rld-files.cpp b/rld-files.cpp index c296ab1..e8b3b17 100644 --- a/rld-files.cpp +++ b/rld-files.cpp @@ -903,11 +903,14 @@ namespace rld } relocation::relocation (const elf::relocation& er) - : name (er.name ()), - offset (er.offset ()), + : offset (er.offset ()), type (er.type ()), info (er.info ()), - addend (er.addend ()) + addend (er.addend ()), + symname (er.symbol ().name ()), + symtype (er.symbol ().type ()), + symsect (er.symbol ().section_index ()), + symvalue (er.symbol ().value ()) { } @@ -923,13 +926,11 @@ namespace rld offset (es.offset ()), rela (es.get_reloc_type ()) { - load_relocations (es); } void section::load_relocations (const elf::section& es) { - rela = es.get_reloc_type (); const elf::relocations& es_relocs = es.get_relocations (); for (elf::relocations::const_iterator ri = es_relocs.begin (); ri != es_relocs.end (); @@ -937,6 +938,7 @@ namespace rld { relocs.push_back (relocation (*ri)); } + rela = es.get_reloc_type (); } size_t |