现在的位置: 首页 > 综合 > 正文

summary

2014年02月05日 ⁄ 综合 ⁄ 共 2403字 ⁄ 字号 评论关闭

Relocation the generic ELF 问题
 

 

这个连接问题是由于将两个使用不同编译器编译出的目标文件连接到一起而导致的,原因经常是因为没有在所有的Makefile中统一使用$(CC)代表编译器。

 

/* 是否相等 */
ifeq ($(PLATFORM), 目标硬件平台)
export CROSS_COMPILE := 编译器前缀  --------一定要导出这个,要不会出现Relocation the generic ELF (EM 40)的问题
endif

export CC:= $(CROSS_COMPILE)gcc /* 编译器 */
export AR:= $(CROSS_COMPILE)ar /* 生成.a文件 */
export AS:= $(CROSS_COMPILE)as /* 汇编器 */
export LD:= $(CROSS_COMPILE)ld /* 连接器 */
export NM:= $(CROSS_COMPILE)nm /* */
export RANLIB:= $(CROSS_COMPILE)ranlib /* */
export STRIP:= $(CROSS_COMPILE)strip /* 优化目标文件大小 */
export SIZE:= $(CROSS_COMPILE)size /* */

文章出处:http://www.diybl.com/course/3_program/c++/cppsl/200899/141297.html

 

 

error: `PCIMEM_BASE ' undeclared

drivers/video/console/vgacon.c:292:   error:   `PCIMEM_BASE '   undeclared   (first   use   in   this   function)
 
解决方法:
device drivers->
   Graphics support->
      Console display driver support->
         [ ]VGA text console
选择一个合适的编译器版本
init/built-in.o: In function `do_one_initcall':
/home/buery/workspace/linux-2.6.29/init/main.c:694: undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `run_init_process':
/home/buery/workspace/linux-2.6.29/init/main.c:781: undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `init_post':
/home/buery/workspace/linux-2.6.29/init/main.c:790: undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `name_to_dev_t':
/home/buery/workspace/linux-2.6.29/init/do_mounts.c:77: undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `rest_init':
/home/buery/workspace/linux-2.6.29/init/main.c:452: undefined reference to `__gnu_mcount_nc'
init/built-in.o:/home/buery/workspace/linux-2.6.29/init/calibrate.c:123: more undefined references to `__gnu_mcount_nc' follow
就可以解决上面的问题。
Notes: arm-2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 解决问题。
TIP0
Enter your selection: b
Copy linux kernel from 0x00050000 to 0x30008000, size = 0x00200000 ... done
zImage magic = 0x016f2818
Setup linux parameters at 0x30000100
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0"
MACH_TYPE = 782
NOW, Booting Linux......
kernel启动停在Booting Linux.....没下文了。
以上情况:关闭kernel hacking 里的kernel debugging即可解决。
TIP1
内核启动到printk.c里的初始化串口处之后就打不出信息,打出来一部分乱码的解决办法是修改mach-smdk.c里的串口波特率(就是MACHINE_START那里).板子的初始化东西都在那个.c里。
TIP2
无法用DNW通过usb下载新添加yaffs文件系统的问题是:新编出来的kernel大于2M,而分区只分给kernel 2M的空间所以会下载失败。
TIP3
出现
unable to open an initial console.
Failed to execute /linuxrc.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
只要重新烧写kernel和文件系统,让kernel的common-smdk.c中的nand的分区信息和vivi中的分区信息保持一致即可。

抱歉!评论已关闭.