This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] elf: Assign TLS modid later during dlopen [BZ #24930]


* Gabriel F. T. Gomes:

> The patch looks good to me, and I made a lot of comments below in order
> to explain why I think that is (if you think I got it wrong, then maybe I
> need to review it again).
>
> Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>

Thanks, your comments match may understanding when I wrote the patch.

I do not particularly like the patch, but I think it is the best we can
do given the current implementation.  Do you see an alternative?

>>At that point, the link
>>map pointer will eventually be passed to _dl_close, which will undo
>>the TLS modid assignment.
>
> If I understood this correctly, you are saying that _dl_close will
> eventually make a call to remove_slotinfo, which removes the TLS modid
> assignment.  I don't understand yet when _dl_close gets called, but I
> suppose the two test cases I mentioned above will not cause this.

No, because the link map pointer is never passed to the caller.  We fail
too early for that.  In this case, we deallocate the link map locally in
_dl_map_object_from_fd (via the call_lose label, and finally free (l) in
the lose function).  _dl_close is never called to free the new object.

Thanks,
Florian


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