<div dir="ltr"><div>Hi,</div><div><br></div><div>I am having difficulties to cross-prelink a simple hello world program. Prelinking for my x86 machine works fine (host system) but when using the arm cross-compile toolchain I get the error: </div><div><br></div><div>prelink: bin_arm/hello: Could not parse `/usr/local/sbin//prelink-rtld: error while loading shared libraries: ld-linux.so.3'</div><div><br></div><div>If I understand it correctly then prelink-rtld emulates ld-linux.so but why is it parsed by rtld?</div><div><br></div><div>Here are my files:</div><div><br></div><div># main.cpp</div><div><br></div><div>#include <stdio.h></div><div>#include "world.h"</div><div>int main (int argc, char *argv[])</div><div>{</div><div><span class="" style="white-space:pre"> </span>fprintf(stdout, "hello\n");</div><div><span class="" style="white-space:pre"> </span>World w;</div><div><span class="" style="white-space:pre"> </span>w.Str();</div><div><span class="" style="white-space:pre"> </span>return 0;</div><div>}</div><div><br></div><div><br></div><div># world.cpp</div><div><br></div><div>#include "world.h"</div><div>void World::Str()</div><div>{</div><div><span class="" style="white-space:pre"> </span>fprintf(stdout, "world\n");</div><div>}</div><div><br></div><div><br></div><div># prelink_arm.conf</div><div><br></div><div>-l arm-2012.03/arm-none-linux-gnueabi/libc/lib </div><div>-h arm-2012.03/arm-none-linux-gnueabi/libc/lib </div><div>-l arm-2012.03/arm-none-linux-gnueabi/libc/usr/lib</div><div>-h arm-2012.03/arm-none-linux-gnueabi/libc/usr/lib</div><div><br></div><div><br></div><div># compiling</div><div><br></div><div>../arm-2012.03/bin/arm-none-linux-gnueabi-gcc -Wall -fPIC -shared -Iinclude -o lib_arm/libworld.so src/world.cpp </div><div>arm-2012.03/bin/arm-none-linux-gnueabi-gcc -Wall -Iworld/include -Lworld/lib_arm/ -lworld -o bin_arm/hello src/main.cpp</div><div><br></div><div><br></div><div># prelink-cross</div><div><br></div><div>PATH=/usr/local/sbin prelink --verbose --cache-file=cache/prelink_arm.cache --config-file=prelink_arm.conf --ld-library-path="world/lib_arm;arm-2012.03/arm-none-linux-gnueabi/libc/lib;arm-2012.03/arm-none-linux-gnueabi/libc/usr/lib;" -h bin_arm/hello</div><div><br></div><div><br></div><div>I am sort of stuck. Could you point me in the right direction. What am I missing or doing wrong?</div><div>Thank you.</div><div><br></div><div>Cheers</div><div>Florian</div><div><br></div><div>Ps. I have put together the code on github this would be the "shared-library" branch.</div><div><a href="https://github.com/fnbk/prelink-cross-example">https://github.com/fnbk/prelink-cross-example</a> </div><div><br></div><div>Ps. I posted a similar question on stackoverflow, cross-prelinking but without shared libraries.</div><div><a href="http://stackoverflow.com/q/30849060/5011904">http://stackoverflow.com/q/30849060/5011904</a></div><div><br></div><div> </div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div>
</div>