This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] linker.c, check for null return from bfd_hash_allocate
> On Thu, Jul 26, 2007 at 03:16:45PM -0700, msnyder@sonic.net wrote:
>> 2007-07-26 Michael Snyder <msnyder@svkmacdonelllnx>
>>
>> * linker.c (bfd_section_already_linked_table_insert): Change
>> return type from void to boolean. Return FALSE on failure.
>> (_bfd_generic_section_already_linked): Test return value of
>> bfd_section_already_linked_table_insert, call fatal on error.
>>
>> * elflink.c (_bfd_elf_section_already_linked): Test return value
>> of bfd_section_already_linked_table_insert, call fatal on error.
>>
>> * libbfd-in.h (bfd_section_already_linked_table_insert): Update
>> return type to bfd_boolean.
>>
>> * libbfd.h: Regenerate.
>
> This is OK,
>
>> ! if (! bfd_section_already_linked_table_insert (already_linked_list,
>> sec))
>> ! info->callbacks->einfo (_("%F%P: internal error at %D"));
>
> except that it isn't correct to call this an "internal error". (It's
> just out of memory.) Use "%F%P: already_linked_table: %E" instead.
Done and committed.
Thanks.