This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] dl_next_phdr (was Re: fde-glibc.c bug)


Jakub Jelinek <jakub@redhat.com> writes:

> How about this?
> This one does not have callback, but of course can be easily changed into
> one if that is desired.

This is not good.  The reason to use a callback function is for the
caller (i.e., this new function) to allocate the memory for the data
structure which is passed.  This way the implementation can extend the
data structure without having compatibility problems.  The callback
should take a pointer to a data structure and a parameter with the
size.

> It does not do any locking (yet), but AFAIC dlsym and other
> functions don't do any locking either.

dlopen does locking.  dlsym doesn't have to.  If you call dlsym while
unloading the object it's your own fault.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]