RFC: solib.c:solib_map_sections so->so_name clobbering

Joel Brobecker brobecker@adacore.com
Fri Mar 29 01:59:00 GMT 2013


> Joel> What do you (or others!) think? I am happy to test and submit a proper
> Joel> patch.
> 
> It sounds reasonable to me.
> I'm sorry about the mess here.

Thanks for the feedback, and really you should not feel sorry at all.
It wasn't your mess :-). And the good news is that I feel like we are
slowly making it better.

Attached is the patch I tested on x86_64-linux. I am off next week,
but I will also apply it to AdaCore's version of GDB to get some
exposure on all the targets that we support. JIC. That will give
more time for others to comment as well, if needed.

gdb/ChangeLog:

        * solib.c (solib_map_sections): Remove code overwriting
        SO->SO_NAME with the bfd's filename.

> Joel> We wouldn't be able to use a patch like this on the 7.6 branch,
> Joel> so for Darwin, I'd restore the xstrdup below - it would be a memory
> Joel> leak, but better to have a leak than not having the shared library name,
> Joel> IMO.
> 
> You can make it not leak by using bfd_alloc.

Neat! I will try that before I go.

Thanks again,
-- 
Joel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Do-not-overwrite-so_list-s-so_name-in-solib_map_sect.patch
Type: text/x-diff
Size: 1095 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20130329/fd6531fd/attachment.bin>


More information about the Gdb-patches mailing list