public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Position Independent Code usage on x86-64
@ 2009-12-16 14:58 Alexey Skidanov
  2009-12-16 15:24 ` Andrew Haley
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Skidanov @ 2009-12-16 14:58 UTC (permalink / raw)
  To: gcc-help

Hi,

We ported our code to 64 bit (CentOS 5.2 64 bit). We have some static
library that linked with some shared library. In 32 bit version, the
shared library was successfully created. Trying to create it in with 64
bit version compiler, we get the error: 

/usr/bin/ld: .//libstatic.a(static.o): relocation R_X86_64_32 against
`__gxx_personality_v0' can not be used when making a shared object;
recompile with -fPIC
.//libstatic.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

We also found that if static library is linked with shared library then
it should be compiled with -fPIC option. But if the static library is
linked with ELF executable it shouldn't.

The questions are:
1. Does it make sense that we need to know about static library exact
usage? 
2. Is there an option of gcc that "generate" backward compatible (with
32 bit version) compilation/linking process? 

We found some explanation here
http://www.technovelty.org/code/c/amd64-pic.html

Thank you in advance,
Alexey

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-12-17  6:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-16 14:58 Position Independent Code usage on x86-64 Alexey Skidanov
2009-12-16 15:24 ` Andrew Haley
2009-12-16 15:26   ` Alexey Skidanov
2009-12-16 15:30     ` Andrew Haley
2009-12-17  6:53       ` Alexey Skidanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).