binutils 2.11 sh-rtems/sh-elf dies building gcc

Joel Sherrill joel.sherrill@OARcorp.com
Tue Apr 10 14:43:00 GMT 2001


Got a test case. :)  The produced as is so bad, it can't 
handle the autoconf test code for "does compiler work". :(

When compiling this file with gcc 2.95.2:

main(){}

using the command sh-rtems-gcc -O4 -S j.c, you get this assembly code:


	.file	"j.c"
	.data
gcc2_compiled.:
___gnu_compiled_c:
	.text
	.align 2
	.global	_main
_main:
	mov.l	r14,@-r15
	mov.l	L3,r1
	sts.l	pr,@-r15
	jsr	@r1
	mov	r15,r14
	mov	r14,r15
	lds.l	@r15+,pr
	rts	
	mov.l	@r15+,r14
L4:
	.align 2
L3:
	.long	___main


which when assembled using the command "sh-rtems-as j.S" produces this
message:

j.s: Assembler messages:
j.s:21: Error: Cannot represent relocation type BFD_RELOC_32
j.s:21: Internal error!
Assertion failure in tc_gen_reloc at
../../binutils-2.11/gas/config/tc-sh.c line 3335.
Please report this bug.

Line 21 is the ".long ___main"

[If you don't include the -O4, it still fails -- the assembly file is
just longer.]

Thanks.

--joel

Joel Sherrill wrote:
> 
> Version: binutils 2.11
> Target:  sh-rtems (sh-elf)
> GCC Version: 2.95.2
> 
> Has anyone seen this assertion up when building gcc:
> 
>   /usr/ports/devel/sh-rtems-gcc/work/build-sh-rtems/gcc/xgcc
> -B/usr/ports/devel/sh-rtems-gcc/work/build-sh-rtems/gcc/
> -B/tmp/sh-rtems-gcc/local/sh-rtems/bin/
> -I/tmp/sh-rtems-gcc/local/sh-rtems/include -O2
> -I.././../gcc-2.95.2/gcc/../newlib/libc/sys/rtems/include
> -DCROSS_COMPILE -DIN_GCC     -O -pipe -I./include   -g1  -DIN_LIBGCC2
> -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc   -I. -I.././../gcc-2.95.2/gcc
> -I.././../gcc-2.95.2/gcc/config -I.././../gcc-2.95.2/gcc/../include -c
> -DL${name} \
>        .././../gcc-2.95.2/gcc/libgcc2.c -o ${name}.o; \
>   if [ $? -eq 0 ] ; then true; else exit 1; fi; \
>   sh-rtems-ar rc tmplibgcc2.a ${name}.o; \
>   rm -f ${name}.o; \
> done
> _muldi3
> {standard input}: Assembler messages:
> {standard input}:206: Error: Cannot represent relocation type
> BFD_RELOC_32
> {standard input}:210: Internal error!
> Assertion failure in tc_gen_reloc at
> .././../binutils-2.11/gas/config/tc-sh.c line 3335.
> Please report this bug.
> 
> If not, James will have to build again to generate the
> offending .S file.
> 
> Thanks.
> 
> --
> Joel Sherrill, Ph.D.             Director of Research & Development
> joel@OARcorp.com                 On-Line Applications Research
> Ask me about RTEMS: a free RTOS  Huntsville AL 35805
>    Support Available             (256) 722-9985

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel@OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985



More information about the Binutils mailing list