summaryrefslogtreecommitdiffstats
path: root/scripts/relocate_sdk.py
diff options
context:
space:
mode:
authorRoy Li <rongqing.li@windriver.com>2014-06-17 14:00:26 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-06-17 08:59:21 +0100
commitee0f647a2a38da6dae97770c6f36e6369637844b (patch)
tree2a0bb2e429b43b55c657201b36f9d26706910002 /scripts/relocate_sdk.py
parent9f7d599a190aa9b3ae9aa1a4de28d1e7137f2de6 (diff)
downloadpoky-ee0f647a2a38da6dae97770c6f36e6369637844b.tar.gz
relocate_sdk: Skip to do relocation if the file size is less than 64 byte
When toolchain directory is changed to execute mode, some non-executable files or empty files are sorted. This will lead to the below error: Extracting SDK...done Setting it up...Traceback (most recent call last): File "..._SDK/relocate_sdk.py", line 208, in <module> arch = get_arch() File "..._SDK/relocate_sdk.py", line 39, in get_arch ei_mag0,ei_mag1_3,ei_class = struct.unpack("<B3sB11x", e_ident) struct.error: unpack requires a string argument of length 16 To call get_arch and parse_elf_header, we should ensure the sorted file is bigger than 64 byte. (From OE-Core rev: 3b973f1c9c9ee3fbe64903036ad93eb9e928b185) Signed-off-by: Roy Li <rongqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/relocate_sdk.py')
-rwxr-xr-xscripts/relocate_sdk.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py
index 05d9fd65ed..b2dd258c34 100755
--- a/scripts/relocate_sdk.py
+++ b/scripts/relocate_sdk.py
@@ -224,12 +224,12 @@ for e in executables_list:
224 224
225 # Save old size and do a size check at the end. Just a safety measure. 225 # Save old size and do a size check at the end. Just a safety measure.
226 old_size = os.path.getsize(e) 226 old_size = os.path.getsize(e)
227 227 if old_size >= 64:
228 arch = get_arch() 228 arch = get_arch()
229 if arch: 229 if arch:
230 parse_elf_header() 230 parse_elf_header()
231 change_interpreter(e) 231 change_interpreter(e)
232 change_dl_sysdirs() 232 change_dl_sysdirs()
233 233
234 """ change permissions back """ 234 """ change permissions back """
235 if perms: 235 if perms: