Hi,
On 06/05/2013 04:50 PM, Bernhard Reutner-Fischer wrote:
On 29 May 2013 17:37:35 Mark Salter <[email protected]> wrote:
On Tue, 2013-05-28 at 13:09 +0200, Luis Machado wrote:
> Hi,
> C6X uses a DSBT scheme for shared libraries. Seeing how it is quite
similar to FDPIC, it seems all the targets doing DSBT have migrated to
using FDPIC structures and code.
> C6X has done that in this patch by Mark Salter:
http://lists.uclibc.org/pipermail/uclibc/2012-June/046906.html
> Since the layout of the loadmap structure has been changed to match
FDPIC's one, this structure went out of synch with GDB's own
definition of the loadmap.
> We need backwards compatibility though (let me know if this is not
the case) and GDB conditionally defines the old loadmap based on the
existence of PT_GETDSBT (defined in libc/sysdeps/linux/c6x/sys/ptrace.h).
> My proposal is to drop this definition in uClibc and use the more
common PTRACE_GETFDPIC instead (already used in the kernel, Mark can
correct me if i'm wrong).
> This way we guarantee GDB will use the correct loadmap for C6X.
> I still expect GDB to be confused if it uses recent uClibc code that
still defines PT_GETDSBT though, but it doesn't look like we can solve
that easily.
> Thoughts? Let me know what you think and i can come up with a patch.
This all sounds reasonable to me. PTRACE_GETDSBT is not used internally
by uClibc and it has the same value as PTRACE_GETFDPIC. This all came
about when kernel switched from a separate loader to using the fdpic
loader when c6x kernel was pushed upstream. At that point, the uClibc
bits were already in place.
Please update uClibc accordingly. I would not care about backward
compatibility in this regard.
Thanks in advance!
Cheers
It took a while, but here is the patch that i had proposed. It removes
the old *DSBT defines that we no longer need to use. We will use *FDPIC
ones instead, as they even share the same constants as the *DSBT ones.
As this is my first uClibc patch, let me know if there is something
broken or malformed. I didn't find any standard ChangeLog entries in the
previous patches, so i didn't use one for this patch.
Regards,
Luis
Signed-off-by: Luis Machado <[email protected]>
diff --git a/libc/sysdeps/linux/c6x/sys/ptrace.h b/libc/sysdeps/linux/c6x/sys/ptrace.h
index 6e2d4aa..8ca7e15 100644
--- a/libc/sysdeps/linux/c6x/sys/ptrace.h
+++ b/libc/sysdeps/linux/c6x/sys/ptrace.h
@@ -111,12 +111,6 @@ enum __ptrace_request
PTRACE_SYSCALL = 24,
#define PT_SYSCALL PTRACE_SYSCALL
- /* Obtain the load map of the main program or the interpreter of the
- ptraced process, depending on whether the addr argument is
- (void*)0 or (void*)1, respectively. */
- PTRACE_GETDSBT = 31,
-#define PT_GETDSBT PTRACE_GETDSBT
-
/* Set ptrace filter options. */
PTRACE_SETOPTIONS = 0x4200,
#define PT_SETOPTIONS PTRACE_SETOPTIONS
@@ -134,9 +128,6 @@ enum __ptrace_request
#define PT_SETSIGINFO PTRACE_SETSIGINFO
};
-#define PTRACE_GETDSBT_EXEC ((void*)0) /* [addr] request the executable loadmap */
-#define PTRACE_GETDSBT_INTERP ((void*)1) /* [addr] request the interpreter loadmap */
-
/* Options set using PTRACE_SETOPTIONS. */
enum __ptrace_setoptions {
PTRACE_O_TRACESYSGOOD = 0x00000001,
_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc