[RFC] libdl: Make Elf_Sym::st_other available
Chris Johns
chrisj at rtems.org
Mon Mar 4 06:53:55 UTC 2024
On 1/3/2024 6:05 pm, Sebastian Huber wrote:
> On 29.02.24 00:27, Chris Johns wrote:
>> On 27/2/2024 6:46 pm, Sebastian Huber wrote:
>>> The 64-bit PowerPC ELFv2 relocation support needs access to the
>>> Elf_Sym::st_other symbol information. The machine-specific relocation handler
>>> had only access to the Elf_Sym::st_info symbol information. This change
>>> extends the 8-bit syminfo parameter to 16-bit and uses the additional
>>> 8-bits to provide Elf_Sym::st_other. Another approach could be to pass
>>> a pointer to an Elf_Sym object instead of symname, syminfo, and
>>> symvalue.
>>
>> I think symname and symvalue have to stay or the code needed to support them
>> moves out to all reloc handlers [1]. I agree there is a limit to the number args
>> to keep adding. If there is a need for more fields then it may pay to pass in
>> Elf_Sym* or rtems_rtl_obj_sym* which is the symbol table reference?
>>
>> Chris
>>
>> [1] https://git.rtems.org/rtems/tree/cpukit/libdl/rtl-elf.c#n429
>
> What do you prefer, a new st_other parameter, use Elf_Sym*, or use
> rtems_rtl_obj_sym*?
>
> The
>
> /**
> * An object file symbol.
> */
> typedef struct rtems_rtl_obj_sym
> {
> rtems_chain_node node; /**< The node's link in the chain. */
> const char* name; /**< The symbol's name. */
> void* value; /**< The value of the symbol. */
> uint32_t data; /**< Format specific data. */
> } rtems_rtl_obj_sym;
>
> has no st_info and st_other members. I tend to pass a Elf_Sym* pointer.
Ah thanks. I think Elf_Sym* as changes to sizeof(rtems_rtl_obj_sym) effects the
size of the runtime symbol table. The data you need is only for resolving that
obj's relocs and nothing more if I understand things correctly.
Chris
More information about the devel
mailing list