aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
AgeCommit message (Collapse)Author
2014-04-08Merge "Re-add stpcpy call."Christopher Ferris
2014-04-08Merge "ltrace: Fix the mips build."Mohamad Ayyash
2014-04-07ltrace: Fix the mips build.Mohamad Ayyash
1) Fix missing error.h in plt.c. 2) Add a TODO to fix missing relplt_count in mips plt.c. 3) Enforce operator precedence between * and != which is apparently incorrect for the mips compiler. Change-Id: I2d5d925566daf81a0380724bc103570c80e381e7
2014-04-07Re-add stpcpy call.Christopher Ferris
Change-Id: I1e80c3ee1693452f8f1669027fcd0a225e986eb2
2014-04-07ltrace: Get it to build on Android (Android.mk and missing functions)Mohamad Ayyash
- Add Android.mk. - Work around missing stpcpy() and rindex(). Change-Id: Iffdd707b22a84b1a1c6a802574ded05b289cee0a
2014-04-04Add missing #include stdio.hdann frazier
Include stdio.h in files that use fprintf() Signed-off-by: dann frazier <dannf@debian.org>
2014-04-04add missing <stdint.h> includedann frazier
aarch64's fetch.c uses the uintptr_t typedef defined by stdint.h without including it. This doesn't currently cause a build failure because stdint.h is indirectly included via proc.h. Signed-off-by: dann frazier <dannf@debian.org>
2014-02-05Implement aarch64 supportPetr Machata
- IFUNC support is not implemented, the rest works well. The only other failure is in wide char functions, and that occurs on x86_64 as well.
2014-01-10Don't crash untraced calls via PLT in prelinked PPC64 binariesPetr Machata
In prelinked binaries, ltrace has to unprelinks PLT slots in order to catch calls done through PLT. This makes the calls done through these slots invalid, because the special first PLT slot is not initialized, and dynamic linker SIGSEGVs because of this. Ltrace relies on arranging breakpoints such that the dynamic linker is not actually entered, and moves PC around itself to simulate the effects of a call through PLT. Originally, arch_elf_add_plt_entry was called only for symbols that were actually traced. Later this was changed and it's now called for all PLT entries, and the resulting candidate list is filtered afterwards. This gives backends a chance to rename the symbol, as is useful with IRELATIVE PLT calls, where symbol name may not be available at all. But the PPC backend was never updated to reflect this, and unresolved all symbols for which arch_elf_add_plt_entry was called, thus rendering _all_ PLT slots invalid, even those that weren't later procted by breakpoints. Thus calls done through any untraced slots failed. This patch fixes this problem by deferring the unprelinking of PLT slots into the on_install hook of breakpoints.
2014-01-10Type umovebytes properlyPetr Machata
2014-01-10Initialize libsym early in trace.c to help the compiler.Mark Wielaard
GCC 4.4.7 isn't smart enough to realize own_libsym will always be zero when it sees the goto done which might jump over the initialization of libsym. And so will produce a warning like: cc1: warnings being treated as errors trace.c: In function ‘ifunc_ret_hit’: trace.c:1433: error: ‘libsym’ may be used uninitialized in this function
2014-01-10Fix a problem in tracing across fork on PPC64Petr Machata
In order to avoid single-stepping through large portions of the dynamic linker, ltrace remembers at which address the instruction that resolved a PLT slot is. It then puts a breakpoint to this address so that it can fast-forward to that address next time it needs to catch a PLT slot being resolved. When a process is cloned, the pointer to this breakpoint is simply copied over to the new process, instead of being looked up in the new process structures. This patches fixes this.
2013-11-27Support IRELATIVE relocations on s390Petr Machata
2013-11-27On s390{,x}, r2 is scrambled after syscall entryPetr Machata
This was caught by system_call_params.exp test case: exe->mount("source", "target", "filesystemtype", 0, nil <unfinished ...> mount@SYS("", "target", "filesystemtype", 0, nil) = -2 <... mount resumed> = -1 Note how the first parameter disappears--r2 now holds syscall number (21 in this case), and the original value is stored in orig_gpr2 in save area.
2013-11-26On x86{,_64}, PLT entries may not be ordered by their relocationPetr Machata
- In general they are. But IRELATIVE relocations are sorted to come last, and PLT entries are not sorted accordingly.
2013-11-06Plug a leakPetr Machata
2013-11-05Fix compilation on ARMPetr Machata
- This was broken several commits back by removing pltrel from struct ltelf.
2013-11-05In ARM backend, move hooks for ltrace_elf and library to plt.cPetr Machata
- That's the customary location for backend hooks.
2013-11-05Move load_dynamic_entry from PPC backend to ltrace-elf.c/.hPetr Machata
2013-11-05Full support of IFUNC tracing on PPC32Petr Machata
2013-11-05Move code for tracing IFUNC symbolsPetr Machata
- ... from sysdeps/linux-gnu/hooks.c to sysdeps/linux-gnu/trace.c where it fits better.
2013-11-05Partial support of IFUNC tracing on PPC32Petr Machata
- Just like on PPC64, we need to move IRELATIVE relocations from .rela.dyn to the vector of PLT relocations - Just like on PPC64, we may need to rename the symbol--except the symbol to looked is the one with the address of PLT slot address, not of rela addend.
2013-11-05CleanupsPetr Machata
2013-11-04Properly publish read_relplt interface, rename it to elf_read_relocsPetr Machata
2013-10-30Support tracing P_PPC64_JMP_IREL slotsPetr Machata
2013-10-25Split linux_elf_find_irelative_name out of linux_elf_add_plt_entry_irelativePetr Machata
2013-10-25Keep PLT relocations in a vectorPetr Machata
- That means we have to copy them out of ELF ahead of time instead of referencing them from inside ELF on demand. But this way we can keep one grand vector of all PLT-like relocations. On PPC, this makes a difference: some PLT-like relocations (R_PPC64_JMP_IREL in particular) are stored in .rela.dyn, not .rela.plt.
2013-10-25OPD-transate the address that comes back from IFUNC resolverPetr Machata
2013-10-24Fix fetching of system call arguments on i386Petr Machata
2013-10-24sysdeps/linux-gnu/trace.c misses #include <stdint.h>Petr Machata
2013-10-23Linux backend now supports tracing of IFUNC symbolsPetr Machata
2013-10-23Enable IRELATIVE tracing on x86 and x86_64Petr Machata
2013-10-23Add support for tracing of IRELATIVE PLT entriesPetr Machata
- Because the IRELATIVE entries have no associated symbol name, we need to allow arch_elf_add_plt_entry to override the name. This is done by that callback returning PLT_OK and returning the new symbol via libsym-chain return argument. Filtering is postponed until we have that symbol, and the filter is applied to the whole returned chain. - Add linux_elf_add_plt_entry_irelative to support proper naming of IRELATIVE PLT entries. This needs to be called from arch backend, as the numbers of IRELATIVE relocations differ per-architecture.
2013-10-23Split part of delete_breakpoint into delete_breakpoint_atPetr Machata
2013-10-23Allow per-OS configuration hooks for struct breakpointPetr Machata
2013-10-23Allow per-OS configuration hooks for structs library and library_symbolPetr Machata
2013-10-23Replace os_get_ltrace_conf_filename with os_get_ltrace_conf_filenamesPetr Machata
- I.e. allow returning a list of filenames, as opposed to a single home directory name. This is to implement exactly the legacy config file behavior on Linux.
2013-10-16Sanitize interface of arch_get_sym_info/elf_get_sym_infoPetr Machata
- <0 for errors, ==0 for OK, 1 for skip. Errors are now propagated and can be handled as necessary without cancelling tracing. - Clarify the comment at arch_get_sym_info.
2013-10-11Commentary fixesPetr Machata
2013-10-11Rename insert_breakpoint to insert_breakpoint_atPetr Machata
2013-10-11arch_library_init and arch_library_clone should be able to signal failurePetr Machata
- This then trickles to library_init, which needs to return int - Callers of library_init were updated to unroll their transactions upon failure - PPC and ARM backends were updated to match the updated interface
2013-09-26Fix missing 'metag' in distribution tarballPeter Wu
2013-09-19Fix a comment typoPetr Machata
2013-03-26s390 set_instruction_pointer: Set highest bit in 31-bit tracerPetr Machata
- The highest bit is used to distinguish between 24-bit and 31-bit addressing modes. Up until about 3.1, Linux did this automatically, but stopped doing so with the following commit: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d4e81b35b882d96f059afdb0f98e5b6025973b09
2013-03-26Coding style in s390/regs.cPetr Machata
- This changes uses of void* to arch_addr_t, and adds tags for future conversion of arch_addr_t to an integral type.
2013-03-22ltrace: Add support for Imagination Technologies MetaMarkos Chandras
This patchset adds support for Imagination's Meta architecture. The Meta Linux kernel port will be included in the Linux Kernel v3.9. It also uses the generic system call numbers. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
2013-03-12ARM cleanupsPetr Machata
2013-03-12ARM: Stack slot is always aligned to at least 4 bytesPetr Machata
2013-03-12VFP shouldn't be used for parameter passing in vararg functions on ARMPetr Machata
2013-03-12Simplify the code for ARM parameter passingPetr Machata