[uClibc]Re: [uClibc-cvs] cvs commit to uClibc/libc/sysdeps/linux/common by andersen

Erik Andersen andersen at codepoet.org
Tue Oct 29 08:39:20 UTC 2002


On Tue Oct 29, 2002 at 08:15:13AM +0100, Stefan Allius wrote:
> Hi Erik,
> 
> why you need this hack ?
> The old version works fine for me, but the new one chrashes. (The inserted 
> labels are interpreted as asm statements in the crt[in].o files)
> 
> What kind of problem do you have with the SH-Processors ?

The deal was that initfini.s was being output such that crti.S
would refer to the GOT (see .L5 and .L10 in the attached crti.S), 
but the GOT references were included into crtn.S, not crti.S.

I am using stock gcc-3.2 and binutils-2.12.1 targeting my
Dreamcast (SH4) system.  What toolchain are you using.  As 
I recall, you are also targeting SH4, right?  Any toolchain
patches you have that I should be using?

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--
-------------- next part --------------
	.file	"initfini.c"
	.text
	.little
	
/*@HEADER_ENDS*/
	.text
	.align 1
	.global	dummy
	.type	dummy, at function
dummy:
	mov.l	r14, at -r15
	tst	r4,r4
	sts.l	pr, at -r15
	bt.s	.L1
	mov	r15,r14
	jsr	@r4
	nop
.L1:
	mov	r14,r15
	lds.l	@r15+,pr
	rts	
	mov.l	@r15+,r14
.Lfe1:
	.size	dummy,.Lfe1-dummy
	
/*@_init_PROLOG_BEGINS*/
	.section .init
	.hidden  _init
	.align 1
	.global	_init
	.type	_init, at function
_init:
	mov.l	r12, at -r15
	mova	.L5,r0
	mov.l	r14, at -r15
	mov.l	.L5,r12
	sts.l	pr, at -r15
	add	r0,r12
	mov	r15,r14
	
/*@_init_PROLOG_PAUSES*/
	mov.l	.L6,r1
	bsrf	r1
.LPCS0:
	nop
	
/*@_init_PROLOG_UNPAUSES*/
	ALIGN
	END_INIT
	
/*@_init_PROLOG_ENDS*/
	
/*@_init_EPILOG_BEGINS*/
	mov	r14,r15
	lds.l	@r15+,pr
	mov.l	@r15+,r14
	rts	
	mov.l	@r15+,r12
.L7:
	.align 2
.L5:
	.long	_GLOBAL_OFFSET_TABLE_
.L6:
	.long	i_am_not_a_leaf at PLT-(.LPCS0+2-(.))
.Lfe2:
	.size	_init,.Lfe2-_init
	
/*@_init_EPILOG_ENDS*/
	
/*@_fini_PROLOG_BEGINS*/
	.section .fini
	.hidden  _fini
	.align 1
	.global	_fini
	.type	_fini, at function
_fini:
	mov.l	r12, at -r15
	mova	.L10,r0
	mov.l	r14, at -r15
	mov.l	.L10,r12
	sts.l	pr, at -r15
	add	r0,r12
	mov	r15,r14
	ALIGN
	END_FINI
	
/*@_fini_PROLOG_ENDS*/
	mov.l	.L11,r1
	bsrf	r1
.LPCS1:
	nop
	
/*@_fini_EPILOG_BEGINS*/
	mov	r14,r15
	lds.l	@r15+,pr
	mov.l	@r15+,r14
	rts	
	mov.l	@r15+,r12
.L12:
	.align 2
.L10:
	.long	_GLOBAL_OFFSET_TABLE_
.L11:
	.long	i_am_not_a_leaf2 at PLT-(.LPCS1+2-(.))
.Lfe3:
	.size	_fini,.Lfe3-_fini
	
/*@_fini_EPILOG_ENDS*/
	
/*@TRAILER_BEGINS*/
	.ident	"GCC: (GNU) 3.2"
-------------- next part --------------
	.file	"initfini.c"
	.text
	.little
	
	.section .init
	.hidden  _init
	.align 1
	.global	_init
	.type	_init, at function
_init:
	mov.l	r12, at -r15
	mova	.L5,r0
	mov.l	r14, at -r15
	mov.l	.L5,r12
	sts.l	pr, at -r15
	add	r0,r12
	mov	r15,r14
	
	.align 2
	
	
	.section .fini
	.hidden  _fini
	.align 1
	.global	_fini
	.type	_fini, at function
_fini:
	mov.l	r12, at -r15
	mova	.L10,r0
	mov.l	r14, at -r15
	mov.l	.L10,r12
	sts.l	pr, at -r15
	add	r0,r12
	mov	r15,r14
	.align 2
	
	
	.ident	"GCC: (GNU) 3.2"
-------------- next part --------------
	.file	"initfini.c"
	.text
	.little
	
	.section .init
	.hidden  _init
	.align 1
	.global	_init
	.type	_init, at function
	mov	r14,r15
	lds.l	@r15+,pr
	mov.l	@r15+,r14
	rts	
	mov.l	@r15+,r12
.L7:
	.align 2
.L5:
	.long	_GLOBAL_OFFSET_TABLE_
.L6:
.Lfe2:
	.size	_init,.Lfe2-_init
	
	.section .fini
	.hidden  _fini
	.align 1
	.global	_fini
	.type	_fini, at function
	mov	r14,r15
	lds.l	@r15+,pr
	mov.l	@r15+,r14
	rts	
	mov.l	@r15+,r12
.L12:
	.align 2
.L10:
	.long	_GLOBAL_OFFSET_TABLE_
.L11:
.Lfe3:
	.size	_fini,.Lfe3-_fini
	
	.ident	"GCC: (GNU) 3.2"


More information about the uClibc mailing list