Bug 14066 - nopw istruction return signal 4 - Illegal instruction- on cpu VIA Nehemiah
Summary: nopw istruction return signal 4 - Illegal instruction- on cpu VIA Nehemiah
Status: RESOLVED DUPLICATE of bug 6957
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-06 19:12 UTC by Roberto Corrado
Modified: 2012-05-16 02:42 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2012-05-13 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roberto Corrado 2012-05-06 19:12:16 UTC
root@gatto:/tmp# gdb -c core /usr/bin/openssl
GNU gdb (GDB) 7.4.1
Program terminated with signal 4, Illegal instruction.
#0  0xb761d1f3 in _init () from /usr/lib/libcrypto.so.0
(gdb) disassemble
Dump of assembler code for function _init:
   0xb761d1d0 <+0>:     push   %ebx
   0xb761d1d1 <+1>:     sub    $0x8,%esp
   0xb761d1d4 <+4>:     call   0xb761d840
   0xb761d1d9 <+9>:     add    $0x12c6b7,%ebx
   0xb761d1df <+15>:    mov    -0x220(%ebx),%eax
   0xb761d1e5 <+21>:    test   %eax,%eax
   0xb761d1e7 <+23>:    je     0xb761d1ee <_init+30>
   0xb761d1e9 <+25>:    call   0xb761d4d0 <__gmon_start__@plt>
   0xb761d1ee <+30>:    call   0xb761d970
=> 0xb761d1f3 <+35>:    nopw   %cs:0x0(%eax,%eax,1)
   0xb761d1fd <+45>:    nopl   (%eax)
   0xb761d200 <+48>:    call   0xb761dc10 <OPENSSL_cpuid_setup>
   0xb761d205 <+53>:    jmp    0xb761d210 <_init+64>
   0xb761d207 <+55>:    mov    %esi,%esi
   0xb761d209 <+57>:    lea    0x0(%edi,%eiz,1),%edi
   0xb761d210 <+64>:    call   0xb76f8140
   0xb761d215 <+69>:    add    $0x8,%esp
   0xb761d218 <+72>:    pop    %ebx
   0xb761d219 <+73>:    ret
End of assembler dump.
(gdb) x/24bx 0xb759b1f3
0xb759b1f3:     0xff    0x5c    0xae    0x02    0x00    0x3c    0x66 
  0xfc
0xb759b1fb:     0xff    0x8c    0xae    0x02    0x00    0xac    0x66 
  0xfc
0xb759b203:     0xff    0xc4    0xae    0x02    0x00    0x5c    0x67 
  0xfc
(gdb)

root@gatto:/var/named/internet# cat /proc/cpuinfo
processor       : 0
vendor_id       : CentaurHauls
cpu family      : 6
model           : 9
model name      : VIA Nehemiah
stepping        : 8
cpu MHz         : 1000.377
cache size      : 64 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr cx8 mtrr pge cmov pat mmx
fxsr sse rng rng_en ace ace_en
bogomips        : 2000.75
clflush size    : 32
cache_alignment : 32
address sizes   : 32 bits physical, 32 bits virtual
power management:

CFLAG= -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN --DHAVE_DLFCN_H -Wa,--noexecstack -DL_ENDIAN -DTERMIO -O3 --fomit-frame-pointer -march=i486 -mtune=i686 -Wall --DOPENSSL_BN_ASM_PART_WORDS -DSHA1_ASM -DMD5_ASM -DRMD160_ASM --DAES_ASM
Comment 1 Andreas Jaeger 2012-05-06 19:35:33 UTC
glibc itself does not code the NOPs, this is done by binutils.

How did you configure and build glibc?
Comment 2 Roberto Corrado 2012-05-07 08:22:54 UTC
> How did you configure and build glibc?
via build scripts of my distro (slackware)
with cflags:

