Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH RFC] arm-tdep.c: Define SVR4 link map offset fetcher
@ 2001-11-14 22:52 Kevin Buettner
  2001-11-14 23:19 ` Daniel Jacobowitz
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Kevin Buettner @ 2001-11-14 22:52 UTC (permalink / raw)
  To: gdb-patches

The patch below adds shared library support for non-native ARM linux
targets.  I'll wait a few days for comments before committing it.

Kevin

	From Louis Hamilton  <hamilton@redhat.com>:
	* arm-tdep.c (solib-svr4.h): Include.
	(arm_linux_svr4_fetch_link_map_offsets): New function.
	* config/arm/tm-linux.h (SVR4_FETCH_LINK_MAP_OFFSETS): Define.
	(arm_linux_svr4_fetch_link_map_offsets): Declare.

Index: arm-tdep.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/arm-tdep.c,v
retrieving revision 1.65.8.1.2.1
diff -u -p -r1.65.8.1.2.1 arm-tdep.c
--- arm-tdep.c	2001/10/02 15:53:35	1.65.8.1.2.1
+++ arm-tdep.c	2001/11/27 18:42:10
@@ -31,6 +31,7 @@
 #include <ctype.h>		/* for isupper () */
 #include "regcache.h"
 #include "doublest.h"
+#include "solib-svr4.h"
 
 /* Each OS has a different mechanism for accessing the various
    registers stored in the sigcontext structure.
@@ -2094,6 +2101,49 @@ arm_othernames (char *names, int n)
 
   disassembly_flavor = valid_flavors[current_option];
   set_disassembly_flavor (); 
+}
+
+/* Fetch, and possibly build, an appropriate link_map_offsets structure
+   for ARM linux targets using the struct offsets defined in <link.h>.
+   Note, however, that link.h is not actually referred to in this file.
+   Instead, the relevant structs offsets were obtained from examining
+   link.h.  (We can't refer to link.h from this file because the host
+   system won't necessarily have it, or if it does, the structs which
+   it defines will refer to the host system, not the target.  */
+
+struct link_map_offsets *
+arm_linux_svr4_fetch_link_map_offsets (void)
+{
+  static struct link_map_offsets lmo;
+  static struct link_map_offsets *lmp = 0;
+
+  if (lmp == 0)
+    {
+      lmp = &lmo;
+
+      lmo.r_debug_size = 8;	/* Actual size is 20, but this is all we
+                                   need. */
+
+      lmo.r_map_offset = 4;
+      lmo.r_map_size   = 4;
+
+      lmo.link_map_size = 20;	/* Actual size is 552, but this is all we
+                                   need. */
+
+      lmo.l_addr_offset = 0;
+      lmo.l_addr_size   = 4;
+
+      lmo.l_name_offset = 4;
+      lmo.l_name_size   = 4;
+
+      lmo.l_next_offset = 12;
+      lmo.l_next_size   = 4;
+
+      lmo.l_prev_offset = 16;
+      lmo.l_prev_size   = 4;
+    }
+
+    return lmp;
 }
 
 void
Index: config/arm/tm-linux.h
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/config/arm/tm-linux.h,v
retrieving revision 1.5
diff -u -p -r1.5 tm-linux.h
--- config/arm/tm-linux.h	2000/09/07 12:34:17	1.5
+++ config/arm/tm-linux.h	2001/11/27 18:42:11
@@ -26,6 +26,10 @@
 
 #include "tm-linux.h"
 
+/* Use target-specific function to define link map offsets.  */
+extern struct link_map_offsets *arm_linux_svr4_fetch_link_map_offsets (void);
+#define SVR4_FETCH_LINK_MAP_OFFSETS() arm_linux_svr4_fetch_link_map_offsets ()
+
 /* Target byte order on ARM Linux is little endian and not selectable.  */
 #undef TARGET_BYTE_ORDER_SELECTABLE_P
 #define TARGET_BYTE_ORDER_SELECTABLE_P	0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RFC] arm-tdep.c: Define SVR4 link map offset fetcher
  2001-11-14 22:52 [PATCH RFC] arm-tdep.c: Define SVR4 link map offset fetcher Kevin Buettner
@ 2001-11-14 23:19 ` Daniel Jacobowitz
  2001-11-15  7:58   ` Kevin Buettner
  2001-11-27 13:50   ` Daniel Jacobowitz
  2001-11-23 12:39 ` Kevin Buettner
  2001-11-27 13:43 ` Kevin Buettner
  2 siblings, 2 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2001-11-14 23:19 UTC (permalink / raw)
  To: gdb-patches

On Tue, Nov 27, 2001 at 02:43:11PM -0700, Kevin Buettner wrote:
> The patch below adds shared library support for non-native ARM linux
> targets.  I'll wait a few days for comments before committing it.

