This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


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

using relax with ld on i960


I'm using gcc 2.7.2 and ld 2.8.1 to compile i960 code on both a 2.5.1
Solaris and a 6.3 IRIX. I'm compiling for a i960-wrs-vxworks5.3.1
target.

According to the info on ld :
<quote>
   `ld' supports the `--relax' option for the i960 family.  If you
specify `--relax', `ld' finds all `balx' and `calx' instructions whose
targets are within 24 bits, and turns them into 24-bit program-counter
relative `bal' and `cal' instructions, respectively.  `ld' also turns
`cal' instructions into `bal' instructions when it determines that the
target subroutine is a leaf routine (that is, the target subroutine does

not itself call any subroutines).
<end quote>

To test this, I wrote a simple C program that calls a simple procedure
and
returns.  I compile this using the i960-wrs-vxworks5.3.1-gcc with the
-mleaf-procedures and -O3 options, and look at the assembly code.  Sure
enough, my little procedure is treated as a leaf (.lf).  When I link it
with --relax though, the 'calx' (it's actually a callx in the code) is
not changed to 'cal' or 'bal'.

Has anyone else come across this same problem, or does yours work the
way
it is supposed to?  Is there some gcc option I need to include to setup
for
the '--relax'.

Thanks,

======================================
Michael Lewis - Engineering Programmer
Honeywell Defense Avionics Systems
Albuquerque, New Mexico, USA
======================================