<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014-05-11 18:28 GMT+02:00 Petr Machata <span dir="ltr"><<a href="mailto:pmachata@redhat.com" target="_blank">pmachata@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Where does "pwd" come from? What does "file $(which pwd) ./ltrace" say?<br>
Why I'm asking: you aren't cross-compiling and then running ltrace on<br>
native pwd, are you?<br></blockquote><div> </div><div>root@raspberrypi:/home/pi/src/ltrace# file $(which pwd) ./ltrace<br>/bin/pwd: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0xad8a23bf6b271c94903e37c879042ca33a3665d7, stripped<br>
./ltrace: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0xde9004c582f791b80cd155aa282222f853767f77, not stripped<br><br></div><div>I am compiling directly on arm machine (raspbian run on Quemu). <br>
</div><div><br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
If ELF_C_READ_MMAP is not available, just replace it with ELF_C_READ.<br>
<br>
Build it:<br>
$ gcc that-file.c -lelf -Wall<br>
<br>
And use it like:<br>
$ ./a.out ./a.out<br>
$ ./a.out $(which pwd)<br>
$ ./a.out /dev/null<br>
a.out: elf.c:19: main: Assertion `scn != ((void *)0)' failed.<br>
<br>
</blockquote></div><br></div><div class="gmail_extra">It compiled fine with: ELF_C_READ<br><br>root@raspberrypi:/home/pi/src/tmp# ./a.out ./a.out<br>root@raspberrypi:/home/pi/src/tmp# ./a.out $(which pwd)<br>root@raspberrypi:/home/pi/src/tmp# ./a.out /dev/null<br>
a.out: elfTest.c:19: main: Assertion `scn != ((void *)0)' failed.<br>Aborted<br>root@raspberrypi:/home/pi/src/tmp# ./a.out /bin/ps<br><br><br></div></div>