Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1
ltrace
ltrace.trunk-r70.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ltrace.trunk-r70.patch of Package ltrace
------------------------------------------------------------------------ r70 | pmachata-guest | 2006-11-30 13:45:07 +0000 (Thu, 30 Nov 2006) | 3 lines Changed paths: M /ltrace/trunk/ChangeLog M /ltrace/trunk/breakpoints.c M /ltrace/trunk/elf.c M /ltrace/trunk/sysdeps/linux-gnu/ia64/arch.h M /ltrace/trunk/sysdeps/linux-gnu/ppc/arch.h * Patch to fix .opd handling on IA64. * Few cleanups. ------------------------------------------------------------------------ Index: elf.c =================================================================== --- elf.c (revision 69) +++ elf.c (revision 70) @@ -240,11 +240,14 @@ static void do_init_elf(struct ltelf *lt if (shdr.sh_flags & SHF_EXECINSTR) { lte->lte_flags |= LTE_PLT_EXECUTABLE; } - } else if (strcmp(name, ".opd") == 0) { + } +#ifdef ARCH_SUPPORTS_OPD + else if (strcmp(name, ".opd") == 0) { lte->opd_addr = (GElf_Addr *) (long) shdr.sh_addr; lte->opd_size = shdr.sh_size; lte->opd = elf_rawdata(scn, NULL); } +#endif } } @@ -351,13 +354,12 @@ static int in_load_libraries(const char Elf32_Word nbuckets = *hashbase++; Elf32_Word symbias = *hashbase++; Elf32_Word bitmask_nwords = *hashbase++; - Elf32_Word bitmask_idxbits = bitmask_nwords - 1; - Elf32_Word shift = *hashbase++; Elf32_Word * buckets; Elf32_Word * chain_zero; Elf32_Word bucket; - hashbase += lte[i].ehdr.e_ident[EI_CLASS] * bitmask_nwords; + // +1 for skipped `shift' + hashbase += lte[i].ehdr.e_ident[EI_CLASS] * bitmask_nwords + 1; buckets = hashbase; hashbase += nbuckets; chain_zero = hashbase - symbias; @@ -408,6 +410,7 @@ static int in_load_libraries(const char static GElf_Addr opd2addr(struct ltelf *lte, GElf_Addr addr) { +#ifdef ARCH_SUPPORTS_OPD unsigned long base, offset; if (!lte->opd) @@ -419,6 +422,9 @@ static GElf_Addr opd2addr(struct ltelf * error(EXIT_FAILURE, 0, "static plt not in .opd"); return *(GElf_Addr*)(base + offset); +#else //!ARCH_SUPPORTS_OPD + return addr; +#endif } struct library_symbol *read_elf(struct process *proc) Index: ChangeLog =================================================================== --- ChangeLog (revision 69) +++ ChangeLog (revision 70) @@ -1,3 +1,12 @@ +2006-11-30 Petr Machata <pmachata@redhat.com> + + * elf.c (in_load_libraries): removed unused variables + bitmask_idxbits and shift. + * elf.c (do_init_elf, opd2addr): use ARCH_SUPPORTS_OPD to + determine whether to load/use .opd section + * sysdeps/linux-gnu/*/arch.h: define ARCH_SUPPORTS_OPD accordingly + * breakpoints.c (insert_breakpoint): rewrite loop to canonical for + 2006-10-13 Olaf Hering <olh@suse.de> * options.c: fix up typo for config file Index: sysdeps/linux-gnu/ppc/arch.h =================================================================== --- sysdeps/linux-gnu/ppc/arch.h (revision 69) +++ sysdeps/linux-gnu/ppc/arch.h (revision 70) @@ -4,9 +4,11 @@ #define LT_ELFCLASS ELFCLASS32 #define LT_ELF_MACHINE EM_PPC + #ifdef __powerpc64__ // Says 'ltrace' is 64 bits, says nothing about target. #define LT_ELFCLASS2 ELFCLASS64 #define LT_ELF_MACHINE2 EM_PPC64 +#define ARCH_SUPPORTS_OPD #endif #define PLT_REINITALISATION_BP "_start" Index: sysdeps/linux-gnu/ia64/arch.h =================================================================== --- sysdeps/linux-gnu/ia64/arch.h (revision 69) +++ sysdeps/linux-gnu/ia64/arch.h (revision 70) @@ -7,3 +7,7 @@ #define LT_ELFCLASS ELFCLASS64 #define LT_ELF_MACHINE EM_IA_64 + +// ia64 actually does use .opd, but we don't need to do the +// translation manually. +#undef ARCH_SUPPORTS_OPD Index: breakpoints.c =================================================================== --- breakpoints.c (revision 69) +++ breakpoints.c (revision 70) @@ -28,6 +28,7 @@ insert_breakpoint(struct process *proc, struct library_symbol *libsym) { struct breakpoint *sbp; + debug(1, "symbol=%s, addr=%p", libsym?libsym->name:"(nil)", addr); if (!proc->breakpoints) { proc->breakpoints = @@ -165,11 +166,9 @@ void breakpoints_init(struct process *pr } else { proc->list_of_symbols = NULL; } - sym = proc->list_of_symbols; - while (sym) { + for (sym = proc->list_of_symbols; sym; sym = sym->next) { /* proc->pid==0 delays enabling. */ insert_breakpoint(proc, sym2addr(proc, sym), sym); - sym = sym->next; } proc->callstack_depth = 0; proc->breakpoints_enabled = -1;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor