This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
PATCH ARM/Linux gdbarch a couple of shared-lib defined
- From: Richard Earnshaw <rearnsha at buzzard dot freeserve dot co dot uk>
- To: gdb-patches at sources dot redhat dot com
- Cc: Richard dot Earnshaw at buzzard dot freeserve dot co dot uk
- Date: Sat, 23 Feb 2002 22:20:37 +0000
- Subject: PATCH ARM/Linux gdbarch a couple of shared-lib defined
- Reply-to: Richard dot Earnshaw at buzzard dot freeserve dot co dot uk
These are the only shared-lib defines that are currently multi-arched. So
use them.
Note, config/arm/tm-linux.h includes config/tm-linux.h which includes
config/tm-sysv4.h and that provides defines both of these. So rather than
just delete the define, we replace it with an undef.
2002-02-23 Richard Earnshaw <rearnsha@arm.com>
* arm-linux-tdep.c (arm_linux_init_abi): Register
IN_SOLIB_CALL_TRAMPOLINE and SKIP_TRAMPOLINE_CODE
* config/arm/tm-linux.h (IN_SOLIB_CALL_TRAMPOLINE): Replace old
definition with undef, since we don't want the sysvr4 definition.
(SKIP_TRAMPOLINE_CODE): Likewise.
R.
Index: arm-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-linux-tdep.c,v
retrieving revision 1.19
diff -p -p -r1.19 arm-linux-tdep.c
*** arm-linux-tdep.c 2002/02/23 17:07:56 1.19
--- arm-linux-tdep.c 2002/02/23 22:01:27
***************
*** 30,36 ****
#include "arm-tdep.h"
! /* For arm_linux_skip_solib_resolver. */
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
--- 30,36 ----
#include "arm-tdep.h"
! /* For shared library handling. */
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
*************** arm_linux_init_abi (struct gdbarch_info
*** 534,539 ****
--- 534,543 ----
/* The following two overrides shouldn't be needed. */
set_gdbarch_extract_return_value (gdbarch, arm_linux_extract_return_value);
set_gdbarch_push_arguments (gdbarch, arm_linux_push_arguments);
+
+ /* Shared library handling. */
+ set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
+ set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
}
void
Index: config/arm/tm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/arm/tm-linux.h,v
retrieving revision 1.15
diff -p -p -r1.15 tm-linux.h
*** tm-linux.h 2002/02/23 17:07:57 1.15
--- tm-linux.h 2002/02/23 22:01:30
*************** extern struct link_map_offsets *arm_linu
*** 37,59 ****
/* Offset to saved PC in sigcontext structure, from <asm/sigcontext.h> */
#define SIGCONTEXT_PC_OFFSET (sizeof(unsigned long) * 18)
! /* On ARM GNU/Linux, each call to a library routine goes through a
! small piece of trampoline code in the ".plt" section. The
! wait_for_inferior() routine uses this macro to detect when we have
! stepped into one of these fragments. We do not use
! lookup_solib_trampoline_symbol_by_pc, because we cannot always find
! the shared library trampoline symbols. */
! extern int in_plt_section (CORE_ADDR, char *);
! #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) in_plt_section((pc), (name))
/* On ARM GNU/Linux, a call to a library routine does not have to go
through any trampoline code. */
#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) 0
! /* If PC is in a shared library trampoline code, return the PC
! where the function itself actually starts. If not, return 0. */
! extern CORE_ADDR find_solib_trampoline_target (CORE_ADDR pc);
! #define SKIP_TRAMPOLINE_CODE(pc) find_solib_trampoline_target (pc)
/* When we call a function in a shared library, and the PLT sends us
into the dynamic linker to find the function's real address, we
--- 37,51 ----
/* Offset to saved PC in sigcontext structure, from <asm/sigcontext.h> */
#define SIGCONTEXT_PC_OFFSET (sizeof(unsigned long) * 18)
! /* We've multi-arched this. */
! #undef IN_SOLIB_CALL_TRAMPOLINE
/* On ARM GNU/Linux, a call to a library routine does not have to go
through any trampoline code. */
#define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) 0
! /* We've multi-arched this. */
! #undef SKIP_TRAMPOLINE_CODE
/* When we call a function in a shared library, and the PLT sends us
into the dynamic linker to find the function's real address, we