This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

problems with gas in AIX 5.2


I am trying to compile the FFMPEG multimedia application [1] under AIX
operating system (AIX 5.2, Power processor) using the GCC compiler
version 4.0.2 and the GNU GAS (version 2.16.1)

The gcc-4.0.2 was built using the gcc-3.1 and the native (IBM) assembler
and linker. I have used the native assembler and linker because it seems
that is not possible to build gcc with binutils under AIX 5.X [2].

/powerpc-ibm-aix5.2.0.0-gcc-4.0.2 -v
Using built-in specs.
Target: powerpc-ibm-aix5.2.0.0
Configured with: ../gcc-4.0.2.orig/configure
--enable-languages=c,c++ --disable-nls --disable-multilib
Thread model: aix
gcc version 4.0.2

With gcc-4.0.2 and the native assembler and linker I have successfully
compiled and executed the FFMPEG application.

What I want to do is to use GAS in order to assembly some files of the
program. Why? because I want to modify the assembler for some particular
purposes (like adding new instructions and running the binaries on an
emulator ).

Now I am doing something like this:
to compile a selected file with gcc-4.0.2 to assembly
to assemble the result file to object file with gas-2.16.1
link the resultant object file and other objects with gcc-4.0.2

powerpc-ibm-aix5.2.0.0-gcc-4.0.2 -O3 -g -Wall -Wno-switch  -I.
-I/scratch_tmp/alvarez/media/ffmpeg/libavformat -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -D_GNU_SOURCE  -S -o ffmpeg.s ffmpeg.c

/result-binutils-2.16.1.orig/bin/as -mppc -o ffmpeg.o ffmpeg.s

powerpc-ibm-aix5.2.0.0-gcc-4.0.2  -g -o ffmpeg_g ffmpeg.o cmdutils.o
-L./libavformat -lavformat -L./libavcodec -lavcodec -L./libavutil
-lavutil -lm

But in this case the final executable breaks with a Segmentation Fault.

The only difference with the correct version is the use of GAS for
assembling this file, so that indicates that there is problem with GAS.

Trying to figure out what can be the problem I have made an object dump
of the two files, one generated with the IBM assembler and the other one
with GAS (objdump -m powerpc:common -d ffmpeg.o )

What I can see from the dumps is that the only difference is in the way
of accessing the variables pointed by the TOC pointer. Here is an example

-       4:	80 a2 00 00 	lwz     r5,0(r2)
+       4:	80 a2 00 dc 	lwz     r5,220(r2)

this differences in offsets is maintained in all the accesses performed
in this file.

My question is. Is that a (known) bug in GAS? Is there any patch to
resolve this problem? Or is there any compilation or assembly option
that can avoid it?

Thanks in advance for your comments.

Mauricio Alvarez



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]