This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [RFC 2/2] Move gdb's xmalloc and friends to new file


>>>>> "Simon" == Simon Marchi <simark@simark.ca> 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
>> gdbserver.

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/.

Tom


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