All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [parisc-linux] crti.S Nested procedures error
@ 2000-05-10 21:48 Cary Coutant
  0 siblings, 0 replies; 10+ messages in thread
From: Cary Coutant @ 2000-05-10 21:48 UTC (permalink / raw)
  To: Paul Bame, Grant Grundler; +Cc: parisc-linux

Have you tried this:

>    .globl _init
>	    .EXPORT _init,ENTRY
>	    .type    _init,@function
>    _init:
>	    .PROC
>	    .CALLINFO FRAME=64,CALLS,SAVE_RP,ENTRY_GR=3
>	    .ENTRY
>	    a few assembly statements

      .PROCEND

      .PROC
 	    .CALLINFO FRAME=64,CALLS,SAVE_RP,ENTRY_GR=3
      
>
>	    /***** pre-main() code to be inserted here *******/
>
>	    a few more assembly statements
>	    .EXIT
>	    .PROCEND

While you need to use .proc and .procend in pairs, that's not the case 
with .entry and .exit. If the assembler won't take this code, it should. 
Besides being useful for this case, it's also necessary to generate code 
like this for out-of-line pieces of procedures.

-cary

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [parisc-linux] crti.S Nested procedures error
@ 2000-05-01 18:41 Grant Grundler
  2000-05-03 14:18 ` Sam Creasey
  2000-05-10 20:03 ` Paul Bame
  0 siblings, 2 replies; 10+ messages in thread
From: Grant Grundler @ 2000-05-01 18:41 UTC (permalink / raw)
  To: parisc-linux

Sammy,

