[PATCH 3/3] elf: Add _dl_find_eh_frame function

Florian Weimer fweimer@redhat.com
Thu Nov 18 16:28:27 GMT 2021


* Jakub Jelinek:

> dl_iterate_phdr is declared in link.h and without the _ prefix, shouldn't
> dl_find_eh_frame follow the suit and be declared in the same header and
> also without the prefix?

We need to use the _ prefix due to this bug:

  dl_iterate_phdr namespace violation 
  <https://sourceware.org/bugzilla/show_bug.cgi?id=28503>

Not sure about moving to <link.h>.  The interface is a bit like dladdr,
and that lives in <dlfcn.h>.

> Also, shouldn't the DL_FIND_EH_FRAME_DBASE macro on the other side have
> __ prefix?  We have one DL_* macro, DL_CALL_FCT, so perhaps it is fine
> for -D_GNU_SOURCE, but various other projects do use macros with DL_*
> prefix, like boost or python.

<link.h> is not covered by standards, and we rarely use _GNU_SOURCE
conditionals in such headers.  The _ prefix is only needed because of
external linkage.

Thanks,
Florian



More information about the Libc-alpha mailing list