随笔分类 -  arm-linux

摘要:# arm-linux-gcc -v xxx 4.3.3/* main.c */static unsigned *p = (unsigned*) (0x0000); /* 当外部的初始化为0,一切OK int main (void){ xxxxx; ...... ;}# arm-linux-gcc -O0 main.c -g -c -Wall 当我们不加不优化的时候 文件瞬间变的很大,当 -O2的时候,一切OK或许这个是一个BUG. 阅读全文
posted @ 2013-10-13 17:59 moon_cat 阅读(454) 评论(0) 推荐(0)
摘要:arm 支持4种堆栈分别为1.FD (full decending) 满堆栈递减2.FA (full ascendng) 满堆栈递增3.ED (empty desending ) 空堆栈递减4.EA (empty ascending ) 空堆堆栈的递增我们很熟悉的X86 堆栈操作,一般是堆栈先指向最后一个有效的数据的低地址比如 mov esp ,4096,那么就是制定 0 - 4095 作为堆栈空间了,(ss 为0)(以32位 CPU ,小端模式为例)那么执行 push 操作的时候就是esp -= 4;dword ptr [esp] = xxx;相对应,pop 就是 xxx = dword p 阅读全文
posted @ 2013-04-24 13:11 moon_cat 阅读(1036) 评论(0) 推荐(0)
摘要:Table of Contents 1. Overview1.1 Structure of this Manual1.2 The GNU Assembler1.3 Object File Formats1.4 Command Line1.5 Input Files1.6 Output (Object) File1.7 Error and Warning Messages2. Command-Line Options2.1 Enable Listings:`-a[cdhlns]'2.2`-D'2.3 Work Faster:`-f'2.4 .include search 阅读全文
posted @ 2013-04-23 14:34 moon_cat 阅读(435) 评论(0) 推荐(0)
摘要:arm-linux-gcc 编裸机程序时,ld 时突蹦出这么一条 error ,指向的正是除法指令,arm920t,是armv4,其并不支持除法指令,但是却支持软浮点,嘿嘿,说白了就是一个模拟除法的静态库,那这个函数在哪儿? 谷歌发现,是 libgcc.a 库$ su -i# find / -name 'libgcc.a' -exec dirname {} \; > ~/libpath...# vim Makefile 修改添加LIBPATH最后的命令行大致是如此arm-linux-ld -Ttext 0xxxxxx -g start.o xxx.o xxxx.o -o 阅读全文
posted @ 2013-04-08 20:35 moon_cat 阅读(3905) 评论(0) 推荐(1)
摘要:unix/linux 对 大小写敏感:.s 操作 :汇编.S 操作 : cpp + 汇编eg:/* start.s */#define rTEXT 0x12345678 LDR R0,=rTEXT ....# arm-linux-gcc -g -c -nostdlib start.s -o start.o # nm -u start.o rTEXT # arm-linux-objdump -S -t start.o > start.l# cat start.i | grep ''R0" LDR R0,【PC,#0】经典错误:arm-linux-gcc 将.s 文 阅读全文
posted @ 2013-04-05 19:06 moon_cat 阅读(579) 评论(0) 推荐(0)