QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2541|回复: 2

ppcboot编译错误

[复制链接]
发表于 2006-11-14 21:54:18 | 显示全部楼层 |阅读模式
移植2.6内核,修改linux_cmd_line:console=ttySAC0,所使用的bootloader程序为ppcboot
嵌入式CPU为arm s3c2410
进入ppcboot目录,修改了arm-lib/armlinux文件中console=ttySAC0相关内容,保存退出。配置,编译,出错:
[root@localhost ppcboot]# make clean
find . -type f \
\( -name 'core' -o -name '*.bak' -o -name '*~' \
-o -name '*.o'  -o -name '*.a'  \) -print \
| xargs rm -f
rm -f examples/hello_world examples/timer examples/eepro100_eeprom
rm -f tools/img2srec tools/mkimage tools/envcrc tools/gen_eth_addr
rm -f tools/easylogo/easylogo tools/bmp_logo
rm -f tools/gdb/astest tools/gdb/gdbcont tools/gdb/gdbsend
[root@localhost ppcboot]# make smdk2400_config
rm -f include/config.h include/config.mk
Configuring for smdk2400 board...
[root@localhost ppcboot]# make
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/tools'
ln -s ../common/environment.c environment.c
ln -s ../lib_generic/crc32.c crc32.c
gcc -M -Wall -pedantic -I../include -I.. -DTEXT_BASE=0x0CF00000 -DUSE_HOSTCC environment.c img2srec.c mkimage.c crc32.c envcrc.c gen_eth_addr.c bmp_logo.c > .depend
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/tools'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/tools'
make[1]: “.depend”是最新的。
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/tools'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/lib_generic'
/opt/host/armv4l/bin/armv4l-unknown-linux-gcc -M -g  -Os  -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -D__KERNEL__ -DTEXT_BASE=0x0CF00000 -I/HHARM9-EDU/新建文件夹/ppcboot/include -fno-builtin -pipe -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -Wall -Wstrict-prototypes crc32.c ctype.c display_options.c ldiv.c string.c vsprintf.c zlib.c > .depend
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/lib_generic'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/lib_generic'
make[1]: “.depend”是最新的。
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/lib_generic'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/lib_arm'
/opt/host/armv4l/bin/armv4l-unknown-linux-gcc -M -g  -Os  -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -D__KERNEL__ -DTEXT_BASE=0x0CF00000 -I/HHARM9-EDU/新建文件夹/ppcboot/include -fno-builtin -pipe -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -Wall -Wstrict-prototypes _udivsi3.S _umodsi3.S armlinux.c board.c cache.c div0.c > .depend
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/lib_arm'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/lib_arm'
make[1]: “.depend”是最新的。
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/lib_arm'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/cpu/arm920t'
/opt/host/armv4l/bin/armv4l-unknown-linux-gcc -M -g  -Os  -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -D__KERNEL__ -DTEXT_BASE=0x0CF00000 -I/HHARM9-EDU/新建文件夹/ppcboot/include -fno-builtin -pipe -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -Wall -Wstrict-prototypes start.S serial.c interrupts.c cpu.c speed.c > .depend
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/cpu/arm920t'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/cpu/arm920t'
make[1]: “.depend”是最新的。
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/cpu/arm920t'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/board/smdk2400'
/opt/host/armv4l/bin/armv4l-unknown-linux-gcc -M -g  -Os  -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -D__KERNEL__ -DTEXT_BASE=0x0CF00000 -I/HHARM9-EDU/新建文件夹/ppcboot/include -fno-builtin -pipe -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 memsetup.S smdk2400.c flash.c > .depend
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/board/smdk2400'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/board/smdk2400'
make[1]: “.depend”是最新的。
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/board/smdk2400'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/common'
/opt/host/armv4l/bin/armv4l-unknown-linux-gcc -M -g  -Os  -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -D__KERNEL__ -DTEXT_BASE=0x0CF00000 -I/HHARM9-EDU/新建文件夹/ppcboot/include -fno-builtin -pipe -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -Wall -Wstrict-prototypes  main.c altera.c bedbug.c cmd_autoscript.c cmd_bedbug.c cmd_boot.c cmd_bootm.c cmd_cache.c cmd_console.c cmd_date.c cmd_dcr.c cmd_diag.c cmd_doc.c cmd_dtt.c cmd_eeprom.c cmd_elf.c cmd_fdc.c cmd_flash.c cmd_fpga.c cmd_i2c.c cmd_ide.c cmd_immap.c cmd_jffs2.c cmd_mem.c cmd_mii.c cmd_misc.c cmd_net.c cmd_nvedit.c env_common.c env_flash.c env_eeprom.c env_nvram.c env_nowhere.c cmd_pci.c cmd_pcmcia.c cmd_reginfo.c cmd_scsi.c cmd_vfd.c cmd_usb.c command.c console.c devices.c dlmalloc.c docecc.c environment.c flash.c fpga.c hush.c kgdb.c lists.c miiphybb.c miiphyutil.c s_record.c soft_i2c.c soft_spi.c cmd_spi.c spartan2.c usb.c usb_kbd.c usb_storage.c virtex2.c xilinx.c > .depend
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/common'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/common'
make[1]: “.depend”是最新的。
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/common'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/disk'
/opt/host/armv4l/bin/armv4l-unknown-linux-gcc -M -g  -Os  -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -D__KERNEL__ -DTEXT_BASE=0x0CF00000 -I/HHARM9-EDU/新建文件夹/ppcboot/include -fno-builtin -pipe -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -Wall -Wstrict-prototypes part.c part_mac.c part_dos.c part_iso.c > .depend
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/disk'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/disk'
make[1]: “.depend”是最新的。
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/disk'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/fs'
make[2]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/fs/jffs2'
/opt/host/armv4l/bin/armv4l-unknown-linux-gcc -M -g  -Os  -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -D__KERNEL__ -DTEXT_BASE=0x0CF00000 -I/HHARM9-EDU/新建文件夹/ppcboot/include -fno-builtin -pipe -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -Wall -Wstrict-prototypes  jffs2_1pass.c compr_rtime.c compr_rubin.c compr_zlib.c mini_inflate.c > .depend
make[2]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/fs/jffs2'
make[2]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/fs/jffs2'
make[2]: “.depend”是最新的。
make[2]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/fs/jffs2'
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/fs'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/net'
/opt/host/armv4l/bin/armv4l-unknown-linux-gcc -M -g  -Os  -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -D__KERNEL__ -DTEXT_BASE=0x0CF00000 -I/HHARM9-EDU/新建文件夹/ppcboot/include -fno-builtin -pipe -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -Wall -Wstrict-prototypes net.c tftp.c bootp.c rarp.c arp.c eth.c > .depend
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/net'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/net'
make[1]: “.depend”是最新的。
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/net'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/rtc'
/opt/host/armv4l/bin/armv4l-unknown-linux-gcc -M -g  -Os  -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -D__KERNEL__ -DTEXT_BASE=0x0CF00000 -I/HHARM9-EDU/新建文件夹/ppcboot/include -fno-builtin -pipe -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -Wall -Wstrict-prototypes date.c   ds1302.c ds1306.c ds1337.c ds1556.c ds174x.c m41t11.c m48t35ax.c mc146818.c mk48t59.c mpc8xx.c pcf8563.c > .depend
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/rtc'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/rtc'
make[1]: “.depend”是最新的。
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/rtc'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/dtt'
/opt/host/armv4l/bin/armv4l-unknown-linux-gcc -M -g  -Os  -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -D__KERNEL__ -DTEXT_BASE=0x0CF00000 -I/HHARM9-EDU/新建文件夹/ppcboot/include -fno-builtin -pipe -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -Wall -Wstrict-prototypes lm75.c ds1621.c > .depend
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/dtt'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/dtt'
make[1]: “.depend”是最新的。
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/dtt'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/drivers'
/opt/host/armv4l/bin/armv4l-unknown-linux-gcc -M -g  -Os  -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -D__KERNEL__ -DTEXT_BASE=0x0CF00000 -I/HHARM9-EDU/新建文件夹/ppcboot/include -fno-builtin -pipe -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -Wall -Wstrict-prototypes 3c589.c 5701rls.c bcm570x.c bcm570x_autoneg.c cfb_console.c dm9000x.c dc2114x.c eepro100.c i8042.c natsemi.c ns16550.c ns8382x.c ns87308.c pci.c pci_auto.c pci_indirect.c pcnet.c serial.c smc91111.c smiLynxEM.c sym53c8xx.c tigon3.c w83c553f.c ct69000.c > .depend
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/drivers'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/drivers'
make[1]: “.depend”是最新的。
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/drivers'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/post'
/opt/host/armv4l/bin/armv4l-unknown-linux-gcc -M -g  -Os  -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -D__KERNEL__ -DTEXT_BASE=0x0CF00000 -I/HHARM9-EDU/新建文件夹/ppcboot/include -fno-builtin -pipe -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -Wall -Wstrict-prototypes cache_8xx.S post.c tests.c cpu.c rtc.c watchdog.c memory.c i2c.c cache.c uart.c ether.c usb.c spr.c > .depend
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/post'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/post'
make[1]: “.depend”是最新的。
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/post'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/post/cpu'
/opt/host/armv4l/bin/armv4l-unknown-linux-gcc -M -g  -Os  -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -D__KERNEL__ -DTEXT_BASE=0x0CF00000 -I/HHARM9-EDU/新建文件夹/ppcboot/include -fno-builtin -pipe -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -Wall -Wstrict-prototypes asm.S cmp.c cmpi.c two.c twox.c three.c threex.c threei.c andi.c srawi.c rlwnm.c rlwinm.c rlwimi.c store.c load.c cr.c b.c multi.c string.c complex.c > .depend
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/post/cpu'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/post/cpu'
make[1]: “.depend”是最新的。
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/post/cpu'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/examples'
/opt/host/armv4l/bin/armv4l-unknown-linux-gcc -M -g  -Os  -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -fno-strict-aliasing  -fno-common -ffixed-r8 -mshort-load-bytes -msoft-float -D__KERNEL__ -DTEXT_BASE=0x0CF00000 -I/HHARM9-EDU/新建文件夹/ppcboot/include -fno-builtin -pipe -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv4 -Wall -Wstrict-prototypes hello_world.c  syscall.S > .depend
syscall.S:6: warning: #warning ARM version not implemented yet
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/examples'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/examples'
make[1]: “.depend”是最新的。
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/examples'
make[1]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/tools'
gcc -Wall -pedantic -I../include -I.. -DTEXT_BASE=0x0CF00000 -DUSE_HOSTCC -O -c -o img2srec.o img2srec.c
gcc -Wall -pedantic -I../include -I.. -DTEXT_BASE=0x0CF00000 -DUSE_HOSTCC -O  -o img2srec img2srec.o
strip img2srec
gcc -g -Wall -pedantic -I../include -I.. -DTEXT_BASE=0x0CF00000 -DUSE_HOSTCC -O -c mkimage.c
gcc -g -Wall -pedantic -I../include -I.. -DTEXT_BASE=0x0CF00000 -DUSE_HOSTCC -O -c crc32.c
gcc -Wall -pedantic -I../include -I.. -DTEXT_BASE=0x0CF00000 -DUSE_HOSTCC -O  -o mkimage mkimage.o crc32.o
strip mkimage
gcc -g -Wall -pedantic -I../include -I.. -DTEXT_BASE=0x0CF00000 -DUSE_HOSTCC -O -c envcrc.c
在包含自 ../include/config.h:2 的文件中,
                 从 envcrc.c:29:
