µ±Ç°Î»ÖãºLinux½Ì³Ì - Linux×ÊѶ - ÀûÓÃÒì³£±í´¦Àí Linux ÄÚºË̬ȱҳÒì³£

ÀûÓÃÒì³£±í´¦Àí Linux ÄÚºË̬ȱҳÒì³£

¡¡¡¡Ç°ÑÔ¡¡¡¡ÔÚ³ÌÐòµÄÖ´Ðйý³ÌÖУ¬ÒòΪÓöµ½Ä³ÖÖÕÏ°­¶øʹ CPU ÎÞ·¨×îÖÕ·ÃÎʵ½ÏàÓ¦µÄÎïÀíÄÚ´æµ¥Ôª£¬¼´ÎÞ·¨Íê³É´ÓÐéÄâµØÖ·µ½ÎïÀíµØÖ·Ó³ÉäµÄʱºò£¬CPU »á²úÉúÒ»´ÎȱҳÒì³££¬´Ó¶ø½øÐÐÏàÓ¦µÄȱҳÒì³£´¦Àí¡£»ùÓÚ CPU µÄÕâÒ»ÌØÐÔ£¬Linux ²ÉÓÃÁËÇëÇóµ÷Ò³£¨Demand Paging£©ºÍдʱ¸´ÖÆ£¨Copy On Write£©µÄ¼¼Êõ¡¡¡¡¡¡¡¡1£® ÇëÇóµ÷Ò³ÊÇÒ»ÖÖ¶¯Ì¬ÄÚ´æ·ÖÅä¼¼Êõ£¬Ëü°ÑÒ³¿òµÄ·ÖÅäÍƳٵ½²»ÄÜÔÙÍƳÙΪֹ¡£ÕâÖÖ¼¼ÊõµÄ¶¯»úÊÇ£º½ø³Ì¿ªÊ¼ÔËÐеÄʱºò²¢²»·ÃÎʵØÖ·¿Õ¼äÖеÄÈ«²¿ÄÚÈÝ¡£ÊÂʵÉÏ£¬ÓÐÒ»²¿·ÖµØÖ·Ò²ÐíÓÀÔ¶Ò²²»»á±»½ø³ÌËùʹÓᣳÌÐòµÄ¾Ö²¿ÐÔÔ­ÀíÒ²±£Ö¤ÁËÔÚ³ÌÐòÖ´ÐеÄÿ¸ö½×¶Î£¬ÕæÕýʹÓõĽø³ÌÒ³Ö»ÓÐһС²¿·Ö£¬¶ÔÓÚÁÙʱÓò»µ½µÄÒ³£¬ÆäËùÔÚµÄÒ³¿ò¿ÉÒÔÓÉÆäËü½ø³ÌʹÓá£Òò´Ë£¬ÇëÇó·ÖÒ³¼¼ÊõÔö¼ÓÁËϵͳÖеĿÕÏÐÒ³¿òµÄƽ¾ùÊý£¬Ê¹ÄÚ´æµÃµ½Á˺ܺõÄÀûÓᣴÓÁíÍâÒ»¸ö½Ç¶ÈÀ´¿´£¬ÔÚ²»¸Ä±äÄÚ´æ´óСµÄÇé¿öÏ£¬ÇëÇó·ÖÒ³Äܹ»Ìá¸ßϵͳµÄÍÌÍÂÁ¿¡£µ±½ø³ÌÒª·ÃÎʵÄÒ³²»ÔÚÄÚ´æÖеÄʱºò£¬¾Íͨ¹ýȱҳÒì³£´¦Àí½«ËùÐèÒ³µ÷ÈëÄÚ´æÖС£¡¡¡¡¡¡¡¡2£® дʱ¸´ÖÆÖ÷ÒªÓ¦ÓÃÓÚϵͳµ÷ÓÃfork£¬¸¸×Ó½ø³ÌÒÔÖ»¶Á·½Ê½¹²ÏíÒ³¿ò£¬µ±ÆäÖÐÖ®Ò»ÒªÐÞ¸ÄÒ³¿òʱ£¬Äں˲Åͨ¹ýȱҳÒì³£´¦Àí³ÌÐò·ÖÅäÒ»¸öеÄÒ³¿ò£¬²¢½«Ò³¿ò±ê¼ÇΪ¿Éд¡£ÕâÖÖ´¦Àí·½Ê½Äܹ»½Ï´óµÄÌá¸ßϵͳµÄÐÔÄÜ£¬ÕâºÍLinux´´½¨½ø³ÌµÄ²Ù×÷¹ý³ÌÓÐÒ»¶¨µÄ¹Øϵ¡£ÔÚÒ»°ãÇé¿öÏ£¬×Ó½ø³Ì±»´´½¨ÒÔºó»áÂíÉÏͨ¹ýϵͳµ÷ÓÃexecve½«Ò»¸ö¿ÉÖ´ÐгÌÐòµÄÓ³Ïó×°ÔؽøÄÚ´æÖУ¬´Ëʱ»áÖØзÖÅä×Ó½ø³ÌµÄÒ³¿ò¡£ÄÇô£¬Èç¹ûforkµÄʱºò¾Í¶ÔÒ³¿ò½øÐи´ÖƵĻ°£¬ÏÔÈ»ÊǺܲ»ºÏÊʵġ£¡¡¡¡¡¡¡¡ÔÚÉÏÊöµÄÁ½ÖÖÇé¿öϳöÏÖȱҳÒì³££¬½ø³ÌÔËÐÐÓÚÓû§Ì¬£¬Òì³£´¦Àí³ÌÐò¿ÉÒÔÈýø³Ì´Ó³öÏÖÒì³£µÄÖ¸Áî´¦»Ö¸´Ö´ÐУ¬Ê¹Óû§¸Ð¾õ²»µ½Òì³£µÄ·¢Éú¡£µ±È»£¬Ò²»áÓÐÒì³£ÎÞ·¨Õý³£»Ö¸´µÄÇé¿ö£¬Õâʱ£¬Òì³£´¦Àí³ÌÐò»á½øÐÐһЩÉƺóµÄ¹¤×÷£¬²¢½áÊø¸Ã½ø³Ì¡£Ò²¾ÍÊÇ˵£¬ÔËÐÐÔÚÓû§Ì¬µÄ½ø³ÌÈç¹û³öÏÖȱҳÒì³££¬²»»á¶Ô²Ù×÷ϵͳºËÐĵÄÎȶ¨ÐÔÔì³ÉÓ°Ïì¡£ÄÇô¶ÔÓÚÔËÐÐÔÚºËÐÄ̬µÄ½ø³ÌÈç¹û·¢ÉúÁËÎÞ·¨Õý³£»Ö¸´µÄȱҳÒì³££¬Ó¦¸ÃÈçºÎ´¦ÀíÄØ£¿ÊÇ·ñ»áµ¼ÖÂϵͳµÄ±ÀÀ£ÄØ£¿ÊÇ·ñÄܹ»½â¾öºÃÄÚºË̬ȱҳÒì³£¶ÔÓÚ²Ù×÷ϵͳºËÐĵÄÎȶ¨ÐÔÀ´Ëµ»á²úÉúºÜ´óµÄÓ°Ï죬Èç¹ûÒ»¸öÎó²Ù×÷¾Í»áÔì³ÉϵͳµÄOops£¬Õâ¶ÔÓÚÓû§À´ËµÏÔÈ»ÊDz»ÄÜÈÝÈ̵ġ£±¾ÎÄÕýÊÇÕë¶ÔÕâ¸öÎÊÌ⣬½éÉÜÁËÒ»ÖÖLinuxÄÚºËÖÐËù²ÉÈ¡µÄ½â¾ö·½·¨¡£ ¡¡¡¡¡¡¡¡ÔÚ¶ÁÕß¼ÌÐøÍùÏÂÔĶÁ֮ǰ£¬ÓÐÒ»µãÐèÒªÏÈ˵Ã÷һϣ¬±¾ÎÄʾÀýÖÐËùÑ¡µÄ´úÂëÈ¡×ÔÓÚLinux-2.4.0£¬±àÒë»·¾³ÊÇgcc-2.96£¬objdumpµÄ°æ±¾ÊÇ2.11.93.0.2£¬¾ßÌåµÄ°æ±¾ÐÅÏ¢¿ÉÒÔͨ¹ýÒÔϵÄÃüÁî½øÐвéѯ£º¡¡¡¡¡¡¡¡$ gcc -v¡¡¡¡Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs¡¡¡¡gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)¡¡¡¡$ objdump -v¡¡¡¡GNU objdump 2.11.93.0.2 20020207¡¡¡¡Copyright 2002 Free Software Foundation, Inc.¡¡¡¡¡¡¡¡GCCµÄÀ©Õ¹¹¦ÄÜ¡¡¡¡ÓÉÓÚ±¾ÎÄÖлáÓõ½GCCµÄÀ©Õ¹¹¦ÄÜ£¬¼´»ã±àÆ÷asÖÐÌṩµÄ.sectionα²Ù×÷£¬ÔÚÎÄÕ¿ªÊ¼Ö®Ç°ÎÒÔÙ×÷Ò»¸ö¼òÒªµÄ½éÉÜ¡£´Ëα²Ù×÷¶ÔÓÚ²»Í¬µÄ¿ÉÖ´ÐÐÎļþ¸ñʽÓв»Í¬µÄ½âÊÍ£¬ÎÒÒ²²»Ò»Ò»Áо٣¬½ö¶ÔÎÒÃÇËù¸ÐÐËȤµÄLinuxÖг£ÓõÄELF¸ñʽµÄÓ÷¨¼ÓÒÔÃèÊö£¬ÆäÖ¸Áî¸ñʽÈçÏ£º¡¡¡¡¡¡¡¡.section NAME[, "FLAGS"]¡¡¡¡¡¡¡¡´ó¼ÒËùÊìÖªµÄC³ÌÐòÒ»°ãÓÉÒÔϵļ¸¸ö²¿·Ö×é³É£º´úÂë¶Î£¨text section£©¡¢³õʼ»¯Êý¾Ý¶Î(data section)¡¢·Ç³õʼ»¯Êý¾Ý¶Î(bss section)¡¢Õ»(heap)ÒÔ¼°¶Ñ(stack)£¬¾ßÌåµÄµØÖ·¿Õ¼ä²¼¾Ö¿ÉÒԲο¼¡¶UNIX»·¾³¸ß¼¶±à³Ì¡·Ò»Êé¡£¡¡¡¡¡¡¡¡ÔÚLinuxÄÚºËÖУ¬Í¨¹ýʹÓÃ.sectionµÄα²Ù×÷£¬¿ÉÒÔ°ÑËæºóµÄ´úÂë»ã±àµ½Ò»¸öÓÉNAMEÖ¸¶¨µÄ¶ÎÖС£¶øFLAGS×Ö¶ÎÔò˵Ã÷Á˸öεÄÊôÐÔ£¬Ëü¿ÉÒÔÓÃÏÂÃæ½éÉܵĵ¥¸ö×Ö·ûÀ´±íʾ£¬Ò²¿ÉÒÔÊǶà¸ö×Ö·ûµÄ×éºÏ¡£¡¡¡¡¡¡¡¡'a' ¿ÉÖض¨Î»µÄ¶Î ¡¡¡¡'w' ¿Éд¶Î ¡¡¡¡'x' ¿ÉÖ´ÐжΠ¡¡¡¡'W' ¿ÉºÏ²¢µÄ¶Î ¡¡¡¡'s' ¹²Ïí¶Î ¡¡¡¡¾Ù¸öÀý×ÓÀ´ËµÃ÷£¬¶ÁÕßÔÚºóÃæ»á¿´µ½µÄ£º.section .fixup, "ax"¡¡¡¡¡¡¡¡ÕâÑùµÄÒ»ÌõÖ¸ÁÒåÁËÒ»¸öÃûΪ.fixupµÄ¶Î£¬ËæºóµÄÖ¸Áî»á±»¼ÓÈëµ½Õâ¸ö¶ÎÖУ¬¸Ã¶ÎµÄÊôÐÔÊÇ¿ÉÖض¨Î»²¢¿ÉÖ´ÐС£¡¡¡¡¡¡¡¡ÄÚºËȱҳÒì³£´¦Àí¡¡¡¡ÔËÐÐÔÚºËÐÄ̬µÄ½ø³Ì¾­³£ÐèÒª·ÃÎÊÓû§µØÖ·¿Õ¼äµÄÄÚÈÝ£¬µ«ÊÇË­¶¼ÎÞ·¨±£Ö¤ÄÚºËËùµÃµ½µÄÕâЩ´ÓÓû§¿Õ¼ä´«ÈëµÄµØÖ·ÐÅÏ¢ÊÇ"ºÏ·¨"µÄ¡£ÎªÁ˱£»¤Äں˲»ÊÜ´íÎóÐÅÏ¢µÄ¹¥»÷£¬ÐèÒªÑéÖ¤ÕâЩ´ÓÓû§¿Õ¼ä´«ÈëµÄµØÖ·ÐÅÏ¢µÄÕýÈ·ÐÔ¡£¡¡¡¡¡¡¡¡ÔÚÀÏ°æ±¾µÄLinuxÖУ¬Õâ¸ö¹¤×÷ÊÇͨ¹ýº¯Êýverify_areaÀ´Íê³ÉµÄ£º¡¡¡¡¡¡¡¡extern inline int verify_area(int type, const void * addr, unsigned long size)¡¡¡¡¡¡¡¡¸Ãº¯ÊýÑéÖ¤ÁËÊÇ·ñ¿ÉÒÔÒÔtypeÖÐ˵Ã÷µÄ·ÃÎÊÀàÐÍ£¨read or write£©·ÃÎÊ´ÓµØÖ·addr¿ªÊ¼¡¢´óСΪsizeµÄÒ»¿éÐéÄâ´æ´¢ÇøÓò¡£ÎªÁË×öµ½ÕâÒ»µã£¬verify_readÊ×ÏÈÐèÒªÕÒµ½°üº¬µØÖ·addrµÄÐéÄâ´æ´¢ÇøÓò£¨vma£©¡£Ò»°ãµÄÇé¿öÏ£¨ÕýÈ·ÔËÐеijÌÐò£©Õâ¸ö²âÊÔ¶¼»á³É¹¦·µ»Ø£¬ÔÚÉÙÊýÇé¿öϲŻá³öÏÖʧ°ÜµÄÇé¿ö¡£Ò²¾ÍÊÇ˵£¬´ó²¿·ÖµÄÇé¿öÏÂÄÚºËÔÚһЩÎÞÓõÄÑéÖ¤²Ù×÷ÉÏ»¨·ÑÁ˲»Ëã¶ÌµÄʱ¼ä£¬Õâ´Ó²Ù×÷ϵͳÔËÐÐЧÂʵĽǶÈÀ´ËµÊDz»¿É½ÓÊܵġ£¡¡¡¡¡¡¡¡ÎªÁ˽â¾öÕâ¸öÎÊÌ⣬ÏÖÔÚµÄLinuxÉè¼ÆÖн«ÑéÖ¤µÄ¹¤×÷½»¸øÐé´æÖеÄÓ²¼þÉ豸À´Íê³É¡£µ±ÏµÍ³Æô¶¯·ÖÒ³»úÖÆÒÔºó£¬Èç¹ûÒ»ÌõÖ¸ÁîµÄÐéÄâµØÖ·Ëù¶ÔÓ¦µÄÒ³¿ò£¨page frame£©²»ÔÚÄÚ´æÖлòÕß·ÃÎʵÄÀàÐÍÓдíÎ󣬾ͻᷢÉúȱҳÒì³£¡£´¦ÀíÆ÷°ÑÒýÆðȱҳÒì³£µÄÐéÄâµØÖ·×°µ½¼Ä´æÆ÷CR2ÖУ¬²¢Ìṩһ¸ö³ö´íÂ룬ָʾÒýÆðȱҳÒì³£µÄ´æ´¢Æ÷·ÃÎʵÄÀàÐÍ£¬Ëæºóµ÷ÓÃLinuxµÄȱҳÒì³£´¦Àíº¯Êý½øÐд¦Àí¡£¡¡¡¡¡¡¡¡LinuxÖнøÐÐȱҳÒì³£´¦ÀíµÄº¯ÊýÈçÏ£º¡¡¡¡¡¡¡¡¡¡¡¡asmlinkage void do_page_fault(strUCt pt_regs *regs, unsigned long error_code)¡¡¡¡{¡¡¡¡¡­¡­¡­¡­¡­¡­¡­¡­¡¡¡¡ __asm__("movl %%cr2,%0":"=r" (address));¡¡¡¡ ¡­¡­¡­¡­¡­¡­¡­¡­¡¡¡¡ vma = find_vma(mm, address);¡¡¡¡ if (!vma)¡¡¡¡ goto bad_area;¡¡¡¡ if (vma->vm_start <= address)¡¡¡¡ goto good_area;¡¡¡¡ if (!(vma->vm_flags & VM_GROWSDOWN))¡¡¡¡ goto bad_area;¡¡¡¡ if (error_code & 4) {¡¡¡¡ if (address + 32 < regs->esp)¡¡¡¡ goto bad_area;¡¡¡¡ ¡­¡­¡­¡­¡­¡­¡­¡­¡¡¡¡bad_area:¡¡¡¡ ¡­¡­¡­¡­¡­¡­¡­¡­¡¡¡¡no_context:¡¡¡¡ /* Are we prepared to handle this kernel fault?¡¡*/¡¡¡¡ if ((fixup = search_exception_table(regs->eip)) != 0) {¡¡¡¡ regs->eip = fixup;¡¡¡¡ return;¡¡¡¡ }¡¡¡¡ ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡¡¡¡}¡¡¡¡¡¡¡¡Ê×ÏÈÈÃÎÒÃÇÀ´¿´¿´´«¸øÕâ¸öº¯Êýµ÷ÓõÄÁ½¸ö²ÎÊý£ºËüÃǶ¼ÊÇͨ¹ýentry.SÔÚ¶ÑÕ»Öн¨Á¢µÄ£¨arch/i386/kernel/entry.S£©£¬²ÎÊýregsÖ¸Ïò±£´æÔÚ¶ÑÕ»ÖеļĴæÆ÷£¬error_codeÖдæ·Å×ÅÒì³£µÄ³ö´íÂ룬¾ßÌåµÄ¶ÑÕ»²¼¾Ö²Î¼ûͼһ£¨¶ÑÕ»µÄÉú³É¹ý³ÌÇë²Î¿¼¡¶LinuxÄÚºËÔ´´úÂëÇé¾°·ÖÎö¡·Ò»Ê飩¡¡¡¡ ¡¡¡¡¸Ãº¯ÊýÊ×ÏÈ´ÓCPUµÄ¿ØÖƼĴæÆ÷CR2ÖлñÈ¡³öÏÖȱҳÒì³£µÄÐéÄâµØÖ·¡£ÓÉÓÚȱҳÒì³£´¦Àí³ÌÐòÐèÒª´¦ÀíµÄȱҳÒì³£ÀàÐͺܶ࣬·ÖÖ§Ò²ºÜ¸´ÔÓ¡£»ùÓÚ±¾ÎĵÄÖ÷Ö¼£¬ÎÒÃÇÖ»¹ØÐÄÒÔϵļ¸ÖÖÄÚºËȱҳÒì³£´¦ÀíµÄÇé¿ö£º¡¡¡¡¡¡¡¡1£® ³ÌÐòÒª·ÃÎʵÄÄں˵ØÖ·¿Õ¼äµÄÄÚÈݲ»ÔÚÄÚ´æÖУ¬ÏÈÌøתµ½±êºÅvmalloc_fault£¬Èç¹ûµ±Ç°·ÃÎʵÄÄÚÈÝËù¶ÔÓ¦µÄҳĿ¼Ïî²»ÔÚÄÚ´æÖУ¬ÔÙÌøתµ½±êºÅno_context£»¡¡¡¡¡¡¡¡2£® ȱҳÒì³£·¢ÉúÔÚÖжϻòÕßÄÚºËÏß³ÌÖУ¬Ìøתµ½±êºÅno_context£»¡¡¡¡¡¡¡¡3£® ³ÌÐòÔÚºËÐÄ̬ÔËÐÐʱ·ÃÎÊÓû§¿Õ¼äµÄÊý¾Ý£¬±»·ÃÎʵÄÊý¾Ý²»ÔÚÄÚ´æÖС¡¡¡¡¡¡¡a) ³öÏÖÒì³£µÄÐéÄâµØÖ·ÔÚ½ø³ÌµÄij¸övmaÖУ¬µ«ÊÇϵͳÄÚ´æÎÞ·¨·ÖÅä¿ÕÏÐÒ³¿ò£¨page frame£©£¬ÔòÏÈÌøתµ½±êºÅout_of_memory£¬ÔÙÌøתµ½±êºÅno_context£»¡¡¡¡¡¡¡¡b) ³öÏÖÒì³£µÄÐéÄâµØÖ·²»ÊôÓÚ½ø³ÌÈÎÒ»¸övma£¬¶øÇÒ²»ÊôÓÚ¶ÑÕ»À©Õ¹µÄ·¶³ë£¬ÔòÏÈÌøתµ½±êºÅbad_area£¬×îÖÕÒ²Êǵ½´ï±êºÅno_context¡£¡¡¡¡¡¡¡¡´ÓÉÏÃæµÄÕ⼸ÖÖÇé¿öÀ´¿´£¬ÎÒÃǹØ×¢µÄ½¹µã×îºó¼¯Öе½±êºÅno_context´¦£¬¼´¶Ôº¯Êýsearch_exception_tableµÄµ÷Óá£Õâ¸öº¯ÊýµÄ×÷ÓþÍÊÇͨ¹ý·¢ÉúȱҳÒì³£µÄÖ¸Áî(regs->eip)ÔÚÒì³£±í£¨exception table£©ÖÐÑ°ÕÒÏÂÒ»Ìõ¿ÉÒÔ¼ÌÐøÔËÐеÄÖ¸Áî(fixup)¡£ÕâÀïÌáµ½µÄÒì³£±í°üº¬Ò»Ð©µØÖ·¶Ô£¬µØÖ·¶ÔÖеÄÇ°Ò»¸öµØÖ·±íʾ³öÏÖÒì³£µÄÖ¸ÁîµÄµØÖ·£¬ºóÒ»¸ö±íʾµ±Ç°Ò»¸öÖ¸Áî³öÏÖ´íÎóʱ£¬³ÌÐò¿ÉÒÔ¼ÌÐøµÃÒÔÖ´ÐеÄÐÞ¸´µØÖ·¡£¡¡¡¡¡¡¡¡Èç¹ûÕâ¸ö²éÕÒ²Ù×÷³É¹¦µÄ»°£¬È±Ò³Òì³£´¦Àí³ÌÐò½«¶ÑÕ»Öеķµ»ØµØÖ·£¨regs->eip£©Ð޸ijÉÐÞ¸´µØÖ·²¢·µ»Ø£¬Ëæºó£¬·¢ÉúÒì³£µÄ½ø³Ì½«°´ÕÕfixupÖа²ÅźõÄÖ¸Áî¼ÌÐøÖ´ÐÐÏÂÈ¥¡£µ±È»£¬Èç¹ûÎÞ·¨ÕÒµ½Óë֮ƥÅäµÄÐÞ¸´µØÖ·£¬ÏµÍ³Ö»ÓдòÓ¡³ö³ö´íÐÅÏ¢²¢Í£Ö¹ÔË×÷¡£¡¡¡¡¡¡¡¡ÄÇô£¬Õâ¸öËùνµÄÐÞ¸´µØÖ·ÓÖÊÇÈçºÎÉú³ÉµÄÄØ£¿ÊÇϵͳ×Ô¶¯Éú³ÉµÄÂ𣿴𰸵±È»ÊÇ·ñ¶¨µÄ£¬ÕâЩÐÞ¸´Ö¸ÁÊDZà³ÌÈËԱͨ¹ýasÌṩµÄÀ©Õ¹¹¦ÄÜд½øÄÚºËÔ´ÂëÖеġ£ÏÂÃæÎÒÃǾÍÀ´·ÖÎöÒ»ÏÂÆäʵÏÖ»úÖÆ¡£¡¡¡¡¡¡¡¡Òì³£±íµÄʵÏÖ»úÖÆ¡¡¡¡±ÊÕßÈ¡include/asm-i386/uAccess.hÖеĺ궨Òå__copy_user±àдÁËÒ»¶Î³ÌÐò×÷ΪÀý×Ó¼ÓÒÔ½²½â¡£¡¡¡¡/* hello.c */¡¡¡¡#include ¡¡¡¡#include ¡¡¡¡¡¡¡¡#define __copy_user(to,from,size) do { int __d0, __d1; __asm__ __volatile__( "0: rep; movsl\n" " movl %3,%0\n" "1: rep; movsb\n" "2:\n" ".section .fixup,\"ax\"\n" "3: lea 0(%3,%0,4),%0\n" " jmp 2b\n" ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" ¡¡¡¡¡¡¡¡ " .long 0b,3b\n" " .long 1b,2b\n" ".previous" : "=&c"(size), "=&D" (__d0), "=&S" (__d1) : "r"(s
[1] [2] ÏÂÒ»Ò³ 

£¨³ö´¦£ºhttp://www.sheup.com£©


ÉÏÒ»Ò³ [1] [2]