I tried the "glibc" recipe on my x86 box (running Debian potato release).
(http://puffin.external.hp.com/mailing-lists/parisc-linux/2000/04-Apr/0059.html)

"make" died with the following error:

...
hppa1.1-linux-gcc /linux/grundler/glibc/hppa1.1-linux/csu/crti.S -c  -I../include -I. -I/linux/grundler/glibc/hppa1.1-linux/csu -I.. -I../libio  -I/linux/grundler/glibc/hppa1.1-linux -I../sysdeps/hppa/elf -I../sysdeps/unix/sysv/linux/hppa -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/hppa/hppa1.1 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/ldbl-128 -I../sysdeps/hppa/fpu -I../sysdeps/hppa -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic  -nostdinc -isystem /opt/puffin/lib/gcc-lib/hppa1.1-linux/2.9-hppa-991112/include -isystem /opt/puffin/include  -include ../include/libc-symbols.h     -DHAVE_INITFINI -DASSEMBLER  -I/linux/grundler/glibc/hppa1.1-linux/csu/.  -g0  -o /linux/grundler/glibc/hppa1.1-linux/csu/crti.o

bc-symbols.h     -DHAVE_INITFINI -DASSEMBLER  -I/linux/grundler/glibc/hppa1.1-linux/csu/.  -g0  -o /linux/grundler/glibc/hppa1.1-linux/csu/crti.o
/linux/grundler/glibc/hppa1.1-linux/csu/crti.S: Assembler messages:
/linux/grundler/glibc/hppa1.1-linux/csu/crti.S:42: Fatal error: Nested procedures
make[2]: *** [/linux/grundler/glibc/hppa1.1-linux/csu/crti.o] Error 1
make[2]: Leaving directory `/linux/grundler/glibc/csu'
make[1]: *** [csu/subdir_lib] Error 2


Sure enough, two .PROC's have no .PROCEND in between.
glibc/csu/Makefile builds crti.S with:

$(objpfx)crti.S: $(objpfx)initfini.s
        sed -n -e '1,/@HEADER_ENDS/p' \
               -e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \
               -e '/@TRAILER_BEGINS/,$$p' $< > $@ 


It seems either the initfini.s contents are wrong or the "sed" hack
above is removing too much.  Which is it?
Or should there only be one .PROC?

We get two .PROC's because initfini.s has both @_init_PROLOG_BEGINS/ENDS
and @_fini_PROLOG_BEGINS/ENDS. 

Appended "diff -u initfini.s crti.S" shows what sed is doing.

thanks,
grant


grundler <576>diff -u initfini.s crti.S
--- initfini.s  Mon May  1 11:09:43 2000
+++ crti.S      Mon May  1 11:20:48 2000
@@ -6,38 +6,6 @@
 #include "defs.h"
 
 /*@HEADER_ENDS*/
-
-/*@TESTS_BEGIN*/
-#NO_APP
-       .text
-       .align 4
-.globl dummy
-       .EXPORT dummy,ENTRY
-       .type    dummy,@function
-dummy:
-dummy:
-       .PROC
-       .CALLINFO FRAME=64,CALLS,SAVE_RP,ENTRY_GR=3
-       .ENTRY
-       stw %r2,-20(%r30)
-       ldo 64(%r30),%r30
-       stw %r19,-32(%r30)
-       stw %r4,-64(%r30)
-       movb,= %r26,%r22,.L16
-       copy %r19,%r4
-       .CALL   ARGW0=GR
-       bl $$dyncall,%r31
-       copy %r31,%r2
-.L16:
-       ldw -84(%r30),%r2
-       bv %r0(%r2)
-       ldwm -64(%r30),%r4
-       .EXIT
-       .PROCEND
-#APP
-
-/*@TESTS_END*/
-
 /*@_init_PROLOG_BEGINS*/
        .section .init
 #NO_APP
@@ -62,35 +30,6 @@
        END_INIT
 
 /*@_init_PROLOG_ENDS*/
-
-/*@_init_EPILOG_BEGINS*/
-       .section .init
-#NO_APP
-       ldw -84(%r30),%r2
-       bv %r0(%r2)
-       ldwm -64(%r30),%r4
-       .EXIT
-       .PROCEND
-#APP
-       END_INIT
-       .section .text
-#NO_APP
-       .align 4
-       .weak   __gmon_start__
-       .EXPORT __gmon_start__,ENTRY
-       .type    __gmon_start__,@function
-__gmon_start__:
-__gmon_start__:
-       .PROC
-       .CALLINFO FRAME=0,NO_CALLS
-       .ENTRY
-       bv,n %r0(%r2)
-       .EXIT
-       .PROCEND
-#APP
-
-/*@_init_EPILOG_ENDS*/
-
 /*@_fini_PROLOG_BEGINS*/
        .section .fini
 #NO_APP
@@ -113,24 +52,5 @@
        END_FINI
 
 /*@_fini_PROLOG_ENDS*/
-#NO_APP
-       .CALL 
-       bl i_am_not_a_leaf,%r2
-       nop
-#APP
-
-/*@_fini_EPILOG_BEGINS*/
-       .section .fini
-#NO_APP
-       ldw -84(%r30),%r2
-       bv %r0(%r2)
-       ldwm -64(%r30),%r4
-       .EXIT
-       .PROCEND
-#APP
-       END_FINI
-
-/*@_fini_EPILOG_ENDS*/
-
 /*@TRAILER_BEGINS*/
        .ident  "GCC: (GNU) 2.9-hppa-991112"

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

end of thread, other threads:[~2000-05-11  3:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200005040040.RAA14682@milano.cup.hp.com>
2000-05-04  0:49 ` [parisc-linux] crti.S Nested procedures error Alan Modra
2000-05-04  0:54   ` Jeffrey A Law
2000-05-04  1:27     ` Alan Modra
2000-05-04  4:45       ` Jeffrey A Law
2000-05-10 21:48 Cary Coutant
  -- strict thread matches above, loose matches on Subject: below --
2000-05-01 18:41 Grant Grundler
2000-05-03 14:18 ` Sam Creasey
2000-05-03 15:53   ` willy
2000-05-04  0:28     ` Alan Modra
2000-05-10 20:03 ` Paul Bame

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.