[PATCH 11/11] libdl: Add powerpc large memory and small data support.

Chris Johns chrisj at rtems.org
Tue Feb 5 08:45:07 UTC 2019


On 5/2/19 7:35 pm, Sebastian Huber wrote:
> On 05/02/2019 09:19, Chris Johns wrote:
>> On 5/2/19 5:32 pm, Sebastian Huber wrote:
>>> On 05/02/2019 07:19, Sebastian Huber wrote:
>>>> On 05/02/2019 02:43, chrisj at rtems.org wrote:
>>>>> +    /*
>>>>> +     * Set bsp_section_sdata_bss_maximum_size to 1 to use the maximum, eg:
>>>>> +     *
>>>>> +     *  bsp_section_sdata_bss_maximum_size = 1;
>>>>> +     */
>>>>> +    bsp_section_sdata_bss_default_size =
>>>>> +        DEFINED(bsp_section_sdata_bss_maximum_size) ? 65536 : 0;
>>>>> +    /*
>>>>> +     * Set bsp_section_sdata_bss_size to the system's sdata and bss data
>>>>> size, eg:
>>>>> +     *
>>>>> +     *  bsp_section_sdata_bss_maximum_size = 4096;
>>>>> +     */
>>>>> +    bsp_section_sdata_sbss_size = DEFINED(bsp_section_sdata_bss_size) ?
>>>>> +        bsp_section_sdata_bss_size : bsp_section_sdata_bss_default_size;
>>>> I would not make it more complicated than necessary. The systems using libdl
>>>> probably all have network support and file systems. For them wasting 64KiB
>>>> shouldn't be an issue. I would rename the bsp_section_sdata_bss_maximum_size
>>>> to something like bsp_section_use_maximum_sdata_size since it is actually not
>>>> a size.
>> The "small data" region is formally sdata and sbss sections which is why I used
>> the extended labeling. I wanted to make it clear this allocates space for sdata
>> _and_ sbss.
> 
> Good, but then please name it *_sdata_sbss_* and not just *_sdata_bss_*.
> 

Oh nice catch, thanks.

>> I agree there will be a hard split of BSPs, those that define the full size and
>> those who do not use libdl. The only issue is a small amount of data is needed
>> for some of the tests in the testsuite to pass. I expect a run of excluding
>> libdl tests. This is an unfortunate situation and I am not sure how else to
>> handle it.
>>
>> I have not updated which BSPs get the full sdata size. I am not sure which
>> need it.
> 
> I would start with the qoriq and the psim.
> 

OK. I will add qoriq.

>>
>>> Maybe we can simply use:
>>>
>>> /*
>>>   * Define bsp_section_sdata_fixed_size to set the size of the small-data
>>> area to
>>> a fixed size as specified, otherwise the size of the small-data area is defined
>>> by the section content.
>>>   *
>>>   * bsp_section_sdata_fixed_size = 65536;
>>>   */
>> I provided the max value to avoid errors related to getting this value correct
>> in a number of places.
> 
> Yes, there is a bit of copy and paste involved, but if you tinker with linker
> symbols you should know what you are doing.

Sure but this is an important system parameter and we are making people need to
look in linker command files. I will rework this and make it just the size.

Chris




More information about the devel mailing list