QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1979|回复: 6

已解决 //求助:skyeye无法正确load elf文件

[复制链接]
发表于 2009-8-1 09:13:55 | 显示全部楼层 |阅读模式
$ ./skyeye.exe -e ./test_file/code_road.elf -c skyeye.conf
Your 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
[TAP-WIN32]: 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 = 0x00000000  size = 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 编辑 ]
 楼主| 发表于 2009-8-1 09:14:39 | 显示全部楼层

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 off  Algn
  0 .init         00000098  30000000  30000000  00008000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .text         00021b44  30000098  30000098  00008098  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  2 .fini         0000001c  30021bdc  30021bdc  00029bdc  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  3 .rodata       00002064  30021bf8  30021bf8  00029bf8  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .eh_frame     00000004  30023c5c  30023c5c  0002bc5c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .ctors        00000008  30023d60  30023d60  0002bd60  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  6 .dtors        00000008  30023d68  30023d68  0002bd68  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  7 .jcr          00000004  30023d70  30023d70  0002bd70  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  8 .data         000008c4  30023d74  30023d74  0002bd74  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  9 .bss          001017f8  30024638  30024638  0002c638  2**2
                  ALLOC
10 .comment      00000711  00000000  00000000  0002c638  2**0
                  CONTENTS, READONLY
11 .debug_aranges 000003b0  00000000  00000000  0002cd50  2**3
                  CONTENTS, READONLY, DEBUGGING
12 .debug_pubnames 00000de2  00000000  00000000  0002d100  2**0
                  CONTENTS, READONLY, DEBUGGING
13 .debug_info   00018f1f  00000000  00000000  0002dee2  2**0
                  CONTENTS, READONLY, DEBUGGING
14 .debug_abbrev 00001b68  00000000  00000000  00046e01  2**0
                  CONTENTS, READONLY, DEBUGGING
15 .debug_line   00002a12  00000000  00000000  00048969  2**0
                  CONTENTS, READONLY, DEBUGGING
16 .debug_frame  00002bd0  00000000  00000000  0004b37c  2**2
                  CONTENTS, READONLY, DEBUGGING
17 .debug_str    0000083f  00000000  00000000  0004df4c  2**0
                  CONTENTS, READONLY, DEBUGGING
18 .debug_loc    0000374a  00000000  00000000  0004e78b  2**0
                  CONTENTS, READONLY, DEBUGGING
回复

使用道具 举报

 楼主| 发表于 2009-8-1 09:16:45 | 显示全部楼层

./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
回复

使用道具 举报

 楼主| 发表于 2009-8-1 09:23:34 | 显示全部楼层

make

make的打印太大,超过了限制,只能放在附件里。

这个问题,在网上找不到类似的例子,只能到这里求助,请大家不吝赐教!

[ 本帖最后由 wt133664 于 2009-8-1 09:26 编辑 ]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
回复

使用道具 举报

 楼主| 发表于 2009-8-1 10:05:27 | 显示全部楼层

刚试过make NO_BFD=1

cygwin中的gcc版本为3.4.4。

以为是bfd库与winarm产生的elf存在兼容问题,使用make NO_BFD=1编译,结果如前。
回复

使用道具 举报

 楼主| 发表于 2009-8-1 13:17:03 | 显示全部楼层

已证实确实是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注释掉,再编译,则问题解决。
回复

使用道具 举报

 楼主| 发表于 2009-8-1 13:27:37 | 显示全部楼层

很奇怪

为什么用winarm编译出来的同一个elf文件,在以前的skyeye-1.2.6中运行正常,而在新安装的skyeye-1.2.6中存在bfd lib无法正确加载的问题呢?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-26 23:53 , Processed in 0.122098 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表