Many BSPs Fail to link CXX tests

Joel Sherrill joel at
Mon Jan 4 18:23:16 UTC 2016

On Sun, Jan 3, 2016 at 11:00 PM, Gedare Bloom <gedare at> wrote:

> On Sun, Jan 3, 2016 at 9:47 PM, Joel Sherrill <joel at> wrote:
> >
> >
> > On Sun, Jan 3, 2016 at 8:26 PM, Chris Johns <chrisj at> wrote:
> >> Can you get a suitable list of functions that must be present in the
> >> executable and check they are present with nm?
> >>
> >
> > It should be simple if the breakage is between the entry point and the
> rest
> > of the BSP. If hello does not include bsp_start() or
> > rtems_initialize_data_structures(), then it is known to be broken. This
> is
> > what broke on sis -- the first 16 instructions of the start code had no
> > dependency on anything else. So the linkages were satisfied and nothing
> else
> > pulled in. :)
> >
> Such a list should be easy enough to create by building every BSP and
> creating a list of functions appearing in every one (known to run).
The scripts in rtems-testing/rtems keep a copy of ticker.ralf named
CPU-BSP-ticker.ralf. For the ones I had laying around that were actually
in ELF format with symbols still, there were 362 symbols which showed
up in 68 files (that appears to be the magic maximum number).

file *.ralf | grep ELF | cut -d':' -f1 | while read f
  target=`echo $f | cut -d'-' -f1`

  nm -g ${f} | grep " T " | cut -d' ' -f3
done | sort | uniq -c | sort -n

There is no guarantee that those 362 symbols are actually really required
and turning on per-item section linking I hope would reduce that. Perhaps
a core list of BSP init, RTEMS init, application, and C library referenced
would be sufficient. For ticker or hello, this would be:


If you managed to link enough to include Init() and this broke the
then I would expect a very subtle problem that nothing automated will find.
Something like leaving out interrupt vectors which we wouldn't be looking

I am not even sure about printf() since gcc optimizes constant string prints
to puts() and the tests can be configured to use printk().

Any thoughts?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the devel mailing list