<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"><<a href="mailto:laurentiu.palcu@intel.com" target="_blank">laurentiu.palcu@intel.com</a>></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's<br>
path later. However, we shouldn't do that for partial linked objects<br>
(when -r or -rU is used). That'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 "cannot move location counter<br>
backwards" error. That'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 <<a href="mailto:laurentiu.palcu@intel.com">laurentiu.palcu@intel.com</a>><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 <<a href="mailto:laurentiu.palcu@intel.com">laurentiu.palcu@intel.com</a>><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 "${COMMONPAGESIZE}"; 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="ALIGN(${SEGMENT_SIZE})"<br>
++PARTIAL_LINKING=" "<br>
+ ( echo "/* Script for ld -r: link without relocation */"<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=" "<br>
++PARTIAL_LINKING=" "<br>
+ ( echo "/* Script for ld -Ur: link w/out relocation, do create constructors */"<br>
+ . ${CUSTOMIZER_SCRIPT}<br>
+ . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc<br>
+ ) | sed -e '/^ *$/d;s/[ ]*$//' > 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=". = DATA_SEGMENT_END (.);"<br>
DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"<br>
fi<br>
- if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then<br>
+-if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then<br>
- INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }"<br>
++if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}${PARTIAL_LINKING}"; then<br>
+ INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp); . = 0x1000; }"<br>
fi<br>
if test -z "$PLT"; then<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.9.5<br>
<br>
</font></span></blockquote></div><br></div>