2014-05-11 18:28 GMT+02:00 Petr Machata <[email protected]>:

> Where does "pwd" come from?  What does "file $(which pwd) ./ltrace" say?
> Why I'm asking: you aren't cross-compiling and then running ltrace on
> native pwd, are you?
>

root@raspberrypi:/home/pi/src/ltrace# file $(which pwd) ./ltrace
/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
./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

I am compiling directly on arm machine (raspbian run on Quemu).


If ELF_C_READ_MMAP is not available, just replace it with ELF_C_READ.
>
> Build it:
> $ gcc that-file.c -lelf -Wall
>
> And use it like:
> $ ./a.out ./a.out
> $ ./a.out $(which pwd)
> $ ./a.out /dev/null
> a.out: elf.c:19: main: Assertion `scn != ((void *)0)' failed.
>
>
It compiled fine with: ELF_C_READ

root@raspberrypi:/home/pi/src/tmp# ./a.out ./a.out
root@raspberrypi:/home/pi/src/tmp#  ./a.out $(which pwd)
root@raspberrypi:/home/pi/src/tmp# ./a.out /dev/null
a.out: elfTest.c:19: main: Assertion `scn != ((void *)0)' failed.
Aborted
root@raspberrypi:/home/pi/src/tmp# ./a.out /bin/ps
_______________________________________________
Ltrace-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/ltrace-devel

Reply via email to