You are not logged in.

#1 2018-06-05 11:30:45

amcinnes
Member
Registered: 2017-01-17
Posts: 4

ltrace doesn't work on executables from Arch packages

I'm having some trouble with ltrace. If I run

ltrace ls

I would expect to see a trace of the library calls that `ls` makes. But instead I just see this:

[angus@squirtle ~]$ ls
foo  hello  hello.c
[angus@squirtle ~]$ ltrace ls
foo  hello  hello.c
+++ exited (status 0) +++

i.e. aside from that `exited` line, `ltrace` isn't giving me any extra output.

My theory is that this is because `ltrace` relies on the binary having a PLT section, and Arch has `-fno-plt` in the default compiler flags (CFLAGS in makepkg.conf).

I confirmed that if I remove `-fno-plt` from makepkg.conf and rebuild coreutils, then `ltrace ls` works.

Is there a way to get `ltrace` working, aside from recompiling the target executables without `-fno-plt`?

Offline

#2 2018-06-06 19:35:29

Awebb
Member
Registered: 2010-05-06
Posts: 6,292

Re: ltrace doesn't work on executables from Arch packages

Maybe assimilating this information might enlighten you: https://blog.packagecloud.io/eng/2016/0 … race-work/

Offline

Board footer

Powered by FluxBB