<font><font face="courier new,monospace">This is ok.</font></font><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 21, 2012 at 6:57 AM, Laurentiu Palcu <span dir="ltr">&lt;<a href="mailto:laurentiu.palcu@intel.com" target="_blank">laurentiu.palcu@intel.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When building the SDK, the final .interp section size should be set to a<br>
bigger value (0x1000) in order to be able to change the dynamic loader&#39;s<br>
path later. However, we shouldn&#39;t do that for partial linked objects<br>
(when -r or -rU is used). That&#39;s because those objects will then have an<br>
.interp section of 0x1000 even if it contains no data and when the final<br>
linking is done we will end up with a &quot;cannot move location counter<br>
backwards&quot; error. That&#39;s because the linker will try to squeeze all the data in<br>
the .interp sections found in various partial linked objects into one 0x1000<br>
bytes final .interp section.<br>
<br>
[YOCTO #3264]<br>
<br>
Signed-off-by: Laurentiu Palcu &lt;<a href="mailto:laurentiu.palcu@intel.com">laurentiu.palcu@intel.com</a>&gt;<br>
---<br>
 .../binutils/binutils/relocatable_sdk.patch        |   37 +++++++++++++++++---<br>
 1 file changed, 32 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/meta/recipes-devtools/binutils/binutils/relocatable_sdk.patch b/meta/recipes-devtools/binutils/binutils/relocatable_sdk.patch<br>
index 33f9e68..7408c31 100644<br>
--- a/meta/recipes-devtools/binutils/binutils/relocatable_sdk.patch<br>
+++ b/meta/recipes-devtools/binutils/binutils/relocatable_sdk.patch<br>
@@ -7,15 +7,42 @@ by the relocating script.<br>
<br>
 Signed-off-by: Laurentiu Palcu &lt;<a href="mailto:laurentiu.palcu@intel.com">laurentiu.palcu@intel.com</a>&gt;<br>
<br>
-Index: binutils-2.22/ld/scripttempl/<a href="http://elf.sc" target="_blank">elf.sc</a><br>
+Index: binutils_git/ld/genscripts.sh<br>
 ===================================================================<br>
---- binutils-2.22.orig/ld/scripttempl/<a href="http://elf.sc" target="_blank">elf.sc</a><br>
-+++ binutils-2.22/ld/scripttempl/<a href="http://elf.sc" target="_blank">elf.sc</a><br>
-@@ -116,7 +116,7 @@ if test -n &quot;${COMMONPAGESIZE}&quot;; then<br>
+--- binutils_git.orig/ld/genscripts.sh 2012-11-21 11:58:23.325441925 +0200<br>
++++ binutils_git/ld/genscripts.sh      2012-11-21 12:03:42.106815400 +0200<br>
+@@ -290,6 +290,7 @@<br>
+ LD_FLAG=r<br>
+ DATA_ALIGNMENT=${DATA_ALIGNMENT_r}<br>
+ DEFAULT_DATA_ALIGNMENT=&quot;ALIGN(${SEGMENT_SIZE})&quot;<br>
++PARTIAL_LINKING=&quot; &quot;<br>
+ ( echo &quot;/* Script for ld -r: link without relocation */&quot;<br>
+   . ${CUSTOMIZER_SCRIPT}<br>
+   . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc<br>
+@@ -298,10 +299,12 @@<br>
+ LD_FLAG=u<br>
+ DATA_ALIGNMENT=${DATA_ALIGNMENT_u}<br>
+ CONSTRUCTING=&quot; &quot;<br>
++PARTIAL_LINKING=&quot; &quot;<br>
+ ( echo &quot;/* Script for ld -Ur: link w/out relocation, do create constructors */&quot;<br>
+   . ${CUSTOMIZER_SCRIPT}<br>
+   . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc<br>
+ ) | sed -e &#39;/^ *$/d;s/[       ]*$//&#39; &gt; ldscripts/${EMULATION_NAME}.xu<br>
++unset PARTIAL_LINKING<br>
+<br>
+ LD_FLAG=<br>
+ DATA_ALIGNMENT=${DATA_ALIGNMENT_}<br>
+Index: binutils_git/ld/scripttempl/<a href="http://elf.sc" target="_blank">elf.sc</a><br>
+===================================================================<br>
+--- binutils_git.orig/ld/scripttempl/<a href="http://elf.sc" target="_blank">elf.sc</a>    2012-11-21 12:02:26.800377384 +0200<br>
++++ binutils_git/ld/scripttempl/<a href="http://elf.sc" target="_blank">elf.sc</a> 2012-11-21 12:04:<a href="tel:16.166109621" value="+16166109621">16.166109621</a> +0200<br>
+@@ -124,8 +124,8 @@<br>
+   DATA_SEGMENT_END=&quot;. = DATA_SEGMENT_END (.);&quot;<br>
    DATA_SEGMENT_RELRO_END=&quot;. = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);&quot;<br>
  fi<br>
- if test -z &quot;${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}&quot;; then<br>
+-if test -z &quot;${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}&quot;; then<br>
 -  INITIAL_READONLY_SECTIONS=&quot;.interp       ${RELOCATING-0} : { *(.interp) }&quot;<br>
++if test -z &quot;${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}${PARTIAL_LINKING}&quot;; then<br>
 +  INITIAL_READONLY_SECTIONS=&quot;.interp       ${RELOCATING-0} : { *(.interp); . = 0x1000; }&quot;<br>
  fi<br>
  if test -z &quot;$PLT&quot;; then<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.9.5<br>
<br>
</font></span></blockquote></div><br></div>