[Ltrace-devel] Fwd: Couldn't get data of section #0 from "/proc/3829/exe": no error

Ciapata Koza ciapatakoza at gmail.com
Tue May 13 11:32:44 UTC 2014


2014-05-11 18:28 GMT+02:00 Petr Machata <pmachata at redhat.com>:

> 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 at 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 at raspberrypi:/home/pi/src/tmp# ./a.out ./a.out
root at raspberrypi:/home/pi/src/tmp#  ./a.out $(which pwd)
root at raspberrypi:/home/pi/src/tmp# ./a.out /dev/null
a.out: elfTest.c:19: main: Assertion `scn != ((void *)0)' failed.
Aborted
root at raspberrypi:/home/pi/src/tmp# ./a.out /bin/ps
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/ltrace-devel/attachments/20140513/65c5a0d2/attachment.html>


More information about the Ltrace-devel mailing list