|
From: Dean K. <kol...@qw...> - 2004-12-08 11:37:17
|
I'm pretty sure R_X86_64_PC32 is correct for 64 bit PIC code. In fact, I
had to change these same instructions, the ones with (%rip), to get it to
link on my machine. I was getting the same error message, but for R_X86_64_32S.
I'm new to libtool, so I can't help if that's the problem.
I think -fPIC is for the compiler to generate position independent code,
and won't affect the assembler.
I'm using Fedora Core 2 x86-64, gcc 3.3.3, ld 2.15.90.0.3, libtool 1.5.6
All I can think of now is that the linker is confused, as if it thinks it
is linking 32 bit code or something, or too old to handle R_X86_64_PC32 .
32 bit code used a different relocation mode.
This is how line 19 gets assembled on my system, and it uses R_X86_64_PC32.
I used objdump -d -l -S -r vlc_x86_64.o to generate this:
/home/kolosiek/downloads/libdv/libdv-0.103-cvs/libdv/libdv/vlc_x86_64.S:19
/* note that BITS is left aligned */
/* klass = dv_vlc_classes[maxbits][(bits &
(dv_vlc_class_index_mask[maxbits])) >> */
/* (dv_vlc_class_index_rshift[maxbits])]; */
/* xor %rbp,%rbp */
lea dv_vlc_class_index_mask(%rip),%r11 /* use %rip for
PIC code */
c: 4c 8d 1d 00 00 00 00 lea 0(%rip),%r11 # 13
<dv_decode_vlc+0x13>
f:
R_X86_64_PC32 dv_vlc_class_index_mask+0xfffffffffffffffc
At 09:38 PM 12/7/2004, Richard Baverstock wrote:
>Trying to compile the current CVS on a Suse 9.2 opteron system results
>in the following compile error for me:
>
>
>/bin/sh ../libtool --silent --mode=link --tag=CC gcc -g -O2 -Wall -g
>-o libdv.la -rpath /usr/lib64 -version-info 4:2:0 dv.lo dct.lo
>idct_248.lo weighting.lo quant.lo vlc.lo place.lo parse.lo bitstream.lo
>YUY2.lo YV12.lo rgb.lo audio.lo util.lo encode.lo headers.lo
>enc_input.lo enc_audio_input.lo enc_output.lo vlc_x86_64.lo
>quant_x86_64.lo idct_block_mmx_x86_64.lo dct_block_mmx_x86_64.lo
>rgbtoyuv_x86_64.lo encode_x86_64.lo transpose_x86_64.lo -lm
>/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.4/../../../../x86_64-suse-linux/bin/ld:
>.libs/vlc_x86_64.o: relocation R_X86_64_PC32 against `dv_vlc_index_mask'
>can not be used when making a shared object; recompile with -fPIC
>/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.4/../../../../x86_64-suse-linux/bin/ld:
>final link failed: Bad value
>collect2: ld returned 1 exit status
>
>
>
>
>I added -fPIC to the CCASFLAGS (and can see it in the compile lines),
>however, it doesn't seem to help.
>
>gcc 3.3.4
>libtool 1.5.8
>
>
>
>On Wed, 2004-10-13 at 07:03 -0400, Dan Dennedy wrote:
> > Thank you. I downloaded it, and will work on making sure it merges
> > nicely into my CVS working copy and test. Then, hopefully we get some
> > others to test.
> >
> > On Tue, 2004-10-12 at 00:32 -0700, Dean Kolosiek wrote:
> > > Hello,
> > >
> > > I ported the assembly language of libdv-0.103 to AMD64. I left a copy
> of it
> > > at http://www.users.qwest.net/~kdean6/libdv-0.103-AMD64.tar.gz if you
> want
> > > it. There's no web page for it, just that file, so go directly to it.
> > >
> > > I also found a bug with multi-threading when I ran
> > > enctest. _dv_prepare_reorder_tables gets called by each thread during
> > > initialization, but it's not written to run multiple times. I got
> > > segmentation faults at random times because the time slicing was random,
> > > but many times it worked fine. I did not try to fix it.
> > >
> > > I created a definition ARCH_X86_64 that parallels ARCH_X86 nearly
> > > everywhere. I added x86_64 to make new routine names and new .S file
> names.
> > >
> > > Most of the changes were due to pointers changing to 64 bits, and the
> ABI
> > > changing for AMD64. I used documents at http://www.x86-64.org/ for
> the ABI
> > > and they have a translation hints page. There were some cases where
> there
> > > is no equivalent 64 bit instruction to handle 8 bit data, or the ABI
> calls
> > > for passing parameters in a register that was being used, so it takes
> a few
> > > more instructions in a few places. Another big change is that
> relocatable
> > > libraries use a different relocation mechanism on AMD64, so (%rip) is
> added
> > > to many instructions to generate PC-relative addresses.
> > >
> > > I did not bother translating the use_mmx parts because it is my
> > > understanding that AMD64 chips will always have mmx functionality. This
> > > should be double-checked, and it may not be true for Intel chips.
> > >
> > > I made no attempt to rewrite anything to make use of AMD64 features
> like
> > > 64 bit registers.
> > >
> > > It needs more testing before distribution. I've only tested it with
> enctest
> > > and playdv, and in kino (linking the new code) I played one .avi file
> made
> > > by grabdv. playdv plays the pond.dv example. I'm not really a video
> person,
> > > so I don't know how to come up with tests for it. I'm running it on a
> > > Fedora Core 2 x86-64 Opteron system.
> > >
> > > Dean Kolosiek
> > >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> > Use IT products in your business? Tell us what you think of them. Give us
> > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
> > http://productguide.itmanagersjournal.com/guidepromo.tmpl
> > _______________________________________________
> > libdv-dev mailing list
> > lib...@li...
> > https://lists.sourceforge.net/lists/listinfo/libdv-dev
> >
|