summaryrefslogtreecommitdiff
path: root/linkers
diff options
context:
space:
mode:
authorPeng Fan <van.freenix@gmail.com>2013-07-18 10:49:09 +0800
committerPeng Fan <van.freenix@gmail.com>2013-07-19 07:34:14 +0800
commit4b31ced3e125101d85acbcce8566775bcfdeb46d (patch)
treed0d3399447c4ad9b9f497550e8f84af5ffbfc2c6 /linkers
parentf4cf8f47b19c20a894810108bcb2250d96661cca (diff)
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 <van.freenix@gmail.com>
Diffstat (limited to 'linkers')
-rw-r--r--linkers/rld-rap.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/linkers/rld-rap.cpp b/linkers/rld-rap.cpp
index 8b3bbcb..590d31e 100644
--- a/linkers/rld-rap.cpp
+++ b/linkers/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);