Barring comments, bit-for-byte identical with the one in my tree that I
never got around to submitting, and that's been tested to work
correctly.

The exact same numbers work for PowerPC/Linux, by the way.  Might want
to add that too.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RFC] arm-tdep.c: Define SVR4 link map offset fetcher
  2001-11-14 23:19 ` Daniel Jacobowitz
@ 2001-11-15  7:58   ` Kevin Buettner
  2001-11-27 14:16     ` Kevin Buettner
  2001-11-27 13:50   ` Daniel Jacobowitz
  1 sibling, 1 reply; 8+ messages in thread
From: Kevin Buettner @ 2001-11-15  7:58 UTC (permalink / raw)
  To: Daniel Jacobowitz, gdb-patches

On Nov 27,  4:50pm, Daniel Jacobowitz wrote:

> The exact same numbers work for PowerPC/Linux, by the way.  Might want
> to add that too.

Yeah, it's in one of my trees.  Hopefully, I'll get around to it
later today...

The catch with PowerPC/Linux is that it's a multiarched target and
it took a bit more work to get it all working properly.

Kevin


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RFC] arm-tdep.c: Define SVR4 link map offset fetcher
  2001-11-14 22:52 [PATCH RFC] arm-tdep.c: Define SVR4 link map offset fetcher Kevin Buettner
  2001-11-14 23:19 ` Daniel Jacobowitz
@ 2001-11-23 12:39 ` Kevin Buettner
  2001-11-30 12:29   ` Kevin Buettner
  2001-11-27 13:43 ` Kevin Buettner
  2 siblings, 1 reply; 8+ messages in thread
From: Kevin Buettner @ 2001-11-23 12:39 UTC (permalink / raw)
  To: gdb-patches

On Nov 27,  2:43pm, Kevin Buettner wrote:

> The patch below adds shared library support for non-native ARM linux
> targets.  I'll wait a few days for comments before committing it.
> 
> 	From Louis Hamilton  <hamilton@redhat.com>:
> 	* arm-tdep.c (solib-svr4.h): Include.
> 	(arm_linux_svr4_fetch_link_map_offsets): New function.
> 	* config/arm/tm-linux.h (SVR4_FETCH_LINK_MAP_OFFSETS): Define.
> 	(arm_linux_svr4_fetch_link_map_offsets): Declare.

Committed.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH RFC] arm-tdep.c: Define SVR4 link map offset fetcher
  2001-11-14 22:52 [PATCH RFC] arm-tdep.c: Define SVR4 link map offset fetcher Kevin Buettner
  2001-11-14 23:19 ` Daniel Jacobowitz
  2001-11-23 12:39 ` Kevin Buettner
@ 2001-11-27 13:43 ` Kevin Buettner
  2 siblings, 0 replies; 8+ messages in thread
From: Kevin Buettner @ 2001-11-27 13:43 UTC (permalink / raw)
  To: gdb-patches

The patch below adds shared library support for non-native ARM linux
targets.  I'll wait a few days for comments before committing it.

Kevin

	From Louis Hamilton  <hamilton@redhat.com>:
	* arm-tdep.c (solib-svr4.h): Include.
	(arm_linux_svr4_fetch_link_map_offsets): New function.
	* config/arm/tm-linux.h (SVR4_FETCH_LINK_MAP_OFFSETS): Define.
	(arm_linux_svr4_fetch_link_map_offsets): Declare.

Index: arm-tdep.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/arm-tdep.c,v
retrieving revision 1.65.8.1.2.1
diff -u -p -r1.65.8.1.2.1 arm-tdep.c
--- arm-tdep.c	2001/10/02 15:53:35	1.65.8.1.2.1
+++ arm-tdep.c	2001/11/27 18:42:10
@@ -31,6 +31,7 @@
 #include <ctype.h>		/* for isupper () */
 #include "regcache.h"
 #include "doublest.h"
+#include "solib-svr4.h"
 
 /* Each OS has a different mechanism for accessing the various
    registers stored in the sigcontext structure.
@@ -2094,6 +2101,49 @@ arm_othernames (char *names, int n)
 
   disassembly_flavor = valid_flavors[current_option];
   set_disassembly_flavor (); 
+}
+
+/* Fetch, and possibly build, an appropriate link_map_offsets structure
+   for ARM linux targets using the struct offsets defined in <link.h>.
+   Note, however, that link.h is not actually referred to in this file.
+   Instead, the relevant structs offsets were obtained from examining
+   link.h.  (We can't refer to link.h from this file because the host
+   system won't necessarily have it, or if it does, the structs which
+   it defines will refer to the host system, not the target.  */
+
+struct link_map_offsets *
+arm_linux_svr4_fetch_link_map_offsets (void)
+{
+  static struct link_map_offsets lmo;
+  static struct link_map_offsets *lmp = 0;
+
+  if (lmp == 0)
+    {
+      lmp = &lmo;
+
+      lmo.r_debug_size = 8;	/* Actual size is 20, but this is all we
+                                   need. */
+
+      lmo.r_map_offset = 4;
+      lmo.r_map_size   = 4;
+
+      lmo.link_map_size = 20;	/* Actual size is 552, but this is all we
+                                   need. */
+
+      lmo.l_addr_offset = 0;
+      lmo.l_addr_size   = 4;
+
+      lmo.l_name_offset = 4;
+      lmo.l_name_size   = 4;
+
+      lmo.l_next_offset = 12;
+      lmo.l_next_size   = 4;
+
+      lmo.l_prev_offset = 16;
+      lmo.l_prev_size   = 4;
+    }
+
+    return lmp;
 }
 
 void
Index: config/arm/tm-linux.h
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/config/arm/tm-linux.h,v
retrieving revision 1.5
diff -u -p -r1.5 tm-linux.h
--- config/arm/tm-linux.h	2000/09/07 12:34:17	1.5
+++ config/arm/tm-linux.h	2001/11/27 18:42:11
@@ -26,6 +26,10 @@
 
 #include "tm-linux.h"
 
+/* Use target-specific function to define link map offsets.  */
+extern struct link_map_offsets *arm_linux_svr4_fetch_link_map_offsets (void);
+#define SVR4_FETCH_LINK_MAP_OFFSETS() arm_linux_svr4_fetch_link_map_offsets ()
+
 /* Target byte order on ARM Linux is little endian and not selectable.  */
 #undef TARGET_BYTE_ORDER_SELECTABLE_P
 #define TARGET_BYTE_ORDER_SELECTABLE_P	0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RFC] arm-tdep.c: Define SVR4 link map offset fetcher
  2001-11-14 23:19 ` Daniel Jacobowitz
  2001-11-15  7:58   ` Kevin Buettner
@ 2001-11-27 13:50   ` Daniel Jacobowitz
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2001-11-27 13:50 UTC (permalink / raw)
  To: gdb-patches

