Synchronizing C6X DSBT bits between uClibc/Kernel and GDB.

Luis Machado lgustavo at codesourcery.com
Thu Jun 20 18:08:40 UTC 2013


Hi,

On 06/05/2013 04:50 PM, Bernhard Reutner-Fischer wrote:
> On 29 May 2013 17:37:35 Mark Salter <msalter at redhat.com> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: c6x_dsbt.diff
Type: text/x-patch
Size: 1097 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20130620/42270e47/attachment.bin>


More information about the uClibc mailing list