public inbox for gas2@sourceware.org
 help / color / mirror / Atom feed
* gas-950726/ss-950728/powerpc*-*-eabi: addis 9,0,a-400000@ha ???
@ 1995-08-01  0:41 Andrew Cagney
  1995-08-09 12:38 ` Michael Meissner
  1995-08-11 10:31 ` Michael Meissner
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Cagney @ 1995-08-01  0:41 UTC (permalink / raw)
  To: gas2; +Cc: meissner

Hello,

	c-torture-1.34/execute/index-1.c

from the lines:

	int
	f (int n)
	{
	  return a[n - 100000];
	}

outputs the assembler:

	addis 9,0,a-400000@ha
	addi 11,9,a-400000@l

quite simply, is this valid PowerPC assembler?  Gas doesn't think so:

cagney@puddin$ powerpc-unknown-eabi-gcc -v index-1.c
...
GNU assembler version 950726 (powerpc-unknown-eabi), using BFD version
cygnus-2.5
/usr/tmp/cca29430.s: Assembler messages:
/usr/tmp/cca29430.s:62: Error: Value of -400000 too large for field of 2
bytes at 34
/usr/tmp/cca29430.s:63: Error: Value of -400000 too large for field of 2
bytes at 38

			Andrew


^ permalink raw reply	[flat|nested] 3+ messages in thread

* gas-950726/ss-950728/powerpc*-*-eabi: addis 9,0,a-400000@ha ???
  1995-08-01  0:41 gas-950726/ss-950728/powerpc*-*-eabi: addis 9,0,a-400000@ha ??? Andrew Cagney
@ 1995-08-09 12:38 ` Michael Meissner
  1995-08-11 10:31 ` Michael Meissner
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Meissner @ 1995-08-09 12:38 UTC (permalink / raw)
  To: cagney; +Cc: gas2, meissner

| Hello,
| 
| 	c-torture-1.34/execute/index-1.c
| 
| from the lines:
| 
| 	int
| 	f (int n)
| 	{
| 	  return a[n - 100000];
| 	}
| 
| outputs the assembler:
| 
| 	addis 9,0,a-400000@ha
| 	addi 11,9,a-400000@l
| 
| quite simply, is this valid PowerPC assembler?  Gas doesn't think so:

It probably should be valid PowerPC assembler (given the semantics of
@ha and @l and the fact that the PowerPC elf uses RELA relocations
instead of the stupid REL relocations like the x86 does).  I'll look
into it.

-- 
Michael Meissner, Cygnus Support (East Coast)
Suite 105, 48 Grove Street, Somerville, MA 02144, USA
meissner@cygnus.com,	617-629-3016 (office),	617-629-3010 (fax)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* gas-950726/ss-950728/powerpc*-*-eabi: addis 9,0,a-400000@ha ???
  1995-08-01  0:41 gas-950726/ss-950728/powerpc*-*-eabi: addis 9,0,a-400000@ha ??? Andrew Cagney
  1995-08-09 12:38 ` Michael Meissner
@ 1995-08-11 10:31 ` Michael Meissner
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Meissner @ 1995-08-11 10:31 UTC (permalink / raw)
  To: cagney; +Cc: gas2

| Hello,
| 
| 	c-torture-1.34/execute/index-1.c
| 
| from the lines:
| 
| 	int
| 	f (int n)
| 	{
| 	  return a[n - 100000];
| 	}
| 
| outputs the assembler:
| 
| 	addis 9,0,a-400000@ha
| 	addi 11,9,a-400000@l
| 
| quite simply, is this valid PowerPC assembler?  Gas doesn't think so:

This will be fixed in tonights fixes.  Here are the patches:

Fri Aug 11 13:23:56 1995  Michael Meissner  <meissner@cygnus.com>

	* write.h (struct fix): Add new field fx_no_overflow.

	* write.c (fixup_segment): If fx_no_overflow is non-zero, don't
	complain if the addend is too large.

	* config/tc-ppc.c (md_assemble): Set fx_no_overflow if the half
	word relocations BFD_RELOC_{LO16,HI16,HI16_S}.

