970917 eh problems - bootstrap failure
Robert Lipe
robertl@dgii.com
Thu Sep 18 00:05:00 GMT 1997
> >> If the SCO assembler can't handle forward refs, it's not going to work real
> I don't think so. I assumed all modern assemblers could handle it. But
Hmmm. The SCO ELF assembler can handle the forward refs. See end
for test case.
> > a funky build procedure) so that is an option. I imagine that
> > Unixware will have this same problem.
>
> I doubt it. Have you tried it with the ELF assembler?
I have now. You'd win that bet. The OpenServer ELF assembler is very
much like the UW one, since it wsa licensed from the USL group but the
COFF one is just from another planet. [ See also: Unixware never
generated COFF. ]
> > We could weenie out and just #undef the DWARF2_STACK stuff if not
> > configured --with-gas.
>
> That's what I did for SunOS 4, where the Sun assembler doesn't allow
> unaligned data.
Or we could support only ELF.
Do you feel that requiring GAS is acceptable for a popular target? I'd
have a tough time swallowing it, but it's also tough to have to work around
such lame assemblers.
> Actually, there is one crucial test that is #if. That's the one that
> decides the default EH mechanism. If you #define it to 0, you get
> setjmp/longjmp.
Gotcha. I reset it and had other problems, but a make clean with it
set to 0 it does get further into the stage 1.
./xgcc -B./ -DIN_GCC -g -I./include -I. -I../../egcs-970917/gcc -I../../egc
s-970917/gcc/config -mcoff -fno-omit-frame-pointer \
-DCRT_BEGIN -finhibit-size-directive -fno-inline-functions \
-g0 -c ../../egcs-970917/gcc/crtstuff.c
Assembler: crtstuff.c
aline 80 : invalid section attribute
aline 80 : Section name too long
Here, it's choking on the "eh_frame" being too long.
I've attached a yucky patch for sco5.h that intercepts the EH_FRAME
stuff and renames it when we're targeting OpenServer COFF. This at
least gets us into stage1. A full bootstrap is in progress. If you
like the idea of making this my problem, we'll add a --with-gas option
and just turn off your EH unwinder for the native assembler.
Or should we just shorten the name?
.file "a.c"
.text
.globl main
.align 4
main:
jmp .L4-.L3
.L3:
leave
ret
.align 4
.L4:
pushl %ebp
movl %esp,%ebp
jmp .L3
.section abcdef,"x"
.section abcdefg,"x"
.section abcdefgh,"x"
.section abcdefghi,"x"
$ as -belf a.s
(robertl) rjlhome:/play/negcs/gcc
$ as -bcoff a.s
Assembler: a.c
aline 6 : Illegal subtraction
aline 18 : Section name too long
Damn, damn, damn.
Anyway, here's the patch to shorten up the anme.
*** sco5.h_ Thu Sep 18 01:17:03 1997
--- sco5.h Thu Sep 18 02:01:26 1997
***************
*** 76,81 ****
--- 76,87 ----
#undef GLOBAL_ASM_OP
#define GLOBAL_ASM_OP "\t.globl"
+ #undef EH_FRAME_SECTION_ASM_OP
+ #define EH_FRAME_SECTION_ASM_OP_COFF "\t.section\t.ehfram, \"x\""
+ #define EH_FRAME_SECTION_ASM_OP_ELF "\t.section\t.eh_frame"
+ #define EH_FRAME_SECTION_ASM_OP \
+ ((TARGET_ELF) ? EH_FRAME_SECTION_ASM_OP_ELF : EH_FRAME_SECTION_ASM_OP_COFF)
+
#undef CONST_SECTION_ASM_OP
#define CONST_SECTION_ASM_OP_COFF "\t.section\t.rodata, \"x\""
#define CONST_SECTION_ASM_OP_ELF "\t.section\t.rodata"
***************
*** 563,569 ****
((TARGET_ELF) ? DWARF_DEBUG: SDB_DEBUG)
#undef EXTRA_SECTIONS
! #define EXTRA_SECTIONS in_const, in_init, in_fini, in_ctors, in_dtors
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
--- 569,575 ----
((TARGET_ELF) ? DWARF_DEBUG: SDB_DEBUG)
#undef EXTRA_SECTIONS
! #define EXTRA_SECTIONS in_const, in_init, in_fini, in_ctors, in_dtors, in_eh
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
***************
*** 600,605 ****
--- 606,625 ----
} \
}
+ #if 0
+ #undef EH_FRAME_SECTION_FUNCTION
+ #define EH_FRAME_SECTION_FUNCTION \
+ void \
+ eh_frame_section () \
+ { \
+ if (in_section != in_eh) \
+ { \
+ fprintf (asm_out_file, "%s\n", EH_FRAME_SECTION_ASM_OP); \
+ in_section = in_eh; \
+ } \
+ }
+ #endif
+
#undef INIT_SECTION_FUNCTION
#define INIT_SECTION_FUNCTION \
void \
***************
*** 901,906 ****
--- 921,927 ----
# undef FINI_SECTION_ASM_OP
# undef CTORS_SECTION_ASM_OP
# undef DTORS_SECTION_ASM_OP
+ # undef EH_FRAME_SECTION_ASM_OP
# undef CTOR_LIST_BEGIN
# undef CTOR_LIST_END
# undef DO_GLOBAL_CTORS_BODY
***************
*** 912,922 ****
--- 933,945 ----
# define FINI_SECTION_ASM_OP FINI_SECTION_ASM_OP_ELF
# define DTORS_SECTION_ASM_OP DTORS_SECTION_ASM_OP_ELF
# define CTORS_SECTION_ASM_OP CTORS_SECTION_ASM_OP_ELF
+ # define EH_FRAME_SECTION_ASM_OP EH_FRAME_SECTION_ASM_OP_ELF
# else /* ! _SCO_ELF */
# define INIT_SECTION_ASM_OP INIT_SECTION_ASM_OP_COFF
# define FINI_SECTION_ASM_OP FINI_SECTION_ASM_OP_COFF
# define DTORS_SECTION_ASM_OP DTORS_SECTION_ASM_OP_COFF
# define CTORS_SECTION_ASM_OP CTORS_SECTION_ASM_OP_COFF
+ # define EH_FRAME_SECTION_ASM_OP EH_FRAME_SECTION_ASM_OP_COFF
# define CTOR_LIST_BEGIN asm (INIT_SECTION_ASM_OP); asm ("pushl $0")
# define CTOR_LIST_END CTOR_LIST_BEGIN
# define DO_GLOBAL_CTORS_BODY \
More information about the Gcc
mailing list