From c43192c46bb1759bf6909190b89d3b60918777c5 Mon Sep 17 00:00:00 2001 From: Wenlin Kang Date: Wed, 23 Mar 2016 16:35:48 +0800 Subject: 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. Signed-off-by: Wenlin Kang Signed-off-by: Richard Purdie --- scripts/relocate_sdk.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py index 992db5c47d..ceca1f2563 100755 --- a/scripts/relocate_sdk.py +++ b/scripts/relocate_sdk.py @@ -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)) -- cgit 1.2.3-korg