CFLAGS="-g -O3 -march=i486 -mtune=i686" \
../configure \
  --prefix=/usr \
  --libdir=/usr/lib \
  --enable-kernel=2.6.18 \
  --with-headers=/usr/include \
  --enable-add-ons=libidn,nptl \
  --enable-profile \
  --infodir=/usr/info \
  --mandir=/usr/man \
  --with-tls \
  --with-__thread \
  --without-cvs \
  -i486-slackware-linux


Thanks for the support! 
Roberto Corrado
Comment 3 Andreas Jaeger 2012-05-07 09:26:36 UTC
This looks to me like a issue with binutils - please talk with them about it.
Comment 4 Andreas Schwab 2012-05-07 10:14:33 UTC
Moving to binutils.
Comment 5 H.J. Lu 2012-05-13 16:35:52 UTC
Which version of binutils? What is the command line passed to
assembler?
Comment 6 Roberto Corrado 2012-05-14 19:35:59 UTC
(In reply to comment #5)
> Which version of binutils? 

root@gatto:/tmp# as -V
GNU assembler version 2.22.52.0.1 (i486-slackware-linux) using BFD version (Linux/GNU Binutils) 2.22.52.0.1.20120131

> What is the command line passed to assembler?

CC= gcc
CFLAG= -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -march=i486 -mtune=i686 -Wall
AS=$(CC) -c
ASFLAG=$(CFLAG)
PROCESSOR=.

Configuring for linux-elf
Configuring for linux-elf
    no-camellia     [default]  OPENSSL_NO_CAMELLIA (skip dir)
    no-capieng      [default]  OPENSSL_NO_CAPIENG (skip dir)
    no-cms          [default]  OPENSSL_NO_CMS (skip dir)
    no-gmp          [default]  OPENSSL_NO_GMP (skip dir)
    no-idea         [option]   OPENSSL_NO_IDEA (skip dir)
    no-jpake        [experimental] OPENSSL_NO_JPAKE (skip dir)
    no-krb5         [krb5-flavor not specified] OPENSSL_NO_KRB5
    no-mdc2         [default]  OPENSSL_NO_MDC2 (skip dir)
    no-montasm      [default]
    no-rc5          [option]   OPENSSL_NO_RC5 (skip dir)
    no-rfc3779      [default]  OPENSSL_NO_RFC3779 (skip dir)
    no-seed         [default]  OPENSSL_NO_SEED (skip dir)
    no-sse2         [option]
    no-zlib         [default]
    no-zlib-dynamic [default]
IsMK1MF=0
CC            =gcc
CFLAG         =-fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -march=i486 -mtune=i686 -Wall -DOPENSSL_BN_ASM_PART_WORDS -DSHA1_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM
EX_LIBS       =-ldl
CPUID_OBJ     =x86cpuid-elf.o
BN_ASM        =bn86-elf.o co86-elf.o
DES_ENC       =dx86-elf.o yx86-elf.o
AES_ASM_OBJ   =ax86-elf.o
BF_ENC        =bx86-elf.o
CAST_ENC      =c_enc.o
RC4_ENC       =rx86-elf.o rc4_skey.o
RC5_ENC       =r586-elf.o
MD5_OBJ_ASM   =mx86-elf.o
SHA1_OBJ_ASM  =sx86-elf.o
RMD160_OBJ_ASM=rm86-elf.o
PROCESSOR     =
RANLIB        =/usr/bin/ranlib
ARFLAGS       =
PERL          =/usr/bin/perl
THIRTY_TWO_BIT mode
DES_PTR used
DES_RISC1 used
DES_UNROLL used
BN_LLONG mode
RC4_INDEX mode
RC4_CHUNK is undefined
e_os2.h => include/openssl/e_os2.h


However compiles without errors with new version of binutils
root@gatto:/tmp# as -V
GNU assembler version 2.22.52.0.2 (i486-slackware-linux) using BFD version (Linux/GNU Binutils) 2.22.52.0.2.20120424

Thanks for the support
Roberto Corrado
Comment 7 H.J. Lu 2012-05-16 02:42:54 UTC
Dup.

*** This bug has been marked as a duplicate of bug 6957 ***