[GCC 3.0] libjava code emits code that confuses as/ld
Marc Espie
espie@schutzenberger.liafa.jussieu.fr
Mon Jul 9 05:48:00 GMT 2001
Compiling Boolean.c in pic mode ends up with the following code:
The issue here is movl LLSDA0@GOT(%ebx), %eax.
OpenBSD as emits a warning:
Boolean.s: Assembler messages:
Boolean.s:768: Warning: GOT relocation burb: `LLSDA0' should be global
and OpenBSD ld straight out dumps core on that...
.file "Boolean.java"
.text
.align 2,0x90
.globl __ZN4java4lang7BooleanC1Eb
.type __ZN4java4lang7BooleanC1Eb , @function
__ZN4java4lang7BooleanC1Eb:
pushl %ebp
movl %esp, %ebp
pushl %edi
pushl %esi
pushl %ebx
subl $12, %esp
call L2
L2:
popl %ebx
addl $__GLOBAL_OFFSET_TABLE_+[.-L2], %ebx
movl 8(%ebp), %esi
movl 12(%ebp), %edi
subl $12, %esp
pushl %esi
call __ZN4java4lang6ObjectC2Ev@PLT
movl %edi, %eax
movb %al, 8(%esi)
leal -12(%ebp), %esp
popl %ebx
popl %esi
popl %edi
popl %ebp
ret
.size __ZN4java4lang7BooleanC1Eb , . - __ZN4java4lang7BooleanC1Eb
.align 2,0x90
.globl __ZN4java4lang7BooleanC1EPNS0_6StringE
.type __ZN4java4lang7BooleanC1EPNS0_6StringE , @function
__ZN4java4lang7BooleanC1EPNS0_6StringE:
pushl %ebp
movl %esp, %ebp
pushl %edi
pushl %esi
pushl %ebx
subl $12, %esp
call L8
L8:
popl %ebx
addl $__GLOBAL_OFFSET_TABLE_+[.-L8], %ebx
subl $12, %esp
movl 8(%ebp), %esi
movl 12(%ebp), %edi
pushl %esi
call __ZN4java4lang6ObjectC2Ev@PLT
addl $16, %esp
testl %edi, %edi
je L9
subl $8, %esp
pushl 4+__CD_java_lang_Boolean@GOTOFF(%ebx)
pushl %edi
call __ZN4java4lang6String16equalsIgnoreCaseEPS1_@PLT
addl $16, %esp
movb %al, 8(%esi)
L5:
leal -12(%ebp), %esp
popl %ebx
popl %esi
popl %edi
popl %ebp
ret
.align 2,0x90
L9:
movb $0, 8(%esi)
jmp L5
.size __ZN4java4lang7BooleanC1EPNS0_6StringE , . - __ZN4java4lang7BooleanC1EPNS0_6StringE
.align 2,0x90
.globl __ZN4java4lang7Boolean12booleanValueEv
.type __ZN4java4lang7Boolean12booleanValueEv , @function
__ZN4java4lang7Boolean12booleanValueEv:
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %eax
movzbl 8(%eax), %eax
popl %ebp
ret
.size __ZN4java4lang7Boolean12booleanValueEv , . - __ZN4java4lang7Boolean12booleanValueEv
.align 2,0x90
.globl __ZN4java4lang7Boolean6equalsEPNS0_6ObjectE
.type __ZN4java4lang7Boolean6equalsEPNS0_6ObjectE , @function
__ZN4java4lang7Boolean6equalsEPNS0_6ObjectE:
pushl %ebp
movl %esp, %ebp
pushl %ebx
pushl %eax
call L16
L16:
popl %ebx
addl $__GLOBAL_OFFSET_TABLE_+[.-L16], %ebx
movl 12(%ebp), %edx
testl %edx, %edx
je L13
movl (%edx), %eax
movl (%eax), %eax
cmpl __ZN4java4lang7Boolean6class$E@GOT(%ebx), %eax
je L17
L13:
xorl %eax, %eax
L11:
movl -4(%ebp), %ebx
leave
ret
.align 2,0x90
L17:
subl $8, %esp
pushl %edx
pushl %eax
call __Jv_CheckCast@PLT
movb 8(%eax), %cl
movl 8(%ebp), %edx
xorl %eax, %eax
addl $16, %esp
cmpb %cl, 8(%edx)
sete %al
jmp L11
.size __ZN4java4lang7Boolean6equalsEPNS0_6ObjectE , . - __ZN4java4lang7Boolean6equalsEPNS0_6ObjectE
.align 2,0x90
.globl __ZN4java4lang7Boolean8hashCodeEv
.type __ZN4java4lang7Boolean8hashCodeEv , @function
__ZN4java4lang7Boolean8hashCodeEv:
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %edx
xorl %eax, %eax
cmpb $0, 8(%edx)
sete %al
decl %eax
andl $-6, %eax
addl $1237, %eax
popl %ebp
ret
.size __ZN4java4lang7Boolean8hashCodeEv , . - __ZN4java4lang7Boolean8hashCodeEv
.align 2,0x90
.globl __ZN4java4lang7Boolean8toStringEv
.type __ZN4java4lang7Boolean8toStringEv , @function
__ZN4java4lang7Boolean8toStringEv:
pushl %ebp
movl %esp, %ebp
pushl %ebx
call L31
L31:
popl %ebx
addl $__GLOBAL_OFFSET_TABLE_+[.-L31], %ebx
movl 8(%ebp), %eax
cmpb $0, 8(%eax)
je L29
movl 4+__CD_java_lang_Boolean@GOTOFF(%ebx), %eax
L30:
movl (%esp), %ebx
leave
ret
.align 2,0x90
L29:
movl 8+__CD_java_lang_Boolean@GOTOFF(%ebx), %eax
jmp L30
.size __ZN4java4lang7Boolean8toStringEv , . - __ZN4java4lang7Boolean8toStringEv
.align 2,0x90
.globl __ZN4java4lang7Boolean10getBooleanEPNS0_6StringE
.type __ZN4java4lang7Boolean10getBooleanEPNS0_6StringE , @function
__ZN4java4lang7Boolean10getBooleanEPNS0_6StringE:
pushl %ebp
movl %esp, %ebp
pushl %edi
pushl %esi
pushl %ebx
subl $60, %esp
call L45
L45:
popl %ebx
addl $__GLOBAL_OFFSET_TABLE_+[.-L45], %ebx
movl ___gcj_personality_sj0@GOT(%ebx), %eax
movl %eax, -32(%ebp)
movl LLSDA0@GOT(%ebx), %eax
movl %eax, -28(%ebp)
leal -12(%ebp), %eax
movl %eax, -24(%ebp)
leal L43@GOTOFF(%ebx), %eax
movl %eax, -20(%ebp)
movl %esp, -16(%ebp)
leal -56(%ebp), %eax
subl $12, %esp
pushl %eax
call __Unwind_SjLj_Register@PLT
popl %ecx
pushl __ZN4java4lang7Boolean6class$E@GOT(%ebx)
movl $-1, -52(%ebp)
call __Jv_InitClass@PLT
popl %edx
pushl 8(%ebp)
movl $1, -52(%ebp)
call __ZN4java4lang6System11getPropertyEPNS0_6StringE@PLT
addl $16, %esp
xorl %edx, %edx
testl %eax, %eax
movl %eax, %ecx
je L20
subl $8, %esp
movl $1, -52(%ebp)
pushl 4+__CD_java_lang_Boolean@GOTOFF(%ebx)
pushl %ecx
call __ZN4java4lang6String16equalsIgnoreCaseEPS1_@PLT
addl $16, %esp
movb %al, %dl
L20:
movzbl %dl, %edx
movl %edx, -60(%ebp)
L18:
leal -56(%ebp), %eax
subl $12, %esp
pushl %eax
call __Unwind_SjLj_Unregister@PLT
addl $16, %esp
movl -60(%ebp), %eax
leal -12(%ebp), %esp
popl %ebx
popl %esi
popl %edi
popl %ebp
ret
.align 2,0x90
L43:
addl $12, %ebp
call L44
L44:
popl %ebx
addl $__GLOBAL_OFFSET_TABLE_+[.-L44], %ebx
#APP
#NO_APP
cmpl $1, -44(%ebp)
movl -48(%ebp), %eax
jne L46
movl $-1, -52(%ebp)
movl $0, -60(%ebp)
jmp L18
.align 2,0x90
L46:
subl $12, %esp
pushl %eax
movl $-1, -52(%ebp)
call __Unwind_SjLj_Resume@PLT
.size __ZN4java4lang7Boolean10getBooleanEPNS0_6StringE , . - __ZN4java4lang7Boolean10getBooleanEPNS0_6StringE
.data
.align 2,0x90
LLSDA0:
.byte 0xff
.byte 0x0
.byte 0xd
.byte 0x3
.byte 0x2
.byte 0x0
.byte 0x1
.byte 0x1
.byte 0x0
.align 2,0x90
.long __ZN4java4lang17SecurityException6class$E
.text
.align 2,0x90
.globl __ZN4java4lang7Boolean7valueOfEPNS0_6StringE
.type __ZN4java4lang7Boolean7valueOfEPNS0_6StringE , @function
__ZN4java4lang7Boolean7valueOfEPNS0_6StringE:
pushl %ebp
movl %esp, %ebp
pushl %esi
pushl %ebx
call L47
L47:
popl %ebx
addl $__GLOBAL_OFFSET_TABLE_+[.-L47], %ebx
subl $12, %esp
movl 8(%ebp), %esi
pushl __ZN4java4lang7Boolean6class$E@GOT(%ebx)
call __Jv_InitClass@PLT
addl $16, %esp
testl %esi, %esi
je L48
subl $8, %esp
pushl 4+__CD_java_lang_Boolean@GOTOFF(%ebx)
pushl %esi
call __ZN4java4lang6String16equalsIgnoreCaseEPS1_@PLT
addl $16, %esp
testb %al, %al
je L35
movl __ZN4java4lang7Boolean4TRUEE@GOT(%ebx), %eax
L49:
movl (%eax), %eax
leal -8(%ebp), %esp
popl %ebx
popl %esi
popl %ebp
ret
.align 2,0x90
L35:
movl __ZN4java4lang7Boolean5FALSEE@GOT(%ebx), %eax
jmp L49
.align 2,0x90
L48:
movl __ZN4java4lang7Boolean5FALSEE@GOT(%ebx), %eax
jmp L49
.size __ZN4java4lang7Boolean7valueOfEPNS0_6StringE , . - __ZN4java4lang7Boolean7valueOfEPNS0_6StringE
.align 2,0x90
.globl __ZN4java4lang7Boolean18__U3c_clinit__U3e_Ev
.type __ZN4java4lang7Boolean18__U3c_clinit__U3e_Ev , @function
__ZN4java4lang7Boolean18__U3c_clinit__U3e_Ev:
pushl %ebp
movl %esp, %ebp
pushl %edi
pushl %esi
pushl %ebx
subl $12, %esp
call L50
L50:
popl %ebx
addl $__GLOBAL_OFFSET_TABLE_+[.-L50], %ebx
movl __Jv_booleanClass@GOT(%ebx), %eax
movl %eax, -20(%ebp)
cmpb $11, 70(%eax)
setg -13(%ebp)
subl $8, %esp
movl __ZN4java4lang7Boolean6class$E@GOT(%ebx), %edi
pushl $12
pushl %edi
call __Jv_AllocObject@PLT
addl $6, %esp
movl %eax, %esi
pushw $0
pushl %esi
call __ZN4java4lang7BooleanC1Eb@PLT
movl __ZN4java4lang7Boolean5FALSEE@GOT(%ebx), %eax
movl %esi, (%eax)
popl %esi
popl %eax
pushl $12
pushl %edi
call __Jv_AllocObject@PLT
addl $6, %esp
movl %eax, %esi
pushw $1
pushl %esi
call __ZN4java4lang7BooleanC1Eb@PLT
movl __ZN4java4lang7Boolean4TRUEE@GOT(%ebx), %eax
movl %esi, (%eax)
addl $16, %esp
cmpb $0, -13(%ebp)
je L51
L41:
movl -20(%ebp), %edx
movl __ZN4java4lang7Boolean4TYPEE@GOT(%ebx), %eax
movl %edx, (%eax)
leal -12(%ebp), %esp
popl %ebx
popl %esi
popl %edi
popl %ebp
ret
.align 2,0x90
L51:
subl $12, %esp
pushl -20(%ebp)
call __Jv_InitClass@PLT
addl $16, %esp
jmp L41
.size __ZN4java4lang7Boolean18__U3c_clinit__U3e_Ev , . - __ZN4java4lang7Boolean18__U3c_clinit__U3e_Ev
.align 1,0x90
.type __Utf1 , @object
.size __Utf1 , 4
__Utf1:
.word 8451
.word 5
.ascii "FALSE"
.space 1
.globl __ZN4java4lang7Boolean5FALSEE
.data
.align 2,0x90
.type __ZN4java4lang7Boolean5FALSEE , @object
.size __ZN4java4lang7Boolean5FALSEE , 4
__ZN4java4lang7Boolean5FALSEE:
.space 4
.text
.align 1,0x90
.type __Utf2 , @object
.size __Utf2 , 4
__Utf2:
.word 28046
.word 4
.ascii "TRUE"
.space 1
.globl __ZN4java4lang7Boolean4TRUEE
.data
.align 2,0x90
.type __ZN4java4lang7Boolean4TRUEE , @object
.size __ZN4java4lang7Boolean4TRUEE , 4
__ZN4java4lang7Boolean4TRUEE:
.space 4
.text
.align 1,0x90
.type __Utf3 , @object
.size __Utf3 , 4
__Utf3:
.word 34618
.word 4
.ascii "TYPE"
.space 1
.globl __ZN4java4lang7Boolean4TYPEE
.data
.align 2,0x90
.type __ZN4java4lang7Boolean4TYPEE , @object
.size __ZN4java4lang7Boolean4TYPEE , 4
__ZN4java4lang7Boolean4TYPEE:
.space 4
.text
.align 1,0x90
.type __Utf4 , @object
.size __Utf4 , 4
__Utf4:
.word 37233
.word 5
.ascii "value"
.space 1
.align 1,0x90
.type __Utf5 , @object
.size __Utf5 , 4
__Utf5:
.word 54636
.word 16
.ascii "serialVersionUID"
.space 1
.globl __ZN4java4lang7Boolean16serialVersionUIDE
.data
.align 3,0x90
.type __ZN4java4lang7Boolean16serialVersionUIDE , @object
.size __ZN4java4lang7Boolean16serialVersionUIDE , 8
__ZN4java4lang7Boolean16serialVersionUIDE:
.long -711132434
.long -853511552
.align 5,0x90
.type __FL_java_lang_Boolean , @object
.size __FL_java_lang_Boolean , 80
__FL_java_lang_Boolean:
.long __Utf1
.long __ZN4java4lang7Boolean6class$E
.word 25
.word 4
.long __ZN4java4lang7Boolean5FALSEE
.long __Utf2
.long __ZN4java4lang7Boolean6class$E
.word 25
.word 4
.long __ZN4java4lang7Boolean4TRUEE
.long __Utf3
.long __ZN4java4lang5Class6class$E
.word 25
.word 4
.long __ZN4java4lang7Boolean4TYPEE
.long __Utf5
.long __Jv_longClass
.word 26
.word 8
.long __ZN4java4lang7Boolean16serialVersionUIDE
.long __Utf4
.long __Jv_booleanClass
.word 2
.word 1
.long 8
.text
.align 1,0x90
.type __Utf6 , @object
.size __Utf6 , 4
__Utf6:
.word 626
.word 6
.ascii "<init>"
.space 1
.align 1,0x90
.type __Utf7 , @object
.size __Utf7 , 4
__Utf7:
.word 34303
.word 4
.ascii "(Z)V"
.space 1
.align 1,0x90
.type __Utf8 , @object
.size __Utf8 , 4
__Utf8:
.word 54943
.word 21
.ascii "(Ljava.lang.String;)V"
.space 1
.align 1,0x90
.type __Utf9 , @object
.size __Utf9 , 4
__Utf9:
.word 36393
.word 12
.ascii "booleanValue"
.space 1
.align 1,0x90
.type __Utf10 , @object
.size __Utf10 , 4
__Utf10:
.word 39801
.word 3
.ascii "()Z"
.space 1
.align 1,0x90
.type __Utf11 , @object
.size __Utf11 , 4
__Utf11:
.word 32703
.word 6
.ascii "equals"
.space 1
.align 1,0x90
.type __Utf12 , @object
.size __Utf12 , 4
__Utf12:
.word 40117
.word 21
.ascii "(Ljava.lang.Object;)Z"
.space 1
.align 1,0x90
.type __Utf13 , @object
.size __Utf13 , 4
__Utf13:
.word 42994
.word 10
.ascii "getBoolean"
.space 1
.align 1,0x90
.type __Utf14 , @object
.size __Utf14 , 4
__Utf14:
.word 54947
.word 21
.ascii "(Ljava.lang.String;)Z"
.space 1
.align 1,0x90
.type __Utf15 , @object
.size __Utf15 , 4
__Utf15:
.word 44059
.word 8
.ascii "hashCode"
.space 1
.align 1,0x90
.type __Utf16 , @object
.size __Utf16 , 4
__Utf16:
.word 39784
.word 3
.ascii "()I"
.space 1
.align 1,0x90
.type __Utf17 , @object
.size __Utf17 , 4
__Utf17:
.word 21100
.word 8
.ascii "toString"
.space 1
.align 1,0x90
.type __Utf18 , @object
.size __Utf18 , 4
__Utf18:
.word 56939
.word 20
.ascii "()Ljava.lang.String;"
.space 1
.align 1,0x90
.type __Utf19 , @object
.size __Utf19 , 4
__Utf19:
.word 808
.word 7
.ascii "valueOf"
.space 1
.align 1,0x90
.type __Utf20 , @object
.size __Utf20 , 4
__Utf20:
.word 58812
.word 39
.ascii "(Ljava.lang.String;)Ljava.lang.Boolean;"
.space 1
.align 1,0x90
.type __Utf21 , @object
.size __Utf21 , 4
__Utf21:
.word 3753
.word 8
.ascii "<clinit>"
.space 1
.align 1,0x90
.type __Utf22 , @object
.size __Utf22 , 4
__Utf22:
.word 39797
.word 3
.ascii "()V"
.space 1
.data
.align 5,0x90
.type __MT_java_lang_Boolean , @object
.size __MT_java_lang_Boolean , 144
__MT_java_lang_Boolean:
.long __Utf6
.long __Utf7
.word 16385
.space 2
.long __ZN4java4lang7BooleanC1Eb
.long __Utf6
.long __Utf8
.word 16385
.space 2
.long __ZN4java4lang7BooleanC1EPNS0_6StringE
.long __Utf9
.long __Utf10
.word 16385
.space 2
.long __ZN4java4lang7Boolean12booleanValueEv
.long __Utf11
.long __Utf12
.word 16385
.space 2
.long __ZN4java4lang7Boolean6equalsEPNS0_6ObjectE
.long __Utf13
.long __Utf14
.word 16393
.space 2
.long __ZN4java4lang7Boolean10getBooleanEPNS0_6StringE
.long __Utf15
.long __Utf16
.word 16385
.space 2
.long __ZN4java4lang7Boolean8hashCodeEv
.long __Utf17
.long __Utf18
.word 16385
.space 2
.long __ZN4java4lang7Boolean8toStringEv
.long __Utf19
.long __Utf20
.word 16393
.space 2
.long __ZN4java4lang7Boolean7valueOfEPNS0_6StringE
.long __Utf21
.long __Utf22
.word 16392
.space 2
.long __ZN4java4lang7Boolean18__U3c_clinit__U3e_Ev
.globl __ZTVN4java4lang7BooleanE
.align 2,0x90
.type __ZTVN4java4lang7BooleanE , @object
.size __ZTVN4java4lang7BooleanE , 28
__ZTVN4java4lang7BooleanE:
.long __ZN4java4lang7Boolean6class$E
.long 8
.long __ZN4java4lang6Object8finalizeEv
.long __ZN4java4lang7Boolean8hashCodeEv
.long __ZN4java4lang7Boolean6equalsEPNS0_6ObjectE
.long __ZN4java4lang7Boolean8toStringEv
.long __ZN4java4lang6Object5cloneEv
.align 2,0x90
.type __IF_java_lang_Boolean , @object
.size __IF_java_lang_Boolean , 4
__IF_java_lang_Boolean:
.long __ZN4java2io12Serializable6class$E
.text
.align 1,0x90
.type __Utf23 , @object
.size __Utf23 , 4
__Utf23:
.word 6435
.word 5
.ascii "false"
.space 1
.align 1,0x90
.type __Utf24 , @object
.size __Utf24 , 4
__Utf24:
.word 30094
.word 4
.ascii "true"
.space 1
.data
.align 2,0x90
.type __CD_java_lang_Boolean , @object
.size __CD_java_lang_Boolean , 12
__CD_java_lang_Boolean:
.long 0
.long __Utf24
.long __Utf23
.type __CT_java_lang_Boolean , @object
.size __CT_java_lang_Boolean , 3
__CT_java_lang_Boolean:
.byte 0
.byte 8
.byte 8
.text
.align 1,0x90
.type __Utf25 , @object
.size __Utf25 , 4
__Utf25:
.word 24660
.word 17
.ascii "java.lang.Boolean"
.space 1
.globl __ZN4java4lang7Boolean6class$E
.data
.align 5,0x90
.type __ZN4java4lang7Boolean6class$E , @object
.size __ZN4java4lang7Boolean6class$E , 92
__ZN4java4lang7Boolean6class$E:
.long __ZTVN4java4lang5ClassE
.long 0
.long 0
.long __Utf25
.word 17
.space 2
.long __ZN4java4lang6Object6class$E
.long 3
.long __CT_java_lang_Boolean
.long __CD_java_lang_Boolean
.long __MT_java_lang_Boolean
.word 9
.word 5
.long __FL_java_lang_Boolean
.long 12
.word 5
.word 4
.long __ZTVN4java4lang7BooleanE
.long __IF_java_lang_Boolean
.long 0
.word 1
.byte 0
.space 1
.long 0
.word 0
.space 2
.long 0
.long 0
.long 0
.text
.align 2,0x90
.globl __GLOBAL__I__ZN4java4lang7BooleanC1Eb
.type __GLOBAL__I__ZN4java4lang7BooleanC1Eb , @function
__GLOBAL__I__ZN4java4lang7BooleanC1Eb:
pushl %ebp
movl %esp, %ebp
pushl %ebx
pushl %edx
call L53
L53:
popl %ebx
addl $__GLOBAL_OFFSET_TABLE_+[.-L53], %ebx
subl $12, %esp
pushl __ZN4java4lang7Boolean6class$E@GOT(%ebx)
call __Jv_RegisterClass@PLT
addl $16, %esp
movl -4(%ebp), %ebx
leave
ret
.size __GLOBAL__I__ZN4java4lang7BooleanC1Eb , . - __GLOBAL__I__ZN4java4lang7BooleanC1Eb
More information about the Gcc-bugs
mailing list