Many BSPs Fail to link CXX tests
Joel Sherrill
joel at rtems.org
Mon Jan 4 18:23:16 UTC 2016
On Sun, Jan 3, 2016 at 11:00 PM, Gedare Bloom <gedare at rtems.org> wrote:
> On Sun, Jan 3, 2016 at 9:47 PM, Joel Sherrill <joel at rtems.org> wrote:
> >
> >
> > On Sun, Jan 3, 2016 at 8:26 PM, Chris Johns <chrisj at rtems.org> 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
do
target=`echo $f | cut -d'-' -f1`
mynm=${target}rtems4.12-nm
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:
boot_card()
bsp_start()
rtems_initialize_data_structures()
Init()
If you managed to link enough to include Init() and this broke the
executable,
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
for.
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: <http://lists.rtems.org/pipermail/devel/attachments/20160104/b960302b/attachment-0002.html>
More information about the devel
mailing list