summaryrefslogtreecommitdiffstats
path: root/scripts/relocate_sdk.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/relocate_sdk.py')
-rwxr-xr-xscripts/relocate_sdk.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py
index b2dd258c34..992db5c47d 100755
--- a/scripts/relocate_sdk.py
+++ b/scripts/relocate_sdk.py
@@ -161,7 +161,18 @@ def change_dl_sysdirs():
# write it back
f.seek(sh_offset)
f.write(new_ldsocache_path)
-
+ elif name == b(".gccrelocprefix"):
+ offset = 0
+ while (offset + 4096) <= sh_size:
+ path = f.read(4096)
+ new_path = old_prefix.sub(new_prefix, path)
+ # 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))
+ # write it back
+ f.seek(sh_offset + offset)
+ f.write(new_path)
+ offset = offset + 4096
if sysdirs != "" and sysdirslen != "":
paths = sysdirs.split(b("\0"))
sysdirs = b("")