This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
MIPS16: AS wouldn't assemble gcc output.
- To: binutils at sourceware dot cygnus dot com
- Subject: MIPS16: AS wouldn't assemble gcc output.
- From: Dmitri Makarov <dim at windriver dot com>
- Date: Thu, 2 Mar 2000 17:04:16 -0800 (PST)
- Cc: gcc at gcc dot gnu dot org;dim at mail dot wrs dot com;;
I'm sorry I couldn't find more meaningful subject for the posting.
Here's the problem and I'm hoping for recommendations on how to solve it.
In a c++ source I have the following declaration (it's only a fragment)
template <int N> class RWTBitVec
{
public:
............
RWBitRef operator[](size_t i)
{
((void) (( i<(size_t)N ) ? ((void) 0)
: __assert ("Assertion failed:""i<(size_t)N"", file " "tbitvec.h" ", line ""142" "\n"))) ;
return RWBitRef(vec_,i);
}
...........
}
The call to __assert is generated to be:
$LC21:
.ascii "Assertion failed: i<(size_t)N, file "
.ascii "tbitvec.h, line 142\n\000"
.align 2
............................................
.size __cl__t9RWTBitVec1i17Ui,$Lfe15-__cl__t9RWTBitVec1i17Ui
.section .gnu.linkonce.t.__vc__t9RWTBitVec1i17Ui,"ax",@progbits
.align 2
.weak __vc__t9RWTBitVec1i17Ui
.type __vc__t9RWTBitVec1i17Ui,@function
.ent __vc__t9RWTBitVec1i17Ui
__vc__t9RWTBitVec1i17Ui:
.frame $17,16,$31 # vars= 0, regs= 3/0, args= 16, extra= 0
.mask 0x80030000,-24
.fmask 0x00000000,0
addu $sp,$sp,-32
.............................................
$L396:
la $4,$LC21 <---------- ERROR
jal __assert
AS gives the error: Error: unsupported PC relative reference to
different section
The reason: $LC21 and la $4,$LC21 are in different sections. Comment
in gas/config/tc-mips.c says, that:
/* FIXME: We should support this, and let the linker
catch branches and loads that are out of range. */
as_bad_where (fragp->fr_file, fragp->fr_line,
_("unsupported PC relative reference to different section"));
LA $4, $LC21 isn't really a PC rel. load from different section...
Anyway, my question is anybody working on this or can someone give me
a hint on how this should be fixed, before I dive in GAS intricacies?
Thanks.