Port-i386 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Illegal instruction trap in libgcc_s.so



On Fri, Feb 06, 2015 at 06:05:32PM +0100, Jarle Greipsland wrote:
> Hi,
> 
> I was in the process of upgrading an old i486-system to a current
> NetBSD/i386 (sources from about January 12th), when bad things
> started to happen.  I had previously built a new kernel,
> installed and booted successfully.  I then started to extract the
> newly built sets, and after having extracted base.tgz, I was in a
> bad place.  All dynamically linked programs core dumped with an
> Illegal instruction trap.  After some investigations I brought
> back an old copy of libgcc_s.so, and things started to work
> again.
> 
> I have since set up a gdb sysroot with the required libraries and
> run gdb on /bin/ls with one of the many ls.core files to be
> found.  A printout of my gdb session can be found below.
> 
> A few observations:
> o The Illegal instruction is the 'cpuid' instruction, which is not
>   present on older i486 CPUs.
...
> (gdb) x/50i 0xbbbca4d3
>    0xbbbca4d3:  push   %ebp
>    0xbbbca4d4:  push   %edi
>    0xbbbca4d5:  push   %esi
>    0xbbbca4d6:  mov    %eax,%edi
>    0xbbbca4d8:  mov    %edx,%ebp
>    0xbbbca4da:  pushf  
>    0xbbbca4db:  pushf  
>    0xbbbca4dc:  pop    %eax
>    0xbbbca4dd:  mov    %eax,%edx
>    0xbbbca4df:  xor    $0x200000,%eax
>    0xbbbca4e4:  push   %eax
>    0xbbbca4e5:  popf   
>    0xbbbca4e6:  pushf  
>    0xbbbca4e7:  pop    %eax
>    0xbbbca4e8:  popf   
>    0xbbbca4e9:  xor    %edx,%eax
>    0xbbbca4eb:  and    $0x200000,%eax

The intel docs say that support of cpuid is indicated by the ability
to change the ID bit (bit 21) of the eflags register.
The above code seems to be doing that.

	David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index