* more PIC fixes in the i386 OpenBSD startup code

git-svn-id: trunk@41683 -
This commit is contained in:
nickysn 2019-03-12 01:58:11 +00:00
parent 9c3d7df289
commit bfe148cfef

View File

@ -80,16 +80,17 @@ ___start:
pushl $47 pushl $47
pushl %ebx pushl %ebx
call _strrchr call _strrchr
movl %eax,__progname movl __progname@GOT(%edi),%ecx
movl %eax,(%ecx)
addl $16,%esp addl $16,%esp
testl %eax,%eax testl %eax,%eax
jne .L4 jne .L4
movl %ebx,__progname movl %ebx,(%ecx)
jmp .L5 jmp .L5
.p2align 4,,7 .p2align 4,,7
.L4: .L4:
incl %eax incl %eax
movl %eax,__progname movl %eax,(%ecx)
.L5: .L5:
movl __progname_storage@GOT(%edi),%edx movl __progname_storage@GOT(%edi),%edx
jmp .L12 jmp .L12
@ -97,10 +98,12 @@ ___start:
.L9: .L9:
movb (%eax),%al movb (%eax),%al
movb %al,(%edx) movb %al,(%edx)
incl __progname movl __progname@GOT(%edi),%ecx
incl (%ecx)
incl %edx incl %edx
.L12: .L12:
movl __progname,%eax movl __progname@GOT(%edi),%ecx
movl (%ecx),%eax
cmpb $0,(%eax) cmpb $0,(%eax)
je .L7 je .L7
movl __progname_storage@GOT(%edi),%ecx movl __progname_storage@GOT(%edi),%ecx