Skip to contentSkip to conversation

relocate_sdk.py: new interpreter string was not '\0' terminated

PATCH Applied Denys Dmytriyenko 2 participants 2 messages Feb 8, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 relocate_sdk.py: new interpreter string was not '\0' terminated

From: Laurentiu Palcu <[email protected]>

The problem: SDK binaries were not properly relocated when the SDK was installed into a path that had a length less than the default one. Apparently, there were two problems here: the padding was done wrong (the size of one program header table entry was used instead of the program section size) and the new padded string was not used at all.

[YOCTO #3655]

---
 scripts/relocate_sdk.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/relocate_sdk.py +2 -2
index 637ffe9..74bb7a5 100755
@@ -89,8 +89,8 @@ def change_interpreter():
         if p_type == 3:
             # PT_INTERP section
             f.seek(p_offset)
-            dl_path = new_dl_path + "\0" * (e_phentsize - len(new_dl_path))
-            f.write(new_dl_path)
+            dl_path = new_dl_path + "\0" * (p_filesz - len(new_dl_path))
+            f.write(dl_path)
             break
 
 def change_dl_sysdirs():
Signature · 1 line
1.8.1.2
Applied
#1 lore raw
Quoted 9 lines · Denys Dmytriyenko

From: Laurentiu Palcu <[email protected]>

The problem: SDK binaries were not properly relocated when the SDK was installed into a path that had a length less than the default one. Apparently, there were two problems here: the padding was done wrong (the size of one program header table entry was used instead of the program section size) and the new padded string was not used at all.

[YOCTO #3655]

Merged to danny-next.

Ross