* [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
* Re: [parisc-linux] crti.S Nested procedures error
2000-05-01 18:41 Grant Grundler
@ 2000-05-03 14:18 ` Sam Creasey
2000-05-03 15:53 ` willy
2000-05-10 20:03 ` Paul Bame
1 sibling, 1 reply; 10+ messages in thread
From: Sam Creasey @ 2000-05-03 14:18 UTC (permalink / raw)
To: Grant Grundler; +Cc: parisc-linux
On Mon, 1 May 2000, Grant Grundler wrote:
> 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
ok, for a while I was dealing with this by simply hacking up initfini.s by
hand, but that wasn't necessary last time I built. I think this is
related to the fact that somebody had taken out .proc/.procend from the
assembler entirely (well, ignored them on ELF targets). I think this was
a bad idea (if I remember tc-hppa.c from gas, it depends on these to build
some of the global symbol information? It did something even on an elf
target).
We might need our own magic sed script for parisc.
Lemme think about this properly, I just woke up and am expected at work.
-- Sam
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [parisc-linux] crti.S Nested procedures error
2000-05-03 14:18 ` Sam Creasey
@ 2000-05-03 15:53 ` willy
2000-05-04 0:28 ` Alan Modra
0 siblings, 1 reply; 10+ messages in thread
From: willy @ 2000-05-03 15:53 UTC (permalink / raw)
To: Sam Creasey; +Cc: Grant Grundler, parisc-linux
On Wed, May 03, 2000 at 10:18:54AM -0400, Sam Creasey wrote:
> ok, for a while I was dealing with this by simply hacking up initfini.s by
> hand, but that wasn't necessary last time I built. I think this is
> related to the fact that somebody had taken out .proc/.procend from the
> assembler entirely (well, ignored them on ELF targets). I think this was
> a bad idea (if I remember tc-hppa.c from gas, it depends on these to build
> some of the global symbol information? It did something even on an elf
> target).
it was a bad idea, it broke other things. i suspect the right thing
to do is move some of the global symbol information-building code
which is currently invoked upon seeing a .proc or .procend to simply
seeing a non-local label, like the other assemblers do. i don't see why
linux/elf/pa-risc needs anything special in this regard. Alan (Modra),
do you have any comments?
> We might need our own magic sed script for parisc.
i'd prefer not to..
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [parisc-linux] crti.S Nested procedures error
2000-05-03 15:53 ` willy
@ 2000-05-04 0:28 ` Alan Modra
0 siblings, 0 replies; 10+ messages in thread
From: Alan Modra @ 2000-05-04 0:28 UTC (permalink / raw)
To: willy; +Cc: Sam Creasey, Grant Grundler, parisc-linux
On Wed, 3 May 2000 willy@thepuffingroup.com wrote:
> On Wed, May 03, 2000 at 10:18:54AM -0400, Sam Creasey wrote:
> > ok, for a while I was dealing with this by simply hacking up initfini.s by
> > hand, but that wasn't necessary last time I built. I think this is
> > related to the fact that somebody had taken out .proc/.procend from the
> > assembler entirely (well, ignored them on ELF targets). I think this was
> > a bad idea (if I remember tc-hppa.c from gas, it depends on these to build
> > some of the global symbol information? It did something even on an elf
> > target).
>
> it was a bad idea, it broke other things. i suspect the right thing
> to do is move some of the global symbol information-building code
> which is currently invoked upon seeing a .proc or .procend to simply
> seeing a non-local label, like the other assemblers do. i don't see why
> linux/elf/pa-risc needs anything special in this regard. Alan (Modra),
> do you have any comments?
Well, I'm still coming up to speed on the parisc architecture, so maybe my
comments aren't that valuable. There are quite a lot of things I don't
like about the current set of puffin parisc patches though, and zapping
these pseudo ops is one of them.
On another issue, can someone tell me why the assembler comment character
needed to be changed from `;' to `!' ? This seems a really ill-advised
change to me.
--
Linuxcare. Support for the Revolution.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [parisc-linux] crti.S Nested procedures error
[not found] <200005040040.RAA14682@milano.cup.hp.com>
@ 2000-05-04 0:49 ` Alan Modra
2000-05-04 0:54 ` Jeffrey A Law
0 siblings, 1 reply; 10+ messages in thread
From: Alan Modra @ 2000-05-04 0:49 UTC (permalink / raw)
To: Grant Grundler; +Cc: parisc-linux
On Wed, 3 May 2000, Grant Grundler wrote:
> Alan Modra wrote:
>
> > On another issue, can someone tell me why the assembler comment character
> > needed to be changed from `;' to `!' ? This seems a really ill-advised
> > change to me.
>
> See:
> http://puffin.external.hp.com/mailing-lists/parisc-linux/2000/03-Mar/0078.html
Thanks for the pointer. I agree with all these except the comment
change... :)
--
Linuxcare. Support for the Revolution.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [parisc-linux] crti.S Nested procedures error
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
0 siblings, 1 reply; 10+ messages in thread
From: Jeffrey A Law @ 2000-05-04 0:54 UTC (permalink / raw)
To: Alan Modra; +Cc: Grant Grundler, parisc-linux
In message <Pine.LNX.4.21.0005041047580.8334-100000@front.linuxcare.com.au>yo
u write:
> On Wed, 3 May 2000, Grant Grundler wrote:
>
> > Alan Modra wrote:
> >
> > > On another issue, can someone tell me why the assembler comment charact
> er
> > > needed to be changed from `;' to `!' ? This seems a really ill-advised
> > > change to me.
> >
> > See:
> > http://puffin.external.hp.com/mailing-lists/parisc-linux/2000/03-Mar/0078
> .html
>
> Thanks for the pointer. I agree with all these except the comment
> change... :)
'!' is the standard comment character for the PA assembly syntax.
jeff
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [parisc-linux] crti.S Nested procedures error
2000-05-04 0:54 ` Jeffrey A Law
@ 2000-05-04 1:27 ` Alan Modra
2000-05-04 4:45 ` Jeffrey A Law
0 siblings, 1 reply; 10+ messages in thread
From: Alan Modra @ 2000-05-04 1:27 UTC (permalink / raw)
To: Jeffrey A Law; +Cc: Grant Grundler, parisc-linux
On Wed, 3 May 2000, Jeffrey A Law wrote:
> '!' is the standard comment character for the PA assembly syntax.
sourceware.cygnus.com CVS gas/config/tc-hppa.c has
const char comment_chars[] = ";";
const char line_separator_chars[] = "!";
You're saying that it's a good idea to change the comment char then?
Regards, Alan Modra
--
Linuxcare. Support for the Revolution.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [parisc-linux] crti.S Nested procedures error
2000-05-04 1:27 ` Alan Modra
@ 2000-05-04 4:45 ` Jeffrey A Law
0 siblings, 0 replies; 10+ messages in thread
From: Jeffrey A Law @ 2000-05-04 4:45 UTC (permalink / raw)
To: Alan Modra; +Cc: Grant Grundler, parisc-linux
In message <Pine.LNX.4.21.0005041123510.8334-100000@front.linuxcare.com.au>yo
u write:
> On Wed, 3 May 2000, Jeffrey A Law wrote:
>
> > '!' is the standard comment character for the PA assembly syntax.
>
> sourceware.cygnus.com CVS gas/config/tc-hppa.c has
>
> const char comment_chars[] = ";";
> const char line_separator_chars[] = "!";
>
> You're saying that it's a good idea to change the comment char then?
Whoops. My bad. "!" is the line separator, not the comment character.
Sometimes I wonder if I'm going senile.
jeff
ps. One can certainly argue about whether or not "!" is a good line
separator since it's also used in expression parsing and as a completer
for FP comparisons. Basically we've got an ambiguous grammar due to some
poor choices that were made long ago ;(
jeff
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [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
1 sibling, 0 replies; 10+ messages in thread
From: Paul Bame @ 2000-05-10 20:03 UTC (permalink / raw)
To: Grant Grundler; +Cc: parisc-linux
= "make" died with the following error:
=
= /linux/grundler/glibc/hppa1.1-linux/csu/crti.S: Assembler messages:
= /linux/grundler/glibc/hppa1.1-linux/csu/crti.S:42: Fatal error: Nested proced
ures
=
= Sure enough, two .PROC's have no .PROCEND in between.
I think I've figured this out, and it'll take a glibc expert to do
the *right* thing vis-a-vis the complex glibc structure.
Let's ignore the .fini section and just deal with .init. This is the
section where code which needs to execute prior to main() is placed. It
is in effect a normal assembly-language procedure whose contents are
created at link-time. The procedure looks like this (somewhat simplified):
.globl _init
.EXPORT _init,ENTRY
.type _init,@function
_init:
.PROC
.CALLINFO FRAME=64,CALLS,SAVE_RP,ENTRY_GR=3
.ENTRY
a few assembly statements
/***** pre-main() code to be inserted here *******/
a few more assembly statements
.EXIT
.PROCEND
glibc wants to place the first part (up to the comment) into crti.S, and
the second part into crtn.S, then at link time something like this happens:
ld -o a.out crti.o users's-object-files crtn.o
Inside the user's object files, if they need something called before main(),
like a C++ static constructor, you might find code like this:
.section .init
bl,n my-static-constructor,%r2
Thus the _init procedure is created is link time, but that's not the problem.
The problem is that the neither the first scrap of code nor the second
will assemble, because there's a .PROC without .PROCEND and .ENTRY
without .EXIT. .ENTRY and .EXIT both produce code, .ENTRY depends on
.CALLINFO which depends a tad upon .PROC.
If we hand-code the .ENTRY and .EXIT sequences, we can nuke all the
troublesome assembler directives and fix this... simple!...
except for the way this code got generated in the first place.
It's generated in glibc/csu by 'gcc -S initfini.c' and then
hacking the generated assembly, which contains the .PROC,.ENTRY,etc...
So one thing we could do is hack gcc to produce its own entry/exit
assembly code generation. Another thing we could do is make the
assembler very forgiving. Perhaps the best thing we could do is find a way
to insert PA-specific handwritten assembly for these two files
into the glibc build. I can't figure out how to do this without
making glibc specific only to PA. Help!
-Paul Bame
^ permalink raw reply [flat|nested] 10+ messages in thread
* 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
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.