我正在尝试通过使用自定义(较新版本)动态链接器/加载器和库而不是默认安装的库在嵌入式目标上运行应用程序。但是当我尝试运行一个简单的 hello world 应用程序时,我得到了段错误
root@target:~# LD_DEBUG=all /home/root/libs/ld-2.12.1.so --library-path /home/root/libs/ ~/hello
2044: calling init: /home/root/libs/libc.so.6
2044:
Segmentation fault
root@target:~# gdb /home/root/libs/ld-2.12.1.so
GNU gdb (GDB) 7.8.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/root/libs/ld-2.12.1.so...done.
(gdb) run --library-path /home/root/libs/ ~/hello
Starting program: /home/root/libs/ld-2.12.1.so --library-path /home/root/libs/ ~/hello
Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x2a00f0ec in call_init (env=<optimized out>, argv=<optimized out>, argc=<optimized out>, l=<optimized out>) at dl-init.c:85
#2 call_init (l=<optimized out>, argc=1, argv=0xbe988d04, env=0xbe988d0c) at dl-init.c:35
#3 0x2a00f1d4 in _dl_init (main_map=0x2a02d970, argc=1, argv=0xbe988d04, env=0xbe988d0c) at dl-init.c:134
#4 0x2a0007c4 in _dl_start_user () from /home/root/libs/ld-2.12.1.so
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
任何线索我做错了什么?