This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

m68k-gas & jbsr xxx,a1 (What did Sun ?)


All,

Rereading what gcc generates for a sun m68k target for pic branches, as
described in gcc/config/m68k/m68k.md :

    /* The ',a1' is a dummy argument telling the Sun assembler we want PIC,
       GAS just plain ignores it.  */
    return \"jbsr %0,a1\";

and relating that to (http://sourceware.org/ml/binutils/2000-04/msg00432.html),
an old post of Michael Sokolov :

    3. If we are on a 68000, absolute jumps are not allowed, but the branch is
    actually a C function call that follows the C calling convention (we'll
    need an assembly-level indication of this), we can generate a sequence
    like the following, effecting a 32-bit PC-relative call:

	.word	0x403C	|	movel	#imm,%d0
	.long	<R_68K_PC32 reloc>
	.word	0x4EBB	|	jsr	disp8(%pc,%d0.l)
	.word	0x08FA	|	(index reg is %d0.l, disp8 such that the
			|	 R_68K_PC32 reloc above works normally)

I wonder if that was not the intention of the Sun assembler writers to
generate such code for a 32-bit pic branch on targets lacking bsrl.
I do not have access to an m68k Sun to verify that.

And I wonder also if gas implements that.  That would remove the limitation
for -fPIC on m68000, m68010, m68328 and coldfire 52xx.

It seems to me that the assembly-level indication that Michael requested is,
in the Sun assembler, the name of the register available as index for the
'program counter indirect with (scaled) index 8-bit displacement' addressing
mode.

Philippe

-- 
Philippe De Muyter  phdm at macqel dot be  Tel +32 27029044
Macq Electronique SA  rue de l'Aeronef 2  B-1140 Bruxelles  Fax +32 27029077


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