../include/configs/smdk2400.h:117:6: 警告:“&”的右操作数在提升时变换了符号
../include/configs/smdk2400.h:117:6: 警告:“&”的右操作数在提升时变换了符号
gcc -g  -I../include -I.. -DTEXT_BASE=0x0CF00000 -DUSE_HOSTCC -c environment.c
gcc -Wall -pedantic -I../include -I.. -DTEXT_BASE=0x0CF00000 -DUSE_HOSTCC -O -o envcrc envcrc.o crc32.o environment.o
gcc -g -Wall -pedantic -I../include -I.. -DTEXT_BASE=0x0CF00000 -DUSE_HOSTCC -O -c gen_eth_addr.c
gcc -Wall -pedantic -I../include -I.. -DTEXT_BASE=0x0CF00000 -DUSE_HOSTCC -O  -o gen_eth_addr gen_eth_addr.o
strip gen_eth_addr
gcc -Wall -pedantic -I../include -I.. -DTEXT_BASE=0x0CF00000 -DUSE_HOSTCC -O -c -o bmp_logo.o bmp_logo.c
gcc -Wall -pedantic -I../include -I.. -DTEXT_BASE=0x0CF00000 -DUSE_HOSTCC -O  -o bmp_logo bmp_logo.o
strip bmp_logo
./bmp_logo logos/denx.bmp >/HHARM9-EDU/新建文件夹/ppcboot/include/bmp_logo.h
make[2]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/tools/gdb'
gcc -M -I/usr/include -I../include gdbsend.c gdbcont.c astest.c error.c remote.c serial.c > .depend
make[2]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/tools/gdb'
make[2]: Entering directory `/HHARM9-EDU/新建文件夹/ppcboot/tools/gdb'
gcc -Wall -pedantic -O -I/usr/include -c -o gdbsend.o gdbsend.c
gcc -Wall -pedantic -O -I/usr/include -c -o error.o error.c
gcc -Wall -pedantic -O -I/usr/include -c -o remote.o remote.c
gcc -Wall -pedantic -O -I/usr/include -c -o serial.o serial.c
gcc -Wall -pedantic -O -I/usr/include  -o gdbsend gdbsend.o error.o remote.o serial.o
gcc -Wall -pedantic -O -I/usr/include -c -o gdbcont.o gdbcont.c
gcc -Wall -pedantic -O -I/usr/include  -o gdbcont gdbcont.o error.o remote.o serial.o
gcc -Wall -pedantic -O -I/usr/include -c -o astest.o astest.c
astest.c: 在函数 ‘process_section’ 中:
astest.c:31: 错误:‘asection’ 没有名为 ‘_cooked_size’ 的成员
astest.c:31: 错误:‘asection’ 没有名为 ‘_raw_size’ 的成员
astest.c:35: 警告:格式 ‘%ld’ 需要类型 ‘long int’,但实参 4 的类型为 ‘file_ptr’
astest.c:38: 警告:格式 ‘%ld’ 需要类型 ‘long int’,但实参 2 的类型为 ‘file_ptr’
astest.c:38: 警告:格式 ‘%ld’ 需要类型 ‘long int’,但实参 3 的类型为 ‘file_ptr’
astest.c:41: 警告:格式 ‘%ld’ 需要类型 ‘long int’,但实参 2 的类型为 ‘file_ptr’
make[2]: *** [astest.o] 错误 1
make[2]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/tools/gdb'
make[1]: *** [subdirs] 错误 1
make[1]: Leaving directory `/HHARM9-EDU/新建文件夹/ppcboot/tools'
make: *** [subdirs] 错误 1
注:用的华恒的板子,求解~
 楼主| 发表于 2006-11-14 22:15:47 | 显示全部楼层
