On 1/9/14 11:58 AM, Tom Tromey wrote:
> Hi.
> 
> Right now, readline exports "xmalloc" and "xrealloc".  I think it would
> be better if these were renamed to be in the readline namespace.
> 
> Currently gdb provides its own xmalloc in the main executable.  This
> overrides the readline xmalloc.  However, while experimenting with
> removing gdb's copy in favor of the libiberty xmalloc, I tripped across
> the readline copy.  Having gdb use libiberty's fails because then gdb
> tries to link against two libraries that each provide their own xmalloc.

That's an interesting problem.  Traditional linker behavior would suggest
that the first library to provide the symbol wins.  Which version of
readline are you using?  Readline-6.1 provided `xfree' in the same file
as xmalloc and xrealloc, and doing so caused the linker to drag in
readline's xmalloc.o, resulting in multiple symbol definitions.

> I can send a readline patch if you think this is acceptable.
> I'd suggest rl_malloc and rl_realloc as new names.

I am too late in my release cycle to get this into readline-6.3, but I
will look at it for the next version.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    [email protected]    http://cnswww.cns.cwru.edu/~chet/

_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to