已解决 //求助:skyeye无法正确load elf文件
$ ./skyeye.exe -e ./test_file/code_road.elf -c skyeye.confYour elf file is little endian.
arch: arm
cpu info: armv4, arm920t, 41009200, ff00fff0, 2
mach info: name s3c2410x, mach_init addr 0x423d50
ethmod num=1, mac addr=12:14:16:18:1a:1c, hostip=166.16.6.1
: Found TAP device named '本地连接 4'
uart_mod:1, desc_in:/dev/stdin, desc_out:/dev/stdout, converter:
nandflash: dump ./nand.dump
file size:69206016
SKYEYE: use arm920t mmu ops
exec file "./test_file/code_road.elf"'s format is elf32-little.
not load section .debug_loc: addr = 0x00000000size = 0x0000374a .
call ARMul_InitSymTable,kernel filename is ./test_file/code_road.elf.
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 4094, mem_read_word addr
= 4000 no bank
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 4094, mem_read_word addr
= 4004 no bank
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 4094, mem_read_word addr
= 4008 no bank
SKYEYE:Error in mem_read_word, no bank found, NumInstrs 4094, mem_read_word addr
= 400c no bank
winarm编译生成code_road.elf,模拟环境是 cygwin + skyeye1.2.6, 在pc上运行正常。
今晚在另一台pc上安装skyeye,却运行出错,从错误信息看是skyeye没有找到属性为SEC_LOAD的section。
为什么会这样,是编译出了问题吗?
[ 本帖最后由 wt133664 于 2009-8-4 07:03 编辑 ]
objdump的打印
objdump的打印:Administrator@B16AA68D32FB4A3 ~/skyeye-1.2.6_rc1/test_file
$ objdump ./code_road.elf -h
./code_road.elf: file format elf32-little
Sections:
Idx Name Size VMA LMA File offAlgn
0 .init 000000983000000030000000000080002**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .text 00021b443000009830000098000080982**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .fini 0000001c30021bdc30021bdc00029bdc2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
3 .rodata 0000206430021bf830021bf800029bf82**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .eh_frame 0000000430023c5c30023c5c0002bc5c2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .ctors 0000000830023d6030023d600002bd602**2
CONTENTS, ALLOC, LOAD, DATA
6 .dtors 0000000830023d6830023d680002bd682**2
CONTENTS, ALLOC, LOAD, DATA
7 .jcr 0000000430023d7030023d700002bd702**2
CONTENTS, ALLOC, LOAD, DATA
8 .data 000008c430023d7430023d740002bd742**2
CONTENTS, ALLOC, LOAD, DATA
9 .bss 001017f830024638300246380002c6382**2
ALLOC
10 .comment 0000071100000000000000000002c6382**0
CONTENTS, READONLY
11 .debug_aranges 000003b000000000000000000002cd502**3
CONTENTS, READONLY, DEBUGGING
12 .debug_pubnames 00000de200000000000000000002d1002**0
CONTENTS, READONLY, DEBUGGING
13 .debug_info 00018f1f00000000000000000002dee22**0
CONTENTS, READONLY, DEBUGGING
14 .debug_abbrev 00001b68000000000000000000046e012**0
CONTENTS, READONLY, DEBUGGING
15 .debug_line 00002a120000000000000000000489692**0
CONTENTS, READONLY, DEBUGGING
16 .debug_frame00002bd000000000000000000004b37c2**2
CONTENTS, READONLY, DEBUGGING
17 .debug_str 0000083f00000000000000000004df4c2**0
CONTENTS, READONLY, DEBUGGING
18 .debug_loc 0000374a00000000000000000004e78b2**0
CONTENTS, READONLY, DEBUGGING
./configure
Administrator@B16AA68D32FB4A3 ~/skyeye-1.2.6_rc1$ ./configure
checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking target system type... i686-pc-cygwin
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking for C++ compiler default output file name... a.exe
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gawk... (cached) gawk
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking whether make sets $(MAKE)... (cached) yes
checking how to run the C preprocessor... gcc -E
checking for ranlib... ranlib
checking for gcc... done
checking for main in -lc... yes
checking for main in -liberty... yes
checking for main in -lintl... yes
checking for main in -lm... yes
checking for main in -ln... no
checking for bfd_openr in -lbfd... yes
checking for socket in -lsocket... no
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for inttypes.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking for unistd.h... (cached) yes
checking bfd.h usability... yes
checking bfd.h presence... yes
checking for bfd.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for int8_t... yes
checking for off_t... yes
checking for size_t... yes
checking for ssize_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for uid_t in sys/types.h... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for working volatile... yes
checking for error_at_line... no
checking whether gcc needs -traditional... no
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for working memcmp... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... no
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for sys/socket.h... (cached) yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking return type of signal handlers... void
checking for vprintf... yes
checking for _doprnt... no
checking for atexit... yes
checking for bzero... yes
checking for getpagesize... (cached) yes
checking for gettimeofday... yes
checking for memmove... yes
checking for memset... yes
checking for munmap... yes
checking for select... yes
checking for setlocale... yes
checking for socket... yes
checking for sqrt... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strspn... yes
checking for strtol... yes
checking for strtoul... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating arch/arm/Makefile
config.status: creating arch/bfin/Makefile
config.status: creating arch/coldfire/Makefile
config.status: creating arch/mips/Makefile
config.status: creating arch/ppc/Makefile
config.status: creating device/Makefile
config.status: creating utils/Makefile
config.status: creating config.h
config.status: executing depfiles commands
make
make的打印太大,超过了限制,只能放在附件里。这个问题,在网上找不到类似的例子,只能到这里求助,请大家不吝赐教!
[ 本帖最后由 wt133664 于 2009-8-1 09:26 编辑 ]
刚试过make NO_BFD=1
cygwin中的gcc版本为3.4.4。以为是bfd库与winarm产生的elf存在兼容问题,使用make NO_BFD=1编译,结果如前。
已证实确实是bfd lib与winarm产生的elf存在兼容问题
在utils\main\skyeye.c中,有两个tea_load_exec(),前面一个不使用bfd lib来load elf,而后面用bfd lib来load elf。通过在这两个函数中增加打印,发现make NO_BFD=1没有起作用,skyeye始终用bfd lib来load elf。
在config.h中手工将define HAVE_BFD_H 1与#define HAVE_LIBBFD 1注释掉,再编译,则问题解决。
很奇怪
为什么用winarm编译出来的同一个elf文件,在以前的skyeye-1.2.6中运行正常,而在新安装的skyeye-1.2.6中存在bfd lib无法正确加载的问题呢?
页:
[1]