RTEMS | Add dladdr() support to RTEMS (!679)
mazen Adel (@mez3n)
gitlab at rtems.org
Sun Aug 24 13:05:42 UTC 2025
mazen Adel commented on a discussion on cpukit/libdl/rtl.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/679#note_129368
> +void*
> +rtems_rtl_obj_base_address (const rtems_rtl_obj* obj)
> +{
> + void* base = NULL;
> +
> + if (obj->text_base)
> + base = obj->text_base;
> +
> + if (obj->data_base && (!base || obj->data_base < base))
> + base = obj->data_base;
> +
> + if (obj->bss_base && (!base || obj->bss_base < base))
> + base = obj->bss_base;
> +
> + if (obj->const_base && (!base || obj->const_base < base))
> + base = obj->const_base;
In [standard](https://pubs.opengroup.org/onlinepubs/9799919799/functions/dladdr.html) it says
`The value of the _dli_fbase_ member shall be set to the base of the address range occupied by the mapped object`
so here I'm starting with the text_base then proceeding to find the lowest base address occupied by the object to get the base of the address range. They don't overlap but we need to find the base, please correct me if i'm wrong.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/679#note_129368
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250824/763831b7/attachment-0001.htm>
More information about the bugs
mailing list