Synchronizing C6X DSBT bits between uClibc/Kernel and GDB.

Mark Salter msalter at redhat.com
Wed May 29 15:37:35 UTC 2013


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.

--Mark



More information about the uClibc mailing list