#3698 assigned defect

libdl failure on many PowerPC BSPs

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

Description

The following BSPs do not build dl09:

powerpc-beatnik
powerpc-brs5l
powerpc-brs6l
powerpc-dp2
powerpc-haleakala
powerpc-icecube
powerpc-mcp750
powerpc-mpc8260ads
powerpc-mtx603e
powerpc-mvme2100
powerpc-mvme2307
powerpc-mvme3100
powerpc-mvme5500
powerpc-pm520_cr825
powerpc-pm520_ze30
powerpc-qemuprep-altivec
powerpc-qemuprep
powerpc-qoriq_e6500_64
powerpc-ss555
powerpc-virtex4
powerpc-virtex5

They fail with this:

gmake[5]: Entering directory `/home/joel/rtems-work/rtems-testing/rtems/build-powerpc-qemuprep-rtems/powerpc-rtems5/c/qemuprep/testsuites/libtests'
powerpc-rtems5-gcc -mcpu=powerpc -mmultiple -mstring -mstrict-align -O2 -g -ffunction-sections -fdata-sections -Wall -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs  -Wl,--gc-sections  -mcpu=powerpc -mmultiple -mstring -mstrict-align  -B./../../lib/libbsp/powerpc/motorola_powerpc -B/home/joel/rtems-work/rtems-testing/rtems/rtems/bsps/powerpc/motorola_powerpc/start -specs bsp_specs -qrtems -L./../../cpukit -L/home/joel/rtems-work/rtems-testing/rtems/rtems/bsps/powerpc/shared/start -Wl,--wrap=printf -Wl,--wrap=puts -Wl,--wrap=putchar -o dl01.pre dl01/dl01-init.o dl01/dl01-dl-load.o dl01-dl01-tar.o ../../lib/libbsp/powerpc/motorola_powerpc/librtemsbsp.a ../../cpukit/librtemscpu.a
/home/joel/rtems-work/tools/5/lib/gcc/powerpc-rtems5/7.4.0/../../../../powerpc-rtems5/bin/ld: ../../cpukit/librtemscpu.a(rtl-mdreloc-powerpc.o): in function `get_sdata_libdl_size':
/home/joel/rtems-work/rtems-testing/rtems/build-powerpc-qemuprep-rtems/powerpc-rtems5/c/qemuprep/cpukit/../../../../../rtems/c/src/../../cpukit/libdl/rtl-mdreloc-powerpc.c:73: undefined reference to `bsp_section_sdata_libdl_begin'
/home/joel/rtems-work/tools/5/lib/gcc/powerpc-rtems5/7.4.0/../../../../powerpc-rtems5/bin/ld: /home/joel/rtems-work/rtems-testing/rtems/build-powerpc-qemuprep-rtems/powerpc-rtems5/c/qemuprep/cpukit/../../../../../rtems/c/src/../../cpukit/libdl/rtl-mdreloc-powerpc.c:73: undefined reference to `bsp_section_sdata_libdl_begin'
/home/joel/rtems-work/tools/5/lib/gcc/powerpc-rtems5/7.4.0/../../../../powerpc-rtems5/bin/ld: /home/joel/rtems-work/rtems-testing/rtems/build-powerpc-qemuprep-rtems/powerpc-rtems5/c/qemuprep/cpukit/../../../../../rtems/c/src/../../cpukit/libdl/rtl-mdreloc-powerpc.c:74: undefined reference to `bsp_section_sdata_libdl_end'
/home/joel/rtems-work/tools/5/lib/gcc/powerpc-rtems5/7.4.0/../../../../powerpc-rtems5/bin/ld: /home/joel/rtems-work/rtems-testing/rtems/build-powerpc-qemuprep-rtems/powerpc-rtems5/c/qemuprep/cpukit/../../../../../rtems/c/src/../../cpukit/libdl/rtl-mdreloc-powerpc.c:74: undefined reference to `bsp_section_sdata_libdl_end'
/home/joel/rtems-work/tools/5/lib/gcc/powerpc-rtems5/7.4.0/../../../../powerpc-rtems5/bin/ld: ../../cpukit/librtemscpu.a(rtl-mdreloc-powerpc.o): in function `get_sdata_sbss_size':
/home/joel/rtems-work/rtems-testing/rtems/build-powerpc-qemuprep-rtems/powerpc-rtems5/c/qemuprep/cpukit/../../../../../rtems/c/src/../../cpukit/libdl/rtl-mdreloc-powerpc.c:63: undefined reference to `bsp_section_sdata_begin'
/home/joel/rtems-work/tools/5/lib/gcc/powerpc-rtems5/7.4.0/../../../../powerpc-rtems5/bin/ld: /home/joel/rtems-work/rtems-testing/rtems/build-powerpc-qemuprep-rtems/powerpc-rtems5/c/qemuprep/cpukit/../../../../../rtems/c/src/../../cpukit/libdl/rtl-mdreloc-powerpc.c:63: undefined reference to `bsp_section_sdata_begin'
/home/joel/rtems-work/tools/5/lib/gcc/powerpc-rtems5/7.4.0/../../../../powerpc-rtems5/bin/ld: /home/joel/rtems-work/rtems-testing/rtems/build-powerpc-qemuprep-rtems/powerpc-rtems5/c/qemuprep/cpukit/../../../../../rtems/c/src/../../cpukit/libdl/rtl-mdreloc-powerpc.c:64: undefined reference to `bsp_section_sbss_end'
/home/joel/rtems-work/tools/5/lib/gcc/powerpc-rtems5/7.4.0/../../../../powerpc-rtems5/bin/ld: /home/joel/rtems-work/rtems-testing/rtems/build-powerpc-qemuprep-rtems/powerpc-rtems5/c/qemuprep/cpukit/../../../../../rtems/c/src/../../cpukit/libdl/rtl-mdreloc-powerpc.c:64: undefined reference to `bsp_section_sbss_end'
collect2: error: ld returned 1 exit status

Change History (5)

comment:1 Changed on Feb 21, 2019 at 9:35:03 PM by Chris Johns

Why do we have linkcmds.base and linkcmds.share in this arch and what are there differences? Why are the names similar?

I cannot find a any local readme type files explaining the reason there are two files. The git log entry for the addition of this file offers no insight.

At a guess the addition of mpc55xx as a new BSP required a new linkcmd file, which is fine, however an explanation on difference and rational would be helpful to me at this point.

comment:2 Changed on Feb 22, 2019 at 10:04:59 AM by Sebastian Huber

The reason for this is excessive use of copy and paste in the past combined with the long history of the PowerPC port.

The bsps/powerpc/shared/start/linkcmds.base is similar to the bsps/arm/shared/start/linkcmds.base or bsps/riscv/shared/start/linkcmds.base. It uses memory regions and should be used for new BSPs.

The 64-bit PowerPC ELFv2 ABI has no small data area.

comment:3 Changed on Feb 23, 2019 at 11:32:17 PM by Chris Johns

I now see there are a couple of other BSP specific linkcmds files all of which need to be modified.

I am now seeing:

gmake[5]: Entering directory '/opt/work/chris/rtems/kernel/bsps/psim/powerpc-rtems5/c/mpc5643l_dpu/testsuites/sptests'
powerpc-rtems5-gcc  -mcpu=8540 -meabi -msdata=sysv -fno-common -msoft-float -mno-spe -mstrict-align -O2 -g -fno-keep-inline-functions -ffunction-sections -fdata-sections -Wall -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs -B./../../lib/libbsp/powerpc/mpc55xxevb -B/opt/work/chris/rtems/kernel/rtems.git/bsps/powerpc/mpc55xxevb/start -specs bsp_specs -qrtems -L./../../cpukit -L/opt/work/chris/rtems/kernel/rtems.git/bsps/powerpc/shared/start -Wl,--wrap=printf -Wl,--wrap=puts -Wl,--wrap=putchar -Wl,--gc-sections -o sp47.exe sp47/sp47-init.o ./../../lib/libbsp/powerpc/mpc55xxevb/librtemsbsp.a ./../../cpukit/librtemscpu.a
/opt/work/rtems/5/lib/gcc/powerpc-rtems5/7.4.0/../../../../powerpc-rtems5/bin/ld:linkcmds.mpc55xx:18 cannot move location counter backwards (from 00000000400165c0 to 0000000040010000)                                                                                                                    
collect2: error: ld returned 1 exit status
gmake[5]: *** [Makefile:5229: sp47.exe] Error 1

and this does not look related to what I have been working on. Is this test too big for this target?

comment:4 Changed on Feb 23, 2019 at 11:59:32 PM by Chris Johns

Further investigation of the mpc5643l_dpu BSP I see a lot of tests are failing to link. I think this BSP should have all tests disabled, sorry I have no capacity to maintaining this stuff.

What has changed in RTEMS to cause the tests to overflow the memory area? Is a bisect needed?

I will now look at adding regx support to the .tcfg files so wildcards can be supported. To exclude all tests:

rexclude *

can be used as a simple way to disable all tests. I may consider rexclude and rinclude as an order set of filters so:

rexclude *
rinclude samples/*

This syntax introduces the / delimiter so specific groups can be filtered.

comment:5 Changed on Feb 25, 2019 at 6:16:13 AM by Sebastian Huber

The reason for the recent link-time errors on some small memory BSPs is the change from workspace initialization to static allocation for the objects. I work on this already, but is a bit tedious. My approach is to add some general *.tcfg files like this:

testsuites/testdata/disable-256k-data-or-more-tests.tcfg
testsuites/testdata/disable-128k-data-or-more-tests.tcfg
testsuites/testdata/disable-64k-data-or-more-tests.tcfg
testsuites/testdata/disable-32k-data-or-more-tests.tcfg

Note: See TracTickets for help on using tickets.