This patch was accidently left out of the previous e-mail. use_starup.patch: Allows ppc64 ltrace to work with target-programs that have been stripped.
-=# Paul #=-
Index: elf.c =================================================================== RCS file: /cvsroot/ltrace/ltrace/elf.c,v retrieving revision 1.8 diff -a -u -r1.8 elf.c --- elf.c 20 Dec 2005 00:40:08 -0000 1.8 +++ elf.c 22 Dec 2005 19:33:54 -0000 @@ -446,8 +446,15 @@ } for (xptr=opt_x; xptr; xptr=xptr->next) if (xptr->name) - fprintf (stderr, "Warning: Couldn't get symbol \"%s\" from \"%s\" or it's a duplicate", + { + if (strcmp(xptr->name, E_ENTRY_NAME) == 0) + add_library_symbol (elf_plt2addr(lte, (void*)lte->ehdr.e_entry), + "_start", lib_tail, 1); + else + fprintf (stderr, "Warning: Couldn't get symbol \"%s\" " + "from \"%s\" or it's a duplicate", xptr->name, proc->filename); + } for (i = 0; i < library_num + 1; ++i) do_close_elf (<e[i]); Index: sysdeps/linux-gnu/alpha/arch.h =================================================================== RCS file: /cvsroot/ltrace/ltrace/sysdeps/linux-gnu/alpha/arch.h,v retrieving revision 1.3 diff -a -u -r1.3 arch.h --- sysdeps/linux-gnu/alpha/arch.h 26 Jun 2005 18:15:26 -0000 1.3 +++ sysdeps/linux-gnu/alpha/arch.h 22 Dec 2005 19:33:54 -0000 @@ -8,3 +8,4 @@ #define LT_ELF_MACHINE2 EM_FAKE_ALPHA #define PLTs_INIT_BY_HERE NULL +#define E_ENTRY_NAME "_start" Index: sysdeps/linux-gnu/arm/arch.h =================================================================== RCS file: /cvsroot/ltrace/ltrace/sysdeps/linux-gnu/arm/arch.h,v retrieving revision 1.2 diff -a -u -r1.2 arch.h --- sysdeps/linux-gnu/arm/arch.h 26 Jun 2005 18:15:26 -0000 1.2 +++ sysdeps/linux-gnu/arm/arch.h 22 Dec 2005 19:33:54 -0000 @@ -6,3 +6,4 @@ #define LT_ELF_MACHINE EM_ARM #define PLTs_INIT_BY_HERE NULL +#define E_ENTRY_NAME "_start" Index: sysdeps/linux-gnu/i386/arch.h =================================================================== RCS file: /cvsroot/ltrace/ltrace/sysdeps/linux-gnu/i386/arch.h,v retrieving revision 1.2 diff -a -u -r1.2 arch.h --- sysdeps/linux-gnu/i386/arch.h 26 Jun 2005 18:15:26 -0000 1.2 +++ sysdeps/linux-gnu/i386/arch.h 22 Dec 2005 19:33:54 -0000 @@ -6,3 +6,4 @@ #define LT_ELF_MACHINE EM_386 #define PLTs_INIT_BY_HERE NULL +#define E_ENTRY_NAME "_start" Index: sysdeps/linux-gnu/m68k/arch.h =================================================================== RCS file: /cvsroot/ltrace/ltrace/sysdeps/linux-gnu/m68k/arch.h,v retrieving revision 1.2 diff -a -u -r1.2 arch.h --- sysdeps/linux-gnu/m68k/arch.h 26 Jun 2005 18:15:26 -0000 1.2 +++ sysdeps/linux-gnu/m68k/arch.h 22 Dec 2005 19:33:54 -0000 @@ -6,3 +6,4 @@ #define LT_ELF_MACHINE EM_68K #define PLTs_INIT_BY_HERE NULL +#define E_ENTRY_NAME "_start" Index: sysdeps/linux-gnu/ppc/arch.h =================================================================== RCS file: /cvsroot/ltrace/ltrace/sysdeps/linux-gnu/ppc/arch.h,v retrieving revision 1.3 diff -a -u -r1.3 arch.h --- sysdeps/linux-gnu/ppc/arch.h 26 Jun 2005 18:15:26 -0000 1.3 +++ sysdeps/linux-gnu/ppc/arch.h 22 Dec 2005 19:33:54 -0000 @@ -1,6 +1,7 @@ #define BREAKPOINT_VALUE { 0x7f, 0xe0, 0x00, 0x08 } #define BREAKPOINT_LENGTH 4 #define DECR_PC_AFTER_BREAK 0 +#define E_ENTRY_NAME "_start" #define LT_ELFCLASS ELFCLASS32 #define LT_ELF_MACHINE EM_PPC @@ -8,7 +9,7 @@ #define LT_ELFCLASS2 ELFCLASS64 #define LT_ELF_MACHINE2 EM_PPC64 -#define PLTs_INIT_BY_HERE "main" +#define PLTs_INIT_BY_HERE E_ENTRY_NAME #else Index: sysdeps/linux-gnu/s390/arch.h =================================================================== RCS file: /cvsroot/ltrace/ltrace/sysdeps/linux-gnu/s390/arch.h,v retrieving revision 1.2 diff -a -u -r1.2 arch.h --- sysdeps/linux-gnu/s390/arch.h 26 Jun 2005 18:15:26 -0000 1.2 +++ sysdeps/linux-gnu/s390/arch.h 22 Dec 2005 19:33:54 -0000 @@ -12,3 +12,4 @@ #define PLTs_INIT_BY_HERE NULL +#define E_ENTRY_NAME "_start" Index: sysdeps/linux-gnu/sparc/arch.h =================================================================== RCS file: /cvsroot/ltrace/ltrace/sysdeps/linux-gnu/sparc/arch.h,v retrieving revision 1.3 diff -a -u -r1.3 arch.h --- sysdeps/linux-gnu/sparc/arch.h 26 Jun 2005 18:15:26 -0000 1.3 +++ sysdeps/linux-gnu/sparc/arch.h 22 Dec 2005 19:33:54 -0000 @@ -8,3 +8,4 @@ #define LT_ELF_MACHINE2 EM_SPARC32PLUS #define PLTs_INIT_BY_HERE NULL +#define E_ENTRY_NAME "_start" Index: sysdeps/linux-gnu/x86_64/arch.h =================================================================== RCS file: /cvsroot/ltrace/ltrace/sysdeps/linux-gnu/x86_64/arch.h,v retrieving revision 1.3 diff -a -u -r1.3 arch.h --- sysdeps/linux-gnu/x86_64/arch.h 26 Jun 2005 18:15:26 -0000 1.3 +++ sysdeps/linux-gnu/x86_64/arch.h 22 Dec 2005 19:33:54 -0000 @@ -8,6 +8,7 @@ #define LT_ELF_MACHINE2 EM_386 #define PLTs_INIT_BY_HERE NULL +#define E_ENTRY_NAME "_start" /* __NR_fork, __NR_clone, __NR_clone2, __NR_vfork and __NR_execve from asm-i386/unistd.h. */