On Tue, Nov 27, 2001 at 02:43:11PM -0700, Kevin Buettner wrote:
> The patch below adds shared library support for non-native ARM linux
> targets.  I'll wait a few days for comments before committing it.

Barring comments, bit-for-byte identical with the one in my tree that I
never got around to submitting, and that's been tested to work
correctly.

The exact same numbers work for PowerPC/Linux, by the way.  Might want
to add that too.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RFC] arm-tdep.c: Define SVR4 link map offset fetcher
  2001-11-15  7:58   ` Kevin Buettner
@ 2001-11-27 14:16     ` Kevin Buettner
  0 siblings, 0 replies; 8+ messages in thread
From: Kevin Buettner @ 2001-11-27 14:16 UTC (permalink / raw)
  To: Daniel Jacobowitz, gdb-patches

On Nov 27,  4:50pm, Daniel Jacobowitz wrote:

> The exact same numbers work for PowerPC/Linux, by the way.  Might want
> to add that too.

Yeah, it's in one of my trees.  Hopefully, I'll get around to it
later today...

The catch with PowerPC/Linux is that it's a multiarched target and
it took a bit more work to get it all working properly.

Kevin


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RFC] arm-tdep.c: Define SVR4 link map offset fetcher
  2001-11-23 12:39 ` Kevin Buettner
@ 2001-11-30 12:29   ` Kevin Buettner
  0 siblings, 0 replies; 8+ messages in thread
From: Kevin Buettner @ 2001-11-30 12:29 UTC (permalink / raw)
  To: gdb-patches

On Nov 27,  2:43pm, Kevin Buettner wrote:

> The patch below adds shared library support for non-native ARM linux
> targets.  I'll wait a few days for comments before committing it.
> 
> 	From Louis Hamilton  <hamilton@redhat.com>:
> 	* arm-tdep.c (solib-svr4.h): Include.
> 	(arm_linux_svr4_fetch_link_map_offsets): New function.
> 	* config/arm/tm-linux.h (SVR4_FETCH_LINK_MAP_OFFSETS): Define.
> 	(arm_linux_svr4_fetch_link_map_offsets): Declare.

Committed.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-11-30 20:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-14 22:52 [PATCH RFC] arm-tdep.c: Define SVR4 link map offset fetcher Kevin Buettner
2001-11-14 23:19 ` Daniel Jacobowitz
2001-11-15  7:58   ` Kevin Buettner
2001-11-27 14:16     ` Kevin Buettner
2001-11-27 13:50   ` Daniel Jacobowitz
2001-11-23 12:39 ` Kevin Buettner
2001-11-30 12:29   ` Kevin Buettner
2001-11-27 13:43 ` Kevin Buettner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox