Run time linker allocator locking hangs RTEMS

Chris Johns chrisj at rtems.org
Sun Apr 28 23:21:14 UTC 2019


On 28/4/19 10:34 pm, Chris Johns wrote:
> 
>> On 28 Apr 2019, at 7:18 pm, dufault at hda.com wrote:
>>
>> I think you might need to do two passes if that’s straight-forward.  Then you can count, lock, allocate, unlock, read.
> 
> Or grouping the allocations together then the loading however doing this has tripped a bug in dl09 on the PowerPC I am looking into. Something with a symbol look up for reloc rec 33 in the second object file loaded. The other arches are ok. 

I do not think having 2 passes or grouping will help. The issue is determining
the number of trampolines a module needs. The trampolines needs to know the
address of the module to know if the jump or call is within range and it needs
to parse the reloc records and this requires a valid symbol table. Currently the
symbol table is loaded after the code is loaded and this could be moved to after
the allocation however it cannot be done while the allocator lock is being held
as it accesses the ELF file.

I do not think loading the symbol table before allocating the module's workspace
and then resolving the addresses after will help because parsing the reloc
records also requires access to the ELF file and this needs to be done before
allocating the trampoline records.

This is tricky problem.

Chris


More information about the devel mailing list