R_MIPS_TLS_GD reloc overflow when linking >=xulrunner-22.214.171.124
Tue Jun 1 05:26:00 GMT 2010
On 01:24 Mon 21 Dec , Zhang Le wrote:
> I made some progress, found where the problem happens:
> (gdb) info b
> Num Type Disp Enb Address What
> 2 breakpoint keep y 0x2ab390cc in mips_elf_calculate_relocation at elfxx-mips.c:5094
> stop only if r_type==R_MIPS_TLS_GD
> breakpoint already hit 2 times
> return value:
> 5164 g = mips_elf_local_got_index (abfd, input_bfd, info,
> Value returned is $17 = 73452
This problem still exists for xulrunner-1.9.3_alpha5 and binutils from cvs
(checked out today).
I found that the index's value is assigned here:
next_index = MIPS_ELF_GOT_SIZE (entry->abfd) * (long) g->tls_assigned_gotno;
And the g->tls_assigned_gotno is assigned here:
g->tls_assigned_gotno = g->local_gotno + g->global_gotno;
In one of those overflows:
global_gotno = 0x1239
local_gotno = 0x3c3b
tls_assigned_gotno = 0x4e74
And the next_index is 0x4e74 * 4 = 80336, which is higher than 2**16.
And thus overflow.
However I still haven't found out why the local_gotno and global_gotno is so
high and how to make them not so high.
0260 C902 B8F8 6506 6586 2B90 BC51 C808 1E4E 2973
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: not available
More information about the Binutils