#3687 closed defect (fixed)

Add architecture section support to libdl and support PowerPC's small data.

Reported by: Chris Johns Owned by: Chris Johns
Priority: normal Milestone: 5.1
Component: lib/dl Version: 5
Severity: normal Keywords:
Cc: Blocked By:


Add support for architecture specific sections. Allow architecture back end support to handle sections that are specific to an architecture.

Add PowerPC sdata and sbss support. The PowerPC can support a small data 64K continuous system wide region of memory. Small data accesses are faster as the instruction is smaller however the variable is referenced as a signed 16bit offset from the register r13. This register is offset from the region's base address by 32K. The linker creates the .sdata and .sbss regions and sets the _SDA_BASE_ symbol which is loaded into r13. Any run-time loaded code with small data support needs space in the small data region therefore a BSP needs a way to define the space and the linker needs to allocate it. Provide a way for PowerPC BSPs to add extra memory to the small data region.

RTEMS supports the PowerPC EABI and uses sysv small data allocations. RTEMS uses the default variable size of 8 as the selector for a variable to be allocated in the small data region. The GCC user manual recommends all code is built with the same settings. Dynamically loaded code could be built with small data disabled and if enabled the default size is recommended.

Note, small data is system wide which means a default size of 8 allows only 8192 8 byte variables.

Provide an allocator to manage the available small data memory.

Change History (5)

comment:1 Changed on Feb 8, 2019 at 11:08:42 PM by Chris Johns <chrisj@…>

In 6c9f017/rtems:

libdl: Add powerpc large memory and small data support.

  • Add support for architecure sections that can be handled by the architecture back end.
  • Add trampoline/fixup support for PowerPC. This means the PowerPC now supports large memory loading of applications.
  • Add a bit allocator to manage small block based regions of memory.
  • Add small data (sdata/sbss) support for the PowerPC. The support makes the linker allocated small data region of memory a global resource available to libdl loaded object files.

Updates #3687
Updates #3685

comment:2 Changed on Feb 11, 2019 at 10:43:14 AM by Sebastian Huber <sebastian.huber@…>

In eec706e2/rtems:

bsps/powerpc: Fix small data area section

Fix small data area in case no fixed size is desired. Rename
bsp_section_set_sdata_sbss_size into bsp_section_small_data_area_size
since this symbol reflects the overall small data area size (including
space for libdl). Do not use bsp_section_sbss_size before definition in
linker command file. Add new symbols to <bsp/linker-symbols.h>.

Update #3687.

comment:3 Changed on Feb 18, 2019 at 12:28:02 AM by Chris Johns <chrisj@…>

In 3ecb207/rtems:

libdl/rap: Add the section alloc call after section load was split

Updates #3687

comment:4 Changed on Mar 6, 2019 at 7:34:29 PM by Chris Johns <chrisj@…>

In ec1dd51a/rtems:

libdl: Add small data support to the remaining PowerPC BSPs.

Updates #3687

comment:5 Changed on Feb 26, 2020 at 3:52:04 AM by Chris Johns

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.