On Mon, Mar 16, 2009 at 06:19:01PM +0100, Joel Porquet wrote: > 2009/3/12 Daniel Jacobowitz <d...@false.org>: > > On Thu, Mar 12, 2009 at 02:02:36PM +0100, Joel Porquet wrote: > >> > Check what symbol is at, or near, 0x40030000 + 22368. It's probably > >> > the GOT plus a constant bias. > >> > >> It seems there is nothing at this address. Here is the program header: > > > > Don't know then. Look at compiler-generated assembly instead of > > disassembly; that often helps. > > Do you mean the object file produced by gcc before linkage?
That will do, but the actual assembly (-S) is more helpful sometimes. > > This is a *module* relocation. In local dynamic the module is always > > the current DSO; it does not need a symbol. > > But what if the DSO access other module's TLS? Then it does not use "Local" Dynamic to do so. > > Finally, I noticed another problem. GCC seems to not make room for the > 4 arguments as specified in the ABI, when calling __get_tls_addr. > For example, here is an extract of the code for calling (we see that > data are stored directly at the top of the stack): > > ... > 5ffe0bfc: 27bdfff0 addiu sp,sp,-16 > 5ffe0c00: afbf000c sw ra,12(sp) > 5ffe0c04: afbc0000 sw gp,0(sp) That line is bogus. Figure out where it came from; the cprestore offset should not be zero. -- Daniel Jacobowitz CodeSourcery