This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: .dynsym pain
>>>>> "Richard" == Richard Henderson <rth@cygnus.com> writes:
Richard> On Tue, Jul 13, 1999 at 10:44:23PM -0700, Mark Mitchell
Richard> wrote:
>> Is MIPS really broken, or do you just think it is?
Richard> I know it is.
OK.
Richard> I'm doubly convinced another sort is needed.
OK. In that case, your patch looks reasonable to me, I guess.
But, I'm nervous about the need for *two* sorts. The reason for the
first sort is to calculate the size of the GOT:
/* There has to be a global GOT entry for every symbol with
a dynamic symbol table index of DT_MIPS_GOTSYM or
higher. Therefore, it make sense to put those symbols
that need GOT entries at the end of the symbol table. We
do that here. */
if (!mips_elf_sort_hash_table (info))
return false;
i = elf_hash_table (info)->dynsymcount - g->global_gotsym->dynindx;
s->_raw_size += i * MIPS_ELF_GOT_SIZE (dynobj);
So, if we resort, and the GOT gets bigger, that's very bad. I assume
that this can't happen. Perhaps you could add an assertion to check
that this situation does not occur? Just checking `elf_hash_table
(info)->dynsymcount - g->global_gotsym->dynindx' before and after the
second sort should do it.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com