*** write.h.~1~	Wed Jul 12 10:17:43 1995
--- write.h	Fri Aug 11 13:16:44 1995
*************** struct fix
*** 78,83 ****
--- 78,88 ----
    /* Has this relocation already been applied?  */
    unsigned fx_done : 1;
  
+   /* Suppress overflow complaints on large addends.  This is used
+      in the PowerPC ELF config to allow large addends on the
+      BFD_RELOC_{LO16,HI16,HI16_S} relocations.  */
+   unsigned fx_no_overflow : 1;
+ 
    /* How many bytes are involved? */
    short int fx_size;
  
*** write.c.~1~	Thu Aug 10 09:13:24 1995
--- write.c	Fri Aug 11 13:17:16 1995
*************** fixup_segment (fixP, this_segment_type)
*** 2391,2397 ****
  	    }
  	}
  
!       if (!fixP->fx_bit_fixP && size > 0)
  	{
  	  valueT mask = 0;
  	  if (size < sizeof (mask))
--- 2391,2397 ----
  	    }
  	}
  
!       if (!fixP->fx_bit_fixP && !fixP->fx_no_overflow && size > 0)
  	{
  	  valueT mask = 0;
  	  if (size < sizeof (mask))
*** config/tc-ppc.c.~1~	Fri Jul 21 23:10:32 1995
--- config/tc-ppc.c	Fri Aug 11 13:16:54 1995
*************** md_assemble (str)
*** 875,887 ****
  	  reloc_howto_type *reloc_howto = bfd_reloc_type_lookup (stdoutput, fixups[i].reloc);
  	  int size = (!reloc_howto) ? 0 : bfd_get_reloc_size (reloc_howto);
  	  int offset = target_big_endian ? (4 - size) : 0;
  
  	  if (size > 4)
  	    abort();
  
! 	  fix_new_exp (frag_now, f - frag_now->fr_literal + offset, size,
! 		       &fixups[i].exp, (reloc_howto && reloc_howto->pc_relative),
! 		       fixups[i].reloc);
  	}
        else
  	fix_new_exp (frag_now, f - frag_now->fr_literal, 4,
--- 875,899 ----
  	  reloc_howto_type *reloc_howto = bfd_reloc_type_lookup (stdoutput, fixups[i].reloc);
  	  int size = (!reloc_howto) ? 0 : bfd_get_reloc_size (reloc_howto);
  	  int offset = target_big_endian ? (4 - size) : 0;
+ 	  fixS *fixP;
  
  	  if (size > 4)
  	    abort();
  
! 	  fixP = fix_new_exp (frag_now, f - frag_now->fr_literal + offset, size,
! 			      &fixups[i].exp, (reloc_howto && reloc_howto->pc_relative),
! 			      fixups[i].reloc);
! 
! 	  /* Turn off complaints that the addend is too large for things like
! 	     foo+100000@ha.  */
! 	  switch (fixups[i].reloc)
! 	    {
! 	    case BFD_RELOC_LO16:
! 	    case BFD_RELOC_HI16:
! 	    case BFD_RELOC_HI16_S:
! 	      fixP->fx_no_overflow = 1;
! 	      break;
! 	    }
  	}
        else
  	fix_new_exp (frag_now, f - frag_now->fr_literal, 4,

-- 
Michael Meissner, Cygnus Support (East Coast)
Suite 105, 48 Grove Street, Somerville, MA 02144, USA
meissner@cygnus.com,	617-629-3016 (office),	617-629-3010 (fax)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1995-08-11 10:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-08-01  0:41 gas-950726/ss-950728/powerpc*-*-eabi: addis 9,0,a-400000@ha ??? Andrew Cagney
1995-08-09 12:38 ` Michael Meissner
1995-08-11 10:31 ` Michael Meissner

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).