libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libunwind] x86-64 building


From: Chris Whitworth
Subject: [libunwind] x86-64 building
Date: Wed, 25 Jan 2006 12:10:46 +0000 (GMT)

Hi;

This might be useful for some people.

There seems to be an issue building libunwind for x86-64 straight out of
the box, as it were. It compiles fine, but breaks at the link stage with
the error:

/usr/bin/ld: .libs/elf64.o: relocation R_X86_64_PC32 against
`_Uelf64_valid_object' can not be used when making a shared object;
recompile with -fPIC

This is on RHEL 3 and 4, using different versions of gcc, but the same
version (2.15.92.0.2) of binutils.

Building with CFLAGS=-fPIC CXXFLAGS=-fPIC makes no difference.

Googling around, this seems to be a known issue with some versions of
binutils under some circumstances - a call to a protected symbol
generates a R_X86_64_PC32 relocation, but the linker can't resolve that
when generating a shared library.

(see http://sources.redhat.com/bugzilla/show_bug.cgi?id=584)

Removing the "PROTECTED" directive from the declaration of valid_object in
elfxx.c will make the linker happier, but obviously this is not an ideal
solution.

I understand it's fixed in more recent versions of binutils
(http://sourceware.org/ml/binutils-cvs/2005-02/msg00011.html) but I'm not
able to upgrade binutils on my machines so I haven't tried it yet.

Hope someone finds that useful.

Chris
-- 
 Chris Whitworth  | http://www.flat3.org - one day, it'll be a website
  address@hidden | http://home.parm.net - not a blog

   "back when I was young, we had to travel back in time to put the tape
    in so the game would load before we died."


reply via email to

[Prev in Thread] Current Thread [Next in Thread]