public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: --target=v850-unknown-elf, linker problem
       [not found] ` <20050815080806.GA1026@dd.nec.com.au>
@ 2005-08-15 17:53   ` Torsten Mohr
  2005-08-16  3:04     ` Erik Christiansen
  2005-08-17 19:41     ` James E Wilson
  0 siblings, 2 replies; 6+ messages in thread
From: Torsten Mohr @ 2005-08-15 17:53 UTC (permalink / raw)
  To: binutils, gcc; +Cc: Erik Christiansen

Hi,

> To my untrained eye, this looks a little like a bug. In
> v850/lib1funcs.asm, .L_return_interrupt should IMHO be in the
> .call_table_text section, not .text. (Would you like to try making the
> change? It's still line 1459 in 3.4.4) We might be able to sneak in a
> fix before the experts arrive with more sage advice. ;-)

great, thanks for that hint, i just uncommented the ".text" in
line 1459 in lib1funcs.asm (for gcc-3.4.4).  Now the code links
fine.

I wonder now how to proceed, do i need to report this stuff officially
somewhere?  I also got no answer to my mail from saturday morning,
subject line "-mwarn-signed-overflow".  I had to do that change to
make gcc-3.4.4 compile.


Best regards,
Torsten.


>
> That said, using v850e-gcc 3.3, I found the easiest way to make all the
> callt pain go away was to turn off compiler optimisation. (Although I
> only have a fortnight's experience with the v850, so far it seems that
> v850e-gcc 3.3 defaults to conventional push/pop sequences, in lieu of
> the callt size optimisation. So there is no .call_table_data to
> complicate initial attempts to get things to compile, if optimisation is
> turned off. Version 3.4.4 may do the same.)
>
> Adding your source lines to my first chunk of test code generated what was
> expected:
>
> 00402000 <_irq_nmi>:
>   402000:   5c 1a          add   -4, sp
>   402002:   63 ef 01 00    st.w  r29, 0[sp]
>   402006:   03 e8          mov   sp, r29
>   402008:   1d 18          mov   r29, sp
>   40200a:   23 ef 01 00    ld.w  0[sp],r29
>   40200e:   44 1a          add   4, sp
>   402010:   7f 00          jmp   [lp]
>
> (And no errors. :-)
>
> > When i don't use -mv850e, but use -mv850, all works fine.
>
>    IIUC that's because mv850 doesn't have the callt instruction, so the
> problematic optimisation is not invoked.
>
>    I still don't fully grok the callt stuff either, so best of luck.
>
> hth,
> Erik

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

