# Dt\_textrel problem with ruby module

**URL:** <https://www.ruby-forum.com/t/dt-textrel-problem-with-ruby-module/61785>\
**Category:** Ruby\
**Created:** [May 27, 2006, 6:18am UTC](https://www.ruby-forum.com/t/dt-textrel-problem-with-ruby-module/61785 "2006-05-27T06:18:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmjmjm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/898d66/32.png) [@jmjmjm](https://www.ruby-forum.com/u/jmjmjm)\
**Post date:** [May 27, 2006, 6:18am UTC](https://www.ruby-forum.com/t/dt-textrel-problem-with-ruby-module/61785/1 "2006-05-27T06:18:25Z")

</div>

I’m attempting to debug a problem with a ruby module I wrote in C and  
am receiving a warning from ld which may be causing the segfault. Does  
anyone know what can cause this warning?

…/bin/ld: warning: creating a DT\_TEXTREL in object.

Jeff.

---

<div class="post-metadata">

**Author:** ![jmjmjm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/898d66/32.png) [@jmjmjm](https://www.ruby-forum.com/u/jmjmjm)\
**Post date:** [May 27, 2006, 11:53am UTC](https://www.ruby-forum.com/t/dt-textrel-problem-with-ruby-module/61785/2 "2006-05-27T11:53:04Z")

</div>

> > > > > “j” == jm [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

j\> …/bin/ld: warning: creating a DT\_TEXTREL in object.

try to add -fPIC when you compile it.

Guy Decoux

---

<div class="post-metadata">

**Author:** ![jmjmjm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/898d66/32.png) [@jmjmjm](https://www.ruby-forum.com/u/jmjmjm)\
**Post date:** [May 28, 2006, 6:28am UTC](https://www.ruby-forum.com/t/dt-textrel-problem-with-ruby-module/61785/3 "2006-05-28T06:28:31Z")

</div>

On 27/05/2006, at 7:51 PM, ts wrote:

> > > > > > “j” == jm [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:
> 
> j\> …/bin/ld: warning: creating a DT\_TEXTREL in object.
> 
> try to add -fPIC when you compile it.

The extconf file already contains directive -fPIC

$ cat extconf.rb  
require ‘mkmf’

$CFLAGS=“-O2 -pipe -fPIC”  
…

The resulting make compile is

$ make  
i686-pc-linux-gnu-gcc -fPIC -O2 -pipe -fPIC -I.  
-I/usr/lib/ruby/1.8/i686-linux -I/usr/lib/ruby/1.8/i686-linux -I. -c  
Vflow.c  
i686-pc-linux-gnu-gcc -shared -L’/usr/lib’ -Wl,-R’/usr/lib’ -o  
Vflow.so Vflow.o -Wl,-R -Wl,/usr/lib -L/usr/lib -L. -lruby18 -lft -lz  
-ldl -lcrypt -lm -lc  
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/…/…/…/…/i686-pc-  
linux-gnu/bin/ld: warning: creating a DT\_TEXTREL in object.

I’d seen the -FPIC thing in the few web pages I’d manage to find that  
mentioned this error. Unfortunately this doesn;t seem to fix the  
problem. I’m scratching my head over this one. gcc, glibc and ld have  
all been upgraded to the latest.

gcc version 3.3.5-20050130  
GNU ld version 2.16.1

This is on a gentoo box. I’ve also got access to a fedora core 5 box  
and the next chance I get I’ll be testing there to see if it’s a  
platform related problem.

If anyone has any advise please speak up. Anyway, thanks for the  
suggestion Guy.

Jeff.

---

<div class="post-metadata">

**Author:** ![jmjmjm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/898d66/32.png) [@jmjmjm](https://www.ruby-forum.com/u/jmjmjm)\
**Post date:** [June 3, 2006, 5:25am UTC](https://www.ruby-forum.com/t/dt-textrel-problem-with-ruby-module/61785/4 "2006-06-03T05:25:48Z")

</div>

On 28/05/2006, at 2:26 PM, jm wrote:

> platform related problem.  
> Got around to testing this on a Fedora Core 5 box today and there  
> doesn’t seem to be a problem. This seems to imply that the problem is  
> platform specific. That gentoo (at least in the version I’m running) is  
> only platform that is affected. As I’ve got no idea what is causing  
> this I’m simple going to avoid it by not running this code on that box.

This reply is more for future reference for anyone else that may  
stubble across this problem than anything else.

Jeff.
