File ltrace.trunk-r51.patch of Package ltrace
------------------------------------------------------------------------
r51 | pmachata-guest | 2006-07-18 11:06:26 +0000 (Tue, 18 Jul 2006) | 2 lines
Changed paths:
M /ltrace/trunk/ChangeLog
M /ltrace/trunk/elf.c
M /ltrace/trunk/sysdeps/linux-gnu/ppc/arch.h
Compile-time fixes for ppc32.
------------------------------------------------------------------------
---
ChangeLog | 7 +++++++
elf.c | 6 +++---
sysdeps/linux-gnu/ppc/arch.h | 4 +---
3 files changed, 11 insertions(+), 6 deletions(-)
Index: elf.c
===================================================================
--- elf.c.orig
+++ elf.c
@@ -475,7 +475,7 @@ struct library_symbol *read_elf(struct p
add_library_symbol(addr, name, &library_symbols,
(PLTS_ARE_EXECUTABLE(lte)
? LS_TOPLT_EXEC : LS_TOPLT_POINT),
- ELF64_ST_BIND(sym.st_info) != 0);
+ ELF64_ST_BIND(sym.st_info) == STB_WEAK);
if (!lib_tail)
lib_tail = &(library_symbols->next);
}
@@ -487,7 +487,7 @@ struct library_symbol *read_elf(struct p
already there. */
main_cheat = (struct opt_x_t *)malloc(sizeof(struct opt_x_t));
if (main_cheat == NULL)
- error(EXIT_FAILURE, 0, "Couldn allocate memory");
+ error(EXIT_FAILURE, 0, "Couldn't allocate memory");
main_cheat->next = opt_x;
main_cheat->found = 0;
main_cheat->name = PLTs_initialized_by_here;
@@ -536,7 +536,7 @@ struct library_symbol *read_elf(struct p
if (strcmp(xptr->name, PLTs_initialized_by_here) == 0) {
if (lte->ehdr.e_entry) {
add_library_symbol (
- elf_plt2addr (lte, (void*)(long)
+ opd2addr (lte, (void*)(long)
lte->ehdr.e_entry),
PLTs_initialized_by_here,
lib_tail, 1, 0);
Index: ChangeLog
===================================================================
--- ChangeLog.orig
+++ ChangeLog
@@ -1,5 +1,12 @@
2006-07-18 Petr Machata <pmachata@redhat.com>
+ * elf.c: replace nonexistant elf_plt2addr with opd2addr, fix
+ typo, and fix WEAK symbol detection
+ * sysdeps/linux-gnu/ppc/arch.h: define breakpoint instruction,
+ its length, etc., also on ppc32
+
+2006-07-18 Petr Machata <pmachata@redhat.com>
+
* elf.c: support .gnu.hash ELF entry
* elf.h: likewise
Index: sysdeps/linux-gnu/ppc/arch.h
===================================================================
--- sysdeps/linux-gnu/ppc/arch.h.orig
+++ sysdeps/linux-gnu/ppc/arch.h
@@ -7,6 +7,7 @@
#ifdef __powerpc64__ // Says 'ltrace' is 64 bits, says nothing about target.
#define LT_ELFCLASS2 ELFCLASS64
#define LT_ELF_MACHINE2 EM_PPC64
+#endif
#define PLT_REINITALISATION_BP "_start"
@@ -16,6 +17,3 @@
#if (PPC_NOP_LENGTH != BREAKPOINT_LENGTH)
#error "Length of the breakpoint value not equal to the length of a nop instruction"
#endif
-
-
-#endif