Исключение с плавающей точкой при выполнении разделяемого двоичного файла, но все в порядке, запускайте статическое связывание двоичного файла - PullRequest
0 голосов
/ 23 апреля 2019

Я нахожусь в исключении с плавающей запятой (в Linux ubuntu-610 2.6.17-10-generic # 2 SMP вт 5 дек. 21:16:35 UTC 2006 x86_64 GNU / Linux) при запуске общего двоичного файла, сгенерированного из (centos 5 2.6.18-398.el5 # 1 SMP Вт 16 сентября 20:50:52 ПО ВОСТОЧНОМУ ВРЕМЕНИ 2014 x86_64 x8n6_64 x86_64 GNU / Linux)
Но статический двоичный файл в порядке.

в чем проблема, с которой я встречаюсь? Возможно ли разрешить эту ситуацию? без сборки двоичного кода в Linux ubuntu-610 2.6.17-10-generic # 2 SMP вт 5 дек 21:16:35 UTC 2006 x86_64 GNU / Linux.

  • проверка целевого ядра и арки

    root @ ubuntu-610: / tmp / test # uname -a
    Linux ubuntu-610 2.6.17-10-generic # 2 SMP вт 5 дек 21:16:35 UTC 2006 x86_64 GNU / Linux
    root @ ubuntu-610: / tmp / test # getconf -a | grep LONG_BIT
    LONG_BIT 64

  • Проверка LDD

    root @ ubuntu-610: / tmp / test # ldd upper_os
    libc.so.6 => /lib/libc.so.6 (0x00002b1bf14a5000)
    /lib64/ld-linux-x86-64.so.2 (0x00002b1bf1388000)
    root @ ubuntu-610: / tmp / test # ldd curr_os
    libc.so.6 => /lib/libc.so.6 (0x00002b6781649000)
    /lib64/ld-linux-x86-64.so.2 (0x00002b678152c000)

  • проверка файлов

    ot @ ubuntu-610: / tmp / test # file upper_os
    upper_os: исполняемый 64-битный LSB ELF, AMD x86-64, версия 1 (SYSV), для GNU / Linux 2.6.9, динамически связанный (использует общие библиотеки), для GNU / Linux 2.6.9, без зачистки
    root @ ubuntu-610: / tmp / test # file curr_os
    curr_os: исполняемый 64-разрядный LSB ELF, AMD x86-64, версия 1 (SYSV), для GNU / Linux 2.6.0, динамически связанный (использует разделяемые библиотеки), для GNU / Linux 2.6.0, без зачистки

  • Запуск

    root @ ubuntu-610: / tmp / test # ./upper_os ---> встроен в верхнюю ОС
    Исключение с плавающей точкой
    root @ ubuntu-610: / tmp / test # ./curr_os ---> встроен в текущую ОС
    живых

** статическая ссылка: без проблем

** gdb tracking


    root@ubuntu-610:/tmp/test# gdb
    GNU gdb 6.4.90-debian
    Copyright (C) 2006 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB.  Type "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    (gdb) file upper_os 
    BFD: /tmp/test/upper_os: don't know how to handle OS specific section `.gnu.hash' [0x6ffffff6]
    "/tmp/test/upper_os": not in executable format: File format not recognized
    (gdb) run 
    Starting program:  
    No executable file specified.
    Use the "file" or "exec-file" command.
    (gdb) file curr_os 
    Reading symbols from /tmp/test/curr_os...done.
    Using host libthread_db library "/lib/libthread_db.so.1".
    (gdb) run 
    Starting program: /tmp/test/curr_os 
    alive

    Program exited normally.

#include <stdio.h> 
int main()
{
  printf("alive\n"); 
  return 0; 
}
...