Re: [PATCH v2 1/1] gdb: Preserve IFUNC marker when finding inferior functions

Tom Tromey <[email protected]> Wed, 22 Jul 2026 07:36:54 -0600
Newsgroups gmane.comp.gdb.patches
Message-ID <[email protected]>
>>>>> Florian Weimer <[email protected]> writes:

Florian> Does GDB ever free the copy of the literal?

>> No.  I think there's a bug open about this but it's never seemed
>> important to fix.

> This is perhaps the main reason for using malloc?  The proper lifetime
> of the literal is unclear, so it can never be deallocated, and using
> malloc at least avoids wasting a full page?

gdb has used malloc for this since well before I worked on gdb, like
decades before.  Probably the rationale has been lost.

Anyway, yes, I think one reason this isn't fixed is that it's not clear
when the memory ought to freed.  Also AFAIK this has never been a real
issue in practice.

Tom