[PATCH] MIPS: Fix GOT page counter in multi-got links

James Cowgill james.cowgill@mips.com
Thu Apr 5 16:11:00 GMT 2018


Hi Cary,

On 05/04/18 16:50, Cary Coutant wrote:
>> The record_got_page_entry function records and updates the maximum
>> number of GOT page entries which may be required by an object. In the
>> case where an existing GOT page entry was expanded, only the entry
>> belonging to output GOT would have its page count updated. This leaves
>> the entry belonging to the object GOT with the num_pages count of 1 it
>> was originally initialized with. Later on when GOTs are being merged in a
>> multi-got link, this causes the value of entry->num_pages in
>> add_got_page_entries to always be 1 and underestimates the number of pages
>> required for the new entry. This in turn leads to an assertion failure in
>> get_got_page_offset where we run out of pages.
>>
>> Fix by obtaining the object's GOT entry unconditionally and not just
>> the first time it gets created. Now that entry2 is always valid, remove
>> the useless NULL checks.
>>
>> I need someone to commit this for me.
>>
>> gold/
>> 2018-02-20  James Cowgill  <james.cowgill@mips.com>
>>
>>         PR gold/22770
>>         * mips.cc (Mips_got_info::record_got_page_entry): Fetch existing
>>         page entries for the object's GOT.
> 
> Sorry, this patch slipped through my mail filters. I've committed the
> patch on your behalf.

Thanks, however there is a problem. When I originally submitted the
patch I thought the FSF copyright assignment for *@mips.com had been
sorted out but I have now learned that it was not (I think), so the
commit may have to be reverted.

Also, off list, someone pointed out some improvements to the patch (only
simplifications - the patch as committed still works). These ended up in
v3 which was attached to the bug report just now. Someone poked me to
submit the v3 which I was about to do until you committed the original
patch :)

James



More information about the Binutils mailing list