summaryrefslogtreecommitdiff
path: root/rld-elf.cpp
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2012-12-15 22:44:58 +1100
committerChris Johns <chrisj@rtems.org>2012-12-15 22:44:58 +1100
commit7c02253d5df3347a0ff85e43fd2a9dca0955b55f (patch)
tree11712ee20d60770cba1c54031c21be9b2c22e954 /rld-elf.cpp
parentb0133b8592fcfca819f73e8663c3375dc27fb274 (diff)
i386 related fixes
Fix the size of the section calculated in image::lay_out. It did not correctly adjust for alignment. Make the sections being written correctly align.
Diffstat (limited to 'rld-elf.cpp')
-rw-r--r--rld-elf.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/rld-elf.cpp b/rld-elf.cpp
index 21962a1..5abab28 100644
--- a/rld-elf.cpp
+++ b/rld-elf.cpp
@@ -186,6 +186,13 @@ namespace rld
if (!data_)
libelf_error ("elf_getdata: " + name_ + '(' + file_.name () + ')');
}
+
+ if (rld::verbose () >= RLD_VERBOSE_FULL_DEBUG)
+ std::cout << "elf::section: " << name ()
+ << " size=" << size ()
+ << " align=" << shdr.sh_addralign
+ << " flags=0x" << std::hex << flags () << std::dec
+ << std::endl;
}
section::section (const section& orig)
@@ -729,7 +736,6 @@ namespace rld
file::get_sections (sections& filtered_secs, unsigned int type)
{
load_sections ();
- filtered_secs.clear ();
for (section_table::iterator si = secs.begin ();
si != secs.end ();
++si)
@@ -794,11 +800,7 @@ namespace rld
symbols::symbol sym (s, name, esym);
if (rld::verbose () >= RLD_VERBOSE_FULL_DEBUG)
- {
- std::cout << "elf:symbol: ";
- sym.output (std::cout);
- std::cout << std::endl;
- }
+ std::cout << "elf:symbol: " << sym << std::endl;
symbols.push_back (sym);
}
@@ -953,7 +955,7 @@ namespace rld
<< " type:" << GELF_R_TYPE (erel.r_info)
<< std::endl;
- const symbols::symbol& sym = get_symbol (erel.r_info);
+ const symbols::symbol& sym = get_symbol (GELF_R_SYM (erel.r_info));
relocation reloc (sym, erel.r_offset, erel.r_info);