整个ppcboot代码中只有astest.c文件出现了asection和_cooked_size,_raw_size
astest.c文件如下:奇怪~
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <bfd.h>
#include "error.h"

int verbose = 0;

void
process_section(bfd *abfd, asection *sect, PTR obj)
{
    printf("Section '%s':\n", sect->name);

    printf("\tindex=%d, flags=%x\n", sect->index, sect->flags);

#if 0
    printf("\tuser_set_vma=%u, reloc_done=%u, linker_mark=%u, gc_mark=%u\n",
        (unsigned long)sect->user_set_vma, (unsigned long)sect->reloc_done,
        (unsigned long)sect->linker_mark, (unsigned long)sect->gc_mark);
#else
    printf("\tuser_set_vma=%u, reloc_done=%u\n",
        (unsigned int)sect->user_set_vma, (unsigned int)sect->reloc_done);
#endif

    printf("\tvma=%08lx, lma=%08lx\n",
        (unsigned long)sect->vma, (unsigned long)sect->lma);

    printf("\tcooked_size=%ld, raw_size=%ld, output_offset=%ld\n",
        (long)sect->_cooked_size, (long)sect->_raw_size,
        (long)sect->output_offset);

    printf("\talignment_power=%d, reloc_count=%d, filepos=%ld\n",
        sect->alignment_power, sect->reloc_count, sect->filepos);

    printf("\trel_filepos=%ld, line_filepos=%ld, lineno_count=%d\n",
        sect->rel_filepos, sect->line_filepos, sect->lineno_count);

    printf("\tmoving_line_filepos=%ld, target_index=%d\n",
        sect->moving_line_filepos, sect->target_index);
}

