relocate_sdk: fixed .gccrelocprefix section handling

When fixing paths for .gccrelocprefix section, it will corrupt the next
entry during updating the current one if "new_prefix" length is more
than "DEFAULT_INSTALL_DIR", this problem is obvious on the code, but it's
only found when install sdk onto a net file system.

(From OE-Core rev: c43192c46bb1759bf6909190b89d3b60918777c5)

Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Wenlin Kang 2016-03-23 16:35:48 +08:00 committed by Richard Purdie
parent cc97d57601
commit c3c793b428
1 changed files with 1 additions and 0 deletions

View File

@ -166,6 +166,7 @@ def change_dl_sysdirs():
while (offset + 4096) <= sh_size:
path = f.read(4096)
new_path = old_prefix.sub(new_prefix, path)
new_path = new_path.rstrip(b("\0"))
# pad with zeros
new_path += b("\0") * (4096 - len(new_path))
#print "Changing %s to %s at %s" % (str(path), str(new_path), str(offset))