* bfd/elf32-mips.c - a small change.
@ 1999-12-02 12:40 Dmitri Makarov
0 siblings, 0 replies; only message in thread
From: Dmitri Makarov @ 1999-12-02 12:40 UTC (permalink / raw)
To: egcs; +Cc: binutils
Chasing a linker bug (it wouldn't link a module, giving me the message:
"jump to stub routine which is not jal") I found these lines in
bfd/elf32-mips.c
/* Calls from 16-bit code to 32-bit code and vice versa require the
special jalx instruction. */
*require_jalxp = (!info->relocateable
&& ((r_type == R_MIPS16_26) != target_is_16_bit_code_p));
When r_type equals for example R_MIPS_32, *require_jalxp is set
to 'true' too, although the relocation is not for a call/jump insn
at all. As it happens next, ld, given require_jalxp is true, checks
whether the relocation entry is jal/jalx insn, extracting its opcode
which is meaningless in this case (the entry is not an insn at all,
but maybe a function pointer or whatever address that needs 32 bit
relocation).
I changed the condition to be as follows and it worked for me just
fine so far. Here's my question -- is this enough? Does it actually
perform the required check of calls from 16-bit to 32-bit code and v.v.?
*require_jalxp = (!info->relocateable
&& (((r_type == R_MIPS16_26) && !target_is_16_bit_code_p)
|| ((r_type == R_MIPS_26) && target_is_16_bit_code_p)));
Regards,
Dmitri.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-12-02 12:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-02 12:40 bfd/elf32-mips.c - a small change Dmitri Makarov
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).