int
main(int ac, char **av)
{
    int c, ifd;
    char *ifn;
    bfd *bfdp;

    if ((pname = strrchr(av[0], '/')) == NULL)
        pname = av[0];
    else
        pname++;

    while ((c = getopt(ac, av, "v")) != EOF)
        switch (c) {

        case 'v':
            verbose = 1;
            break;

        default:
        usage:
            fprintf(stderr, "Usage: %s [-v] imagefile\n", pname);
            exit(1);
        }
    if (optind != ac - 1)
        goto usage;

    ifn = av[optind];

    if (verbose)
        fprintf(stderr, "Opening file...\n");

    if ((ifd = open(ifn, O_RDONLY)) < 0)
        Perror("can't open image file '%s'", ifn);

    if ((bfdp = bfd_fdopenr(ifn, "elf32-powerpc", ifd)) == NULL) {
        bfd_perror(ifn);
        close(ifd);
        Error("bfd_fdopenr of file '%s' failed", ifn);
    }
    bfdp->cacheable = 1;

    if (!bfd_check_format(bfdp, bfd_object) ||
      (bfd_get_file_flags(bfdp) & EXEC_P) == 0) {
        bfd_close(bfdp);
        Error("file '%s' is not an executable object file (%s,0x%x)", ifn,
            bfd_format_string(bfd_get_format(bfdp)), bfd_get_file_flags(bfdp));
    }

    printf("file '%s' is type '%s'...\n", ifn, bfd_get_target(bfdp));

    bfd_map_over_sections(bfdp, process_section, NULL);;

    bfd_close(bfdp);

    if (verbose)
        fprintf(stderr, "Done.\n");

    return (0);
}
回复

使用道具 举报

发表于 2006-11-20 22:26:40 | 显示全部楼层
这个错误可以从华恒的论坛上得到答案,
把astest.c中
printf("\tcooked_size=%ld, raw_size=%ld, output_offset=%ld\n",
        (long)sect->_cooked_size, (long)sect->_raw_size,
        (long)sect->output_offset);

改为
printf("\tcooked_size=%ld, raw_size=%ld, output_offset=%ld\n",
        (long)sect->cooked_size, (long)sect->raw_size,
        (long)sect->output_offset);
就可以了。
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-11-25 00:39 , Processed in 0.139195 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

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