* Re: --target=v850-unknown-elf, linker problem
  2005-08-15 17:53   ` --target=v850-unknown-elf, linker problem Torsten Mohr
@ 2005-08-16  3:04     ` Erik Christiansen
  2005-08-16 20:48       ` Torsten Mohr
  2005-08-17 19:53       ` James E Wilson
  2005-08-17 19:41     ` James E Wilson
  1 sibling, 2 replies; 6+ messages in thread
From: Erik Christiansen @ 2005-08-16  3:04 UTC (permalink / raw)
  To: Torsten Mohr; +Cc: binutils, gcc

[-- Attachment #1: Type: text/plain, Size: 825 bytes --]

On Mon, Aug 15, 2005 at 07:55:00PM +0200, Torsten Mohr wrote:
> I wonder now how to proceed, do i need to report this stuff officially
> somewhere? 

I've taken the liberty of cleaning up the L_callt_save_interrupt
#ifdef, making it consistent with the following one for
L_callt_save_all_interrupt. (This not only removes the .text error, but
adopts the easier to handle layout of the latter.)

Would you mind applying the attached patch, and rebuilding v850e-gcc, to
check it works for you? I'd happily have a look at the elf generated
from a small test, if you'd like to send it off-list. (Just the
.call_table_data and .call_table_text sections would suffice.) Once
we're happy with it, I'll put the bug report and patch into bugzilla.

I'm happy to move over to a gcc mailing list, but am not currently
subscribed.

Erik

[-- Attachment #2: lib1funcs.patch --]
[-- Type: text/plain, Size: 2216 bytes --]

--- /mnt/usr/local/src/gcc-3.4.4/gcc/config/v850/lib1funcs.asm	Thu Jan  1 04:22:33 2004
+++ /home/erik/tmp/lib1funcs.asm	Tue Aug 16 12:05:36 2005
@@ -1428,7 +1428,7 @@
 
 	
 #ifdef	L_callt_save_interrupt
-	/* Put this functions into the call table area */
+	/* Put these functions into the call table area */
 	.call_table_text
 	
 	/* Save registers r1, ep, gp, r10 on stack and load up with expected values.  */
@@ -1440,23 +1440,14 @@
         st.w    ep,  0[sp]
         st.w    gp,  4[sp]
         st.w    r1,  8[sp]
-        /* R10 has alread been saved bofore callt ctoff(_save_interrupt).  */
+        /* R10 has alread been saved before callt ctoff(_save_interrupt).  */
         /* st.w    r10, 12[sp]  */
 	mov	hilo(__ep),ep
 	mov	hilo(__gp),gp
 	ctret
 
-        /* Place the offsets of the start of the routine into the call table.  */
-        .call_table_data
-        .global __callt_save_interrupt
-        .type   __callt_save_interrupt,@function
-__callt_save_interrupt: .short ctoff(.L_save_interrupt)
-
-        .call_table_text
-
 	/* Restore saved registers, deallocate stack and return from the interrupt.  */
-        /* Called via:  callt ctoff(__callt_restore_itnerrupt).  */
-	.text
+        /* Called via:  callt ctoff(__callt_restore_interrupt).  */
 	.align	2
 	.globl	__return_interrupt
 	.type	__return_interrupt,@function
@@ -1472,9 +1463,13 @@
         addi    24, sp, sp
         reti
 
-	/* Place the offsets of the start of the routine into the call table.  */
+	/* Place the offsets of the start of these routines into the call table.  */
 	.call_table_data
 
+        .global __callt_save_interrupt
+        .type   __callt_save_interrupt,@function
+__callt_save_interrupt:         .short ctoff(.L_save_interrupt)
+
         .global __callt_return_interrupt
         .type   __callt_return_interrupt,@function
 __callt_return_interrupt:       .short ctoff(.L_return_interrupt)
@@ -1482,7 +1477,7 @@
 #endif /* L_callt_save_interrupt */
 
 #ifdef L_callt_save_all_interrupt
-	/* Put this functions into the call table area.  */
+	/* Put these functions into the call table area.  */
 	.call_table_text
 	
 	/* Save all registers except for those saved in __save_interrupt.  */

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

* Re: --target=v850-unknown-elf, linker problem
  2005-08-16  3:04     ` Erik Christiansen
@ 2005-08-16 20:48       ` Torsten Mohr
  2005-08-17 19:53       ` James E Wilson
  1 sibling, 0 replies; 6+ messages in thread
From: Torsten Mohr @ 2005-08-16 20:48 UTC (permalink / raw)
  To: binutils; +Cc: Erik Christiansen, gcc

Hi,

> I've taken the liberty of cleaning up the L_callt_save_interrupt
> #ifdef, making it consistent with the following one for
> L_callt_save_all_interrupt. (This not only removes the .text error, but
> adopts the easier to handle layout of the latter.)

> Would you mind applying the attached patch, and rebuilding v850e-gcc, to
> check it works for you? I'd happily have a look at the elf generated
> from a small test, if you'd like to send it off-list. (Just the
> .call_table_data and .call_table_text sections would suffice.) Once
> we're happy with it, I'll put the bug report and patch into bugzilla.

great, thanks for that patch.  I've just applied it and reinstalled
the complete toolchain from scratch.

I'll send you the relevant files by private mail, if anybody else
is interested, i can also forward them.


To compile the toolchain i did:

In /rest/tmp i have:
gcc-3.3.4
binutils-2.16
newlib-1.13.0
bbin (empty)
bgcc (empty)
bnl (empty)

In bbin:
../binutils-2.16/configure \
  --target=v850e-unknown-elf \
  --prefix=/opt/v850e-unknown-elf \
  --disable-nls
make
make install

export PATH=/opt/v850e-unknown-elf/bin:$PATH

In bgcc:
../gcc-3.4.4/configure \
  --target=v850e-unknown-elf \
  --prefix=/opt/v850e-unknown-elf \
  --enable-languages="c" \
  --disable-nls
make
make install

