This is the mail archive of the
mailing list for the GDB project.
Re: [RFC 2/2] Move gdb's xmalloc and friends to new file
- From: Tom Tromey <tom at tromey dot com>
- To: Simon Marchi <simark at simark dot ca>
- Cc: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Mon, 03 Jun 2019 10:33:24 -0600
- Subject: Re: [RFC 2/2] Move gdb's xmalloc and friends to new file
- References: <email@example.com> <firstname.lastname@example.org> <email@example.com>
>>>>> "Simon" == Simon Marchi <firstname.lastname@example.org> writes:
Simon> On 2019-05-30 5:30 p.m., Tom Tromey wrote:
>> When "common" becomes a library, linking will cause a symbol clash,
>> because "xmalloc" and some related symbols are defined in that
>> library, libiberty, and readline.
>> To work around this problem, this patch moves the clashing symbols to
>> a new file, which is then compiled separately for both gdb and
Simon> Hmm how does this work currently? We have an xmalloc symbols both in
Simon> common/common-utils.o and ../libiberty/libiberty.a, why doesn't it clash?
If a symbol comes from a .o then it overrides the symbols coming from
libraries. The error only occurs if the symbol is only provided by
multiple libraries. The former is the case today, because we don't make
a library from common/.