[PATCH] Add support for ELF notes

Chris Johns chrisj at rtems.org
Fri Mar 24 23:39:04 UTC 2023


On 24/3/2023 7:32 pm, Sebastian Huber wrote:
> On 23.03.23 20:07, Chris Johns wrote:
>> On 24/3/2023 3:57 am, Sebastian Huber wrote:
>>> On 23.03.23 17:52, Will wrote:
>>>> Great idea to store this information in the executable itself. Does this need
>>>> a RTEMS_TEST_STATE_LINK_ONLY test state or something similar for minimum.exe?
>>>
>>> With the notes you can build the test. The test runner would look at the notes
>>> and then decide if it makes sense to run the test or not. It could still run the
>>> minimum.exe and see if it terminates.
>>
>> I welcome notes support. Thanks for adding it.
>>
>> How will we control and manage the notes we support?
> 
> In the new elfnote.h header file there are defines for the note type
> (domain-specific integer).

Great.

>>
>> Should we document the top level notes domains (?) with some we control and
>> restrict and others users can use? For example `note.rtems.test`,
>> `note.rtems.kernel`, `note.rtems.bsp`, and `note.rtems.user`?
> 
> The section name doesn't matter. You can divide the number space of the note
> type for this.

Does this mean we define the numbers or number ranges or is it left open? I am
not sure I am following this bit.

>> Do you have any host side tools in mind to access notes apart from the standards
>> like readefl? Maybe the rtems-exe-info tool could do this?
> 
> Yes, it should be added to this tool. 

Great. Once we have something merged I can take a look.

> I think the most important use case is the
> RTEMS tester currently. You can read the notes with the elftools for Python.

I could not see an elftools module in the standard cpython support and I have
carefully avoided any pipy dependences in user facing tools. We have elf support
in the tool kit so if we can sort something out without needing to add something
else I would prefer it. I think the first thing to do is the get this into
rtems.git and then we can address the tooling we need.

We have a GSoC project to sort out the post link stuff that was stripped out
when we moved to waf. Could that detail be added as notes? There is something
nice about each executable having the needed info and not needing to match an
exe with a specific installed configuration set up.

Chris


More information about the devel mailing list