off by one in bfd/syms.c or bfd/elfcode.h?
Gregory Steuck
greg@nest.cx
Tue Mar 26 08:36:00 GMT 2002
>>>>> "hjl" == hjl <H> writes:
>> Note that we base it on the count plus 1, since we will null
>> terminate the vector allocated based on this size. However, the
>> ELF symbol table - always has a dummy entry as symbol #0, so it
>> ends up even.
hjl> Why (symcount - 1 + 1)?
That's the way it was and according to the comment above it's to make it
clear that we subtract 1 for the empty symbol #0 and then add one for
the terminating null pointer. Except there is no symbol #0 when symbol
table is empty, which caused the problem that started me on this path.
More information about the Binutils
mailing list