summaryrefslogtreecommitdiff
path: root/rld-elf.cpp
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2012-12-12 21:51:03 +1100
committerChris Johns <chrisj@rtems.org>2012-12-12 21:51:03 +1100
commite735d244c24b606a1d3c9a79ef731de29a7b2ef6 (patch)
treef6ba87f1f51a7255d2da20b46063ba30dab29cb5 /rld-elf.cpp
parent4c10232ae7298504c124c33a8c0dc27c86dad5b5 (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-elf.cpp')
-rw-r--r--rld-elf.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/rld-elf.cpp b/rld-elf.cpp
index 2e1f10e..21962a1 100644
--- a/rld-elf.cpp
+++ b/rld-elf.cpp
@@ -83,14 +83,6 @@ namespace rld
{
}
- std::string
- relocation::name () const
- {
- if (sym)
- return sym->name ();
- return "";
- }
-
elf_addr
relocation::offset () const
{
@@ -115,6 +107,14 @@ namespace rld
return addend_;
}
+ const symbols::symbol&
+ relocation::symbol () const
+ {
+ if (sym)
+ return *sym;
+ throw rld::error ("no symbol", "elf:relocation");
+ }
+
section::section (file& file_,
int index_,
const std::string& name_,
@@ -925,6 +925,12 @@ namespace rld
<< " addend:" << erela.r_addend
<< std::endl;
+ /*
+ * The target section is updated with the fix up, and symbol
+ * section indicates the section offset being referenced by the
+ * fixup.
+ */
+
const symbols::symbol& sym = get_symbol (GELF_R_SYM (erela.r_info));
relocation reloc (sym,