On 06/22/10 11:08, Apostolos Syropoulos wrote:
Hello,

I have tried to generate 64-bit binaries form the SVN version of FFmpeg with 
gcc-4.4.4.
Although the compilation finishes with no error, when running the resulting 
binaries,
I get the following mesage:

$ ffmpeg
ld.so.1: ffmpeg: fatal: relocation error: R_AMD64_PC32: file 
/opt/gnu/lib/amd64/libavformat.so.52: symbol memcpy: value 0x2800d971879 does 
not fit
Killed

I have read on this list someone had a similar problem, so I run the following 
commmand:

$ elfdump -d /opt/gnu/lib/amd64/libavformat.so.52|fgrep TEXTREL
       [40]  TEXTREL           0
       [48]  FLAGS             0x4                 [ TEXTREL ]

Also, note that I compiler uses -fPIC :

CFLAGS=-I/opt/gnu/include   -std=c99 -fomit-frame-pointer -fPIC -g

and

SHFLAGS=-mimpure-text -shared -Wl,-h,$$(@F)

by removing -mimpure-text I get zillions of relocation errors. And using cc is 
out of  question
as  it stops after finding many syntax errors. The strange think is that I have 
managed to
compile MPlayer, but this is statically linked to the corresponding archives.

Thanks in advance for your comments/suggestions.

Apostolos


Assuming that your code is really all pic, then it might be that you
need to utilize the AMD64 medium model, as described here:

    http://developers.sun.com/solaris/articles/about_amd64_abi.html

That page is about the Sun compilers, but the underlying issues
are the same, and I trust that gcc has an option for that. Googling
a bit, I think it might be -mcmodel=medium.

-----

That said, the fact that you're resorting to impure-text suggests
rather strongly that your link contains some non-pic objects. You say
that you're linking against static archives --- is it possible that
the objects in there are not PIC? An easy way to test is to remove
the archives from your link and see if the resulting sharable object
still requires impure-text.

If all else fails, you can use elfdump to find out where the
impure references are coming from, and trace that information
back to the offending object(s).

- Ali

_______________________________________________
tools-linking mailing list
[email protected]

Reply via email to