From jagadishbb at gmail.com Mon Dec 29 11:26:06 2008 From: jagadishbb at gmail.com (Jags) Date: Mon, 29 Dec 2008 16:56:06 +0530 Subject: Question about MIPS-TLS DTP relocations Message-ID: <7c3ac71c0812290326r4dc7e080ma251b21fb5023222@mail.gmail.com> Hi All, With reference to the TLS Support in MIPS, I have one question regarding MIPS relocations in dynamic linker for static tls objects. I have my own system libraries, which contains static __thread tls data types in it. The readelf of my library shows the following: readelf -a ./lib/libX.so | grep TLS TLS 0x0987a8 0x000a87a8 0x000a87a8 0x00000 0x0000c R 0x4 000adb30 00000026 R_MIPS_TLS_DTPMOD When I prepare my executable and run it, dynamic linker fails to relocate the symbols and aborts. My question is we do not have a relocation type of R_MIPS_TLS_DTPMOD, instead we have R_MIPS_TLS_DTPMOD32 and R_MIPS_TLS_DTPMOD64. So my dynamic linker is correct?? Do i need to use -fPIE, instead of -fPIC. Is my understanding correct. Where could be the problem. Thanks in advance, -- Jagadish -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan at codesourcery.com Mon Dec 29 16:56:14 2008 From: dan at codesourcery.com (Daniel Jacobowitz) Date: Mon, 29 Dec 2008 11:56:14 -0500 Subject: [mips-tls] Question about MIPS-TLS DTP relocations In-Reply-To: <7c3ac71c0812290326r4dc7e080ma251b21fb5023222@mail.gmail.com> References: <7c3ac71c0812290326r4dc7e080ma251b21fb5023222@mail.gmail.com> Message-ID: <20081229165614.GC6443@caradoc.them.org> On Mon, Dec 29, 2008 at 04:56:06PM +0530, Jags wrote: > When I prepare my executable and run it, dynamic linker fails to relocate > the symbols and aborts. Sounds like your dynamic linker does not support TLS. > My question is we do not have a relocation type of R_MIPS_TLS_DTPMOD, > instead we have R_MIPS_TLS_DTPMOD32 and R_MIPS_TLS_DTPMOD64. > So my dynamic linker is correct?? Do i need to use -fPIE, instead of -fPIC. Try readelf -W (--wide). It's just cutting off the last few characters. -- Daniel Jacobowitz CodeSourcery