linux-mips
[Top] [All Lists]

Jump/branch to external symbol

To: linux-mips@linux-mips.org
Subject: Jump/branch to external symbol
From: Alex Gonzalez <langabe@gmail.com>
Date: Fri, 6 Jan 2006 10:41:30 +0000
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=H+zeV1IM68ru1z0EnFJ1P574MPc/WNHRLz+aqvXZHWat1Hi7BaoRTFtRUQE6XMPgLRS60eb89FTbBU/8Wh41mAZee83c2PVcrouBjpERjvfdpGAULdpAZTUDSv5dfTWaLJQS59qUc6E2XfvTxX970j9ogVfTgC1/gvTBuDpznbw=
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Hi,

I am having GNU gas related problems when compiling assembler files
which contain jumps to external symbols, for example when jumping from
an assembler to a C function.

Using binutils-2.15 GAS will produce a "Cannot branch to undefined
symbol" error. Applying the patch at
http://sources.redhat.com/ml/binutils/2004-04/msg00476.html, which
creates an "allow_branch_to_undefined" option I am able to succesfully
compile an executable. I am happy with this as I only need to apply
the option to the problematic files and it does not change the
behaviour of gas in general.

Now, my crosscompiler toolchain is based on binutils-2.13. When I try
to apply the same patch to it, I get a different error, "Can not
represent BFD_RELOC_16_PCREL_S2 relocation in this object file
format".

There are various posts around referring to this problems. As a
consequence I have read different opinions, solutions that apply to
specific version or binutils, solutions more or less accepted by
everyone, and as usual I am very confused.

If I compile with "-mno-abicalls -fno-pic" gas reports no errors
(which I believe is what the Linux kernel does), but I need to link
with some pic libraries which use glibc, so this is not a valid
solution for me.

I am happy with the patch for binutils-2.15, and I would need a
solution for binutils-2.13.

Can anybody offer any help?

Thanks,
Alex

<Prev in Thread] Current Thread [Next in Thread>