Re: [PATCH, gdbserver] Further cleanup of FDPIC/DSBT divergences

Pedro Alves
2013-08-12T14:06:28Z

On 08/12/2013 02:41 PM, Luis Machado wrote:

>>> +
>>> + /* Fetch the DSBT_INDEX from the shared library file on disk. */
>>> + if (scan_dyntag_in_bfd (DT_TIC6X_DSBT_INDEX, solib_bfd, &addr) == 0)
>>
>> I don't find the definition of DT_TIC6X_DSBT_INDEX. In uclibc, I only
>> find DT_C6000_DSBT_INDEX.
>>
>
> That is exactly what it is. I named it DT_TIC6X_DSBT_INDEX to make it
> more meaningful, but i can use DT_C6000_DSBT_INDEX without problems i think.

Indeed. The kernel (arch/c6x/include/asm/elf.h) has:

85 /* C6X specific DT_ tags */
86 #define DT_C6000_DSBT_BASE 0x70000000
87 #define DT_C6000_DSBT_SIZE 0x70000001
88 #define DT_C6000_PREEMPTMAP 0x70000002
89 #define DT_C6000_DSBT_INDEX 0x70000003

BFD also already has (include/elf/tic6x.h):

/* The hard-coded DSBT index for this module, if any. */
#define DT_C6000_DSBT_INDEX 0x70000003

IMO, yes, better stick with existing practice and not
invent new symbols.

--
Pedro Alves