From 2a5f817cb9202efbaa83c2b6e9808882580fa5d1 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Thu, 18 Jul 2013 10:49:09 +0800 Subject: Fixed layout problem Fixed when only one elf object file is passed to rtems-ld.And fixed the error when one object file has rela relocation records, but the other does not contain relocation records. Signed-off-by: Peng Fan --- rld-rap.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/rld-rap.cpp b/rld-rap.cpp index 8b3bbcb..590d31e 100644 --- a/rld-rap.cpp +++ b/rld-rap.cpp @@ -882,10 +882,21 @@ namespace rld obj.secs[s].set_offset (pobj.secs[s]); sec_size[s] = obj.secs[s].offset + obj.secs[s].size (); sec_align[s] = obj.secs[s].alignment (); - sec_rela[s] = obj.secs[s].rela; + if (obj.secs[s].rela == true) + sec_rela[s] = obj.secs[s].rela; } ++poi; } + else + { + for (int s = 0; s < rap_secs; ++s) + { + sec_size[s] = obj.secs[s].size (); + sec_align[s] = obj.secs[s].alignment (); + if (obj.secs[s].rela == true) + sec_rela[s] = true; + } + } collect_symbols (obj); -- cgit v1.2.3