[Ltrace-devel] PIE support

Ian Wienand ianw at gelato.unsw.edu.au
Mon Nov 27 01:55:16 CET 2006


On Fri, Nov 24, 2006 at 05:02:45PM +0100, Petr Machata wrote:
> I've written a PIE (position independent executables) support for
> ltrace.

Thanks!  Is this from Redhat shipping this and stack randomisation by
default for security?

I'm having a play, and I wonder if I'm seeing what you're seeing.

On x86, for example, I don't see it picking up the puts call for a
printf?  And on ia64 it doesn't seem to pick anything up at all, and
breaks the testsuite (I haven't quite figured out why yet -- can
anyone give some pointers for running individual parts of the test
suite and seeing what it is doing?)

-i

---- ia64 ----

ianw at lime:~/programs/ltrace/ltrace/trunk$ ./ltrace /tmp/pie
pie
+++ exited (status 4) +++
ianw at lime:~/programs/ltrace/ltrace/trunk$ ./ltrace /tmp/no-pie
__libc_start_main(0x40000000000008e0, 1, 0x60000fffff987818, 0x40000000000008d0, 0x40000000000008c0 <unfinished ...>
puts(0x40000000000008a0, 0x2000000000040d70, 0x2000000000041890, 0x200000000003cf00, 0x200000000003cc20pie
) = 4
+++ exited (status 4) +++



---- x86 example ----

ianw at jj:/tmp$ cat pie.c
#include <stdio.h>

int main(void)
{
        printf("pie\n");
}
ianw at jj:/tmp$ gcc -o no-pie pie.c
ianw at jj:/tmp$ gcc -pie -o pie pie.c

ianw at jj:~/programs/ltrace-svn/ltrace/trunk$ ./ltrace /tmp/no-pie
[pid 23080] __libc_start_main(0x8048354, 1, 0xbf883734, 0x80483d0, 0x8048380 <unfinished ...>
[pid 23080] puts(0x8048488, 0xbf8836c0, 0xbf883708, 0xb7e15ea8, 0pie
)                                      = 4
[pid 23080] +++ exited (status 4) +++

ianw at jj:~/programs/ltrace-svn/ltrace/trunk$ ./ltrace /tmp/pie
[pid 23083] __libc_start_main(0x800005ec, 1, 0xbfd42404, 0x80000670, 0x80000620pie
 <unfinished ...>
[pid 23083] __cxa_finalize(0x80001850, 0x80001834, 0xbfd42348, 0x8000072c, 0xb7ef93a0)                  = 0
[pid 23083] +++ exited (status 4) +++
ianw at jj:~/programs/ltrace-svn/ltrace/trunk$




More information about the Ltrace-devel mailing list