百问网Linux技术区Linux应用开发 在《S3C2410完全开发流程》遇到的问题

1  /  1  页   1 跳转 查看:599

在《S3C2410完全开发流程》遇到的问题

在《S3C2410完全开发流程》遇到的问题

在做第二个试验例程LED_ON_C出错,编译不通过。

我使用的交叉编译器是4.4.3版本。用的是红帽9.0的系统!麻烦大家帮我解决下,谢谢
 

回复:在《S3C2410完全开发流程》遇到的问题

你是否修改了代码?
原来的第5行是“{”,
贴出你的代码
 

回复 2F thisway.diy 的帖子

我的led_on_c.c的代码如下:
#define GPBCON  (*(volatile unsigned long)*0x56000010)
#define GPBDAT  (*(volatile unsigned long)*0x56000014)
int main()
{
        GPBCON=0x00004000;
        GPBDAT=0x00000000;
        return 0;
}
 

回复:在《S3C2410完全开发流程》遇到的问题

我的crt0.s的代码如下:
.text
.global _start
_start:
    ldr sp, =1024*4 
    bl main        
halt_loop:
    b halt_loop
 

回复:在《S3C2410完全开发流程》遇到的问题

改为:
#define GPBCON  (*(volatile unsigned long *)0x56000010)
#define GPBDAT  (*(volatile unsigned long *)0x56000014)
 

回复:在《S3C2410完全开发流程》遇到的问题

真是一个低级的错误,我应该检讨下自己反的错误,谢谢你的帮助,我改过来以后,出现了连接错误的提示,麻烦你看下
[root@localhost LED_ON_C]# make
arm-linux-gcc -g -c -o crt0.o crt0.s
crt0.s: Assembler messages:crt0.s:0: Warning: end of file not at end of a line; newline inserted
arm-linux-gcc -g -c -o led_on_c.o led_on_c.c
arm-linux-gcc -Ttext 0x00000000 -g      crt0.o led_on_c.o -o led_on_c_tmp.o
crt0.o: In function `_start':/usr/local/bin/SOURCE2410/LED_ON_C/crt0.s:4: multiple definition of

`_start'/opt/EmbedSky/4.3.3/bin/../arm-none-linux-gnueabi/libc/armv4t/usr/lib/crt1.o:init.c.text+0x0): first defined here
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: section .init_array

[000081f0 -> 000081f3] overlaps section .dynstr [000081d4 -> 00008250]
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: section .gnu.version

[00008252 -> 0000825d] overlaps section .dynamic [000081fc -> 000082eb]
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: section .got [000082ec

-> 00008307] overlaps section.plt [000082d0 -> 00008307]
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: led_on_c_tmp.o: section

.init_array vma 0x81f0 overlaps previous sections
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: led_on_c_tmp.o: section

.fini_array vma 0x81f4 overlaps previous sections
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: led_on_c_tmp.o: section

.jcr vma 0x81f8 overlaps previous sections
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: led_on_c_tmp.o: section

.dynamic vma 0x81fc overlaps previous sections
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: led_on_c_tmp.o: section

.gnu.version vma 0x8252 overlaps previous sections
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: led_on_c_tmp.o: section

.gnu.version_r vma 0x8260 overlaps previous sections
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: led_on_c_tmp.o: section

.rel.dyn vma 0x82a0 overlaps previous sections
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: led_on_c_tmp.o: section

.rel.plt vma 0x82a8 overlaps previous sections
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: led_on_c_tmp.o: section

.init vma 0x82c0 overlaps previous sections
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: led_on_c_tmp.o: section

.plt vma 0x82d0 overlaps previous sections
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: led_on_c_tmp.o: section

.got vma 0x82ec overlaps previous sections
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: led_on_c_tmp.o: section

.data vma 0x8308 overlaps previous sections
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: led_on_c_tmp.o: section

.bss vma 0x8310 overlaps previous sections
/opt/EmbedSky/4.3.3/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: BFD (Sourcery G++ Lite

2009q1-203) 2.19.51.20090205 assertion fail /scratch/mitchell/builds/4.3-arm-none-linux-gnueabi-respin/lite/obj/binutils-src-

2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu/bfd/elf32-arm.c:12273
collect2: ld returned 1 exit status
make: *** [led_on_c] Error 1
 

回复:在《S3C2410完全开发流程》遇到的问题

arm-linux-gcc -Ttext 0x00000000 -g      crt0.o led_on_c.o -o led_on_c_tmp.o
改为:
arm-linux-ld -Ttext 0x00000000 -g      crt0.o led_on_c.o -o led_on_c_tmp.o

如果用arm-linux-gcc链接的话,它会把默认的一些启动代码加进去,
但是这个是裸板程序,所有的代码都是你自己写的,不需要默认的启动代码
 

回复:在《S3C2410完全开发流程》遇到的问题

谢谢版主,我已经编译出来自己的程序了,试验1,2的例程都搞定了,后面的例程你给了思路,所以我自己学着编程。
由于我的交叉编译器版本太高,支持EBAI,所以编译例程会出现`__aeabi_unwind_cpp_pr0',最后改成3.4.5版本就OK了,呵呵!可以给其他人点建议,交叉编译器不能太高,不然会出现一些编译错误。
 

回复:在《S3C2410完全开发流程》遇到的问题

请问该书是否已经出版?
 

回复:在《S3C2410完全开发流程》遇到的问题

出版两年了:嵌入式linux应用开发完全手册
 
1  /  1  页   1 跳转

地址:广东省深圳市南山区南山大道3003号久商大厦C-1406;邮编:518052;电话:0755-86200561

粤ICP备09041549号, 版权所有 百问网   Sitemap

Powered by Discuz!NT 2.0.1214    Copyright © 2001-2010 Comsenz Inc.
Processed in 0.046875 second(s) , 4 queries.
返顶部