In bnl:
../newlib-1.13.0/configure \
  --target=v850e-unknown-elf \
  --prefix=/opt/v850e-unknown-elf \
  --disable-nls
make
make install


Best regards,
Torsten.

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

* Re: --target=v850-unknown-elf, linker problem
  2005-08-15 17:53   ` --target=v850-unknown-elf, linker problem Torsten Mohr
  2005-08-16  3:04     ` Erik Christiansen
@ 2005-08-17 19:41     ` James E Wilson
  1 sibling, 0 replies; 6+ messages in thread
From: James E Wilson @ 2005-08-17 19:41 UTC (permalink / raw)
  To: Torsten Mohr; +Cc: Erik Christiansen, gcc

Torsten Mohr wrote:
> I wonder now how to proceed, do i need to report this stuff officially
> somewhere?  I also got no answer to my mail from saturday morning,
> subject line "-mwarn-signed-overflow".  I had to do that change to
> make gcc-3.4.4 compile.

gcc bugs can be reported into our bugzilla database.  See
    http://gcc.gnu.org/bugs.html

We are volunteers, and can't always answer every question immediately.
You should not expect mail set on Saturday to be answered before Monday
morning.  Generally, you should allow a week before assuming a message
was missed.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com

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

* Re: --target=v850-unknown-elf, linker problem
  2005-08-16  3:04     ` Erik Christiansen
  2005-08-16 20:48       ` Torsten Mohr
@ 2005-08-17 19:53       ` James E Wilson
  2005-08-18  5:41         ` Erik Christiansen
  1 sibling, 1 reply; 6+ messages in thread
From: James E Wilson @ 2005-08-17 19:53 UTC (permalink / raw)
  To: Erik Christiansen; +Cc: gcc, tmohr

Erik Christiansen wrote:
> I've taken the liberty of cleaning up the L_callt_save_interrupt
> #ifdef, making it consistent with the following one for
> L_callt_save_all_interrupt. (This not only removes the .text error, but
> adopts the easier to handle layout of the latter.)

Patches should be sent to gcc-patches.  In general, we would need a gcc
copyright assignment, but this is simple enough that we don't need one
for this patch.

Alternatively, patches can be put into bugzilla bug reports.  This will
help make sure it won't get forgotten.

In this case, since you've already sent the patch, and it looks good,
I'll try to take care of this for you.   I'm doing a v850 build now to
verify it and then I plan to add it to gcc mainline so this will be
fixed for the next gcc release, gcc-4.1.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com

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

* Re: --target=v850-unknown-elf, linker problem
  2005-08-17 19:53       ` James E Wilson
@ 2005-08-18  5:41         ` Erik Christiansen
  0 siblings, 0 replies; 6+ messages in thread
From: Erik Christiansen @ 2005-08-18  5:41 UTC (permalink / raw)
  To: James E Wilson; +Cc: gcc, tmohr

On Wed, Aug 17, 2005 at 12:53:14PM -0700, James E Wilson wrote:
> Alternatively, patches can be put into bugzilla bug reports.  This will
> help make sure it won't get forgotten.

That's where we were headed, as mentioned at the end of a paragraph in
the email with the patch: "Once we're happy with it, I'll put the bug
report and patch into bugzilla." (I shoulda made it a separate para. :-)

> In this case, since you've already sent the patch, and it looks good,
> I'll try to take care of this for you.

It'll only take me a moment, and "try" fits poorly with "make sure it
won't get forgotten". ;-) (Sorry, the years with quality system
responsibilities are showing through.)

> I'm doing a v850 build now to verify it and then I plan to add it to
> gcc mainline so this will be fixed for the next gcc release, gcc-4.1.

If you haven't put it in bugzilla yet, I can free you up for the more
important next gcc release.

Regards,
Erik

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

end of thread, other threads:[~2005-08-18  5:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200508142255.40310.tmohr@s.netic.de>
     [not found] ` <20050815080806.GA1026@dd.nec.com.au>
2005-08-15 17:53   ` --target=v850-unknown-elf, linker problem Torsten Mohr
2005-08-16  3:04     ` Erik Christiansen
2005-08-16 20:48       ` Torsten Mohr
2005-08-17 19:53       ` James E Wilson
2005-08-18  5:41         ` Erik Christiansen
2005-08-17 19:41     ` James E Wilson

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