linuxϵÄELFÎļþ·ÖÎö
from:http://www.dzjs.net/html/qianrushixitong/2008/0509/3125.html
1 ÒýÑÔ
ELF(Executable and Linkable Format)¼´¿ÉÖ´ÐÐÁ¬½ÓÎļþ¸ñʽ£¬ÊÇLinux£¬SVR4ºÍSolaris2.0ĬÈϵÄÄ¿±êÎļþ¸ñʽ£¬Ä¿Ç°±ê×¼½Ó¿ÚίԱ»áTISÒѽ«ELF±ê×¼»¯ÎªÒ»ÖÖ¿ÉÒÆÖ²µÄÄ¿±êÎļþ¸ñʽ£¬ÔËÐÐÓÚ32-bit IntelÌåϵ΢»úÉÏ£¬¿ÉÓë¶àÖÖ²Ù×÷ϵͳ¼æÈÝ¡£·ÖÎöelfÎļþÓÐÖúÓÚÀí½âһЩÖØÒªµÄϵͳ¸ÅÄÀýÈç³ÌÐòµÄ±àÒëºÍÁ´½Ó£¬³ÌÐòµÄ¼ÓÔغÍÔËÐеÈ
2 ELFÎļþ¸ñʽ
2.1 ELFÎļþµÄÀàÐÍ
ELFÎļþÖ÷ÒªÓÐÈýÖÖÀàÐÍ£º
(1)¿ÉÖض¨Î»Îļþ°üº¬ÁË´úÂëºÍÊý¾Ý£®¿ÉÓëÆäËüELFÎļþ½¨Á¢Ò»¸ö¿ÉÖ´Ðлò¹²ÏíµÄÎļþ£º
(2)¿ÉÖ´ÐÐÎļþʱ¿ÉÖ±½ÓÖ´ÐеijÌÐò£º
(3)¹²ÏíÄ¿±êÎļþ°üÀ¨´úÂëºÍÊý¾Ý£¬¿ÉÒÔÔÚÁ½¸öµØ·½Á´½Ó¡£µÚÒ»£¬Á¬½ÓÆ÷¿ÉÒÔ°ÑËüºÍÆäËü¿ÉÖض¨Î»ÎļþºÍ¹²ÏíÎļþÒ»Æð´¦ÀíÒÔ½¨Á¢ÁíÒ»¸öELFÎļþ;µÚ¶þ£¬¶¯Ì¬Á´½ÓÆ÷°ÑËüºÍÒ»¸ö¿ÉÖ´ÐÐÎļþºÍÆäËü¹²ÏíÎļþ½áºÏÔÚÒ»Æð½¨Á¢Ò»¸ö½ø³ÌÓ³Ïñ¡£
2.2 ELFÎļþµÄ×éÖ¯
ELFÎļþ²ÎÓë³ÌÐòµÄÁ¬½Ó(½¨Á¢Ò»¸ö³ÌÐò)ºÍ³ÌÐòµÄÖ´ÐÐ(ÔËÐÐÒ»¸ö³ÌÐò)£¬±àÒëÆ÷ºÍÁ´½ÓÆ÷½«ÆäÊÓΪ½ÚÍ·±í(section header table)ÃèÊöµÄһЩ½Ú(section)µÄ¼¯ºÏ£¬¶ø¼ÓÔØÆ÷Ôò½«ÆäÊÓΪ³ÌÐòÍ·±í(program header table)ÃèÊöµÄ¶Î(segment)µÄ¼¯ºÏ£¬Í¨³£Ò»¸ö¶Î¿ÉÒÔ°üº¬¶à¸ö½Ú¡£¿ÉÖض¨Î»Îļþ¶¼°üº¬Ò»¸ö½ÚÍ·±í£¬¿ÉÖ´ÐÐÎļþ¶¼°üº¬Ò»¸ö³ÌÐòÍ·±í¡£¹²ÏíÎļþÁ½Õ߶¼°üº¬ÓС£Îª´Ë£¬ELFÎļþ¸ñʽͬʱÌṩÁËÁ½ÖÖ¿´´ýÎļþÄÚÈݵķ½Ê½£¬·´Ó³Á˲»Í¬ÐÐΪµÄ²»Í¬ÒªÇó¡£ÏÂͼÏÔʾÁËELFÎļþµÄ×éÖ¯¡£
2.3 ÎļþÍ·(Elf header)
ElfÍ·ÔÚ³ÌÐòµÄ¿ªÊ¼²¿Î»£¬×÷ΪÒý·±íÃèÊöÕû¸öELFµÄÎļþ½á¹¹£¬ÆäÐÅÏ¢´óÖ·ÖΪËIJ¿·Ö£ºÒ»ÊÇϵͳÏà¹ØÐÅÏ¢£¬¶þÊÇÄ¿±êÎļþÀàÐÍ£¬ÈýÊǼÓÔØÏà¹ØÐÅÏ¢£¬ËÄÊÇÁ´½ÓÏà¹ØÐÅÏ¢ ÆäÖÐϵͳÏà¹ØÐÅÏ¢°üÀ¨elfÎļþħÊý(±êʶelfÎļþ)£¬Æ½Ì¨Î»Êý£¬Êý¾Ý±àÂ뷽ʽ£¬elfÍ·²¿°æ±¾£¬Ó²¼þƽ̨e_machine£¬Ä¿±êÎļþ°æ±¾e_version£¬´¦ÀíÆ÷Ìض¨±êÖ¾e_ftags£ºÕâЩÐÅÏ¢µÄÒýÈ뼫´óÔöÇ¿ÁËelfÎļþµÄ¿ÉÒÆÖ²ÐÔ£¬Ê¹½»²æ±àÒë³ÉΪ¿ÉÄÜ¡£Ä¿±êÎļþÀàÐÍÓÃe_typeµÄÖµ±íʾ£¬¿ÉÖض¨Î»ÎļþΪ1£¬¿ÉÖ´ÐÐÎļþΪ2£¬¹²ÏíÎļþΪ3;¼ÓÔØÏà¹ØÐÅÏ¢ÓУº³ÌÐò½øÈëµãe_entry£®³ÌÐòÍ·±íÆ«ÒÆÁ¿e_phoff£¬elfÍ·²¿³¤¶Èe_ehsize£¬³ÌÐòÍ·±íÖÐÒ»¸öÌõÄ¿µÄ³¤¶Èe_phentsize£¬³ÌÐòÍ·±íÌõÄ¿ÊýÄ¿e_phnum;Á´½ÓÏà¹ØÐÅÏ¢ÓУº½ÚÍ·±íÆ«ÒÆÁ¿e_shoff£¬½ÚÍ·±íÖÐÒ»¸öÌõÄ¿µÄ³¤¶Èe_shentsize£¬½ÚÍ·±íÌõÄ¿¸öÊýe_shnum £¬½ÚÍ·±í×Ö·ûË÷Òýe shstmdx¡£¿ÉʹÓÃreadelf -h
Ïà¹ØÎĵµ£º
×ÜÀÀ
ÓÃiptables -ADC À´Ö¸¶¨Á´µÄ¹æ
Ôò
£¬-AÌí¼Ó -Dɾ³ý -C ÐÞ¸Ä
iptables - [RI] chain rule num rule-specification[option]
ÓÃiptables - RI ͨ¹ý¹æÔòµÄ˳ÐòÖ¸¶¨
iptables -D chain rule num[option]
ɾ³ýÖ¸¶¨¹æÔò
iptables -[LFZ] [chain][option]
ÓÃiptables -LFZ Á´Ãû [Ñ¡Ïî]
iptables -[NX] chain
ÓÃ -NX ......
½â¾ö²½Ö裺ÒÔarm-linux-gcc-4.3.2.tgzΪÀý
1. °Ñarm-linux-gcc-4.3.2.tgz¿½±´µ½ÄãÖ¸¶¨µÄĿ¼ÀȻºóÓÃtarÃüÁî½âѹµ½µ±Ç°Ä¿Â¼¡£³É¹¦ºó£¬»áÔÚ4.3.2/binÏÂÕÒµ½arm-linux-gcc¡£
ÀýÈ磺/opt/arm-linux-gcc-4.3.2.taz£¬ÒÔÏÂÃüÁºìɫΪϵͳÌáʾ·û£¬ºÚɫΪÓû§ÃüÁî
gylu@dell-desktop:~$ ......
ÔÚ±¾½Ì³ÌÖУ¬ÎÒÃǽ«¸øÄú½éÉÜ bash£¨±ê×¼µÄ Linux shell£©£¬ÎªÄúչʾÈçºÎ³ä·ÖÀûÓÃÈç ls¡¢cp ºÍ mv ÕâÑùµÄ±ê×¼ Linux ÃüÁ²¢ÏòÄú½²½â Linux µÄȨÏÞºÍËùÓÐȨģÐÍÒÔ¼°¸ü·á¸»µÄÄÚÈÝ¡£ÔÚ±¾½Ì³Ì½áÊøÖ®¼Ê£¬Äú½«¾ßÓÐ Linux »ù´¡ÖªÊ¶·½ÃæµÄÔúʵ»ù´¡£¬ÉõÖÁ»¹¿ÉÒÔ×¼±¸¿ªÊ¼Ñ§Ï°Ò»Ð©»ù±¾µÄ Linux ϵͳ¹ÜÀíÈÎÎñ·½ÃæµÄ֪ʶ¡£
Ò»¡£¹ØÓÚ±¾½ ......
http://www.ibm.com/developerworks/cn/linux/embed/diy/
DIY£º×Ô¼º¶¯ÊÖ×öÒ»¸öÃÔÄã Linux ϵͳ
ÎĵµÑ¡Ïî
<tr valign="top"><td width="8"><img alt="" height="1" width="8" src="//www.ibm.com/i/c.gif"/></td><td width=&quo ......
LinuxµÄI/O»úÖƾÀúÁËһϼ¸¸ö½×¶ÎµÄÑݽø£º
1. ͬ²½×èÈûI/O: Óû§½ø³Ì½øÐÐI/O²Ù×÷£¬Ò»Ö±×èÈûµ½I/O²Ù×÷Íê³ÉΪֹ¡£
2. ͬ²½·Ç×èÈûI/O: Óû§³ÌÐò¿ÉÒÔͨ¹ýÉèÖÃÎļþÃèÊö·ûµÄÊôÐÔO_NONBLOCK£¬I/O²Ù×÷¿ÉÒÔÁ¢¼´·µ»Ø£¬µ«ÊDz¢²»±£Ö¤I/O²Ù×÷³É¹¦¡£
3. Ò첽ʼþ×èÈûI/O: Óû§½ø³Ì¿ÉÒÔ¶ÔI/Oʼþ½øÐÐ×èÈû£¬µ«ÊÇI/O²Ù×÷²¢²»×èÈû¡£Í¨¹ýse ......