public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Mauricio Alvarez <alvarez@ac.upc.edu>
To: binutils@sourceware.org
Subject: problems with gas in AIX 5.2
Date: Fri, 12 May 2006 22:16:00 -0000	[thread overview]
Message-ID: <4464BD35.2030006@ac.upc.edu> (raw)

Hi.

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
--prefix=/scratch_tmp/alvarez/powerpc-aix-gnu/result-gcc-4.0.2.orig
--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
-I/scratch_tmp/alvarez/media/ffmpeg/libavutil
-I/scratch_tmp/alvarez/media/ffmpeg/libavcodec
-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

[1] http://ffmpeg.sourceforge.net/index.php

[2] http://gcc.gnu.org/ml/gcc-help/2005-09/msg00178.html

             reply	other threads:[~2006-05-12 16:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-12 22:16 Mauricio Alvarez [this message]
2006-05-15 22:38 ` Nick Clifton
2006-05-15 22:39   ` Mauricio Alvarez
2006-05-19 12:35     ` Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4464BD35.2030006@ac.upc.edu \
    --to=alvarez@ac.upc.edu \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).