a gcc 4.2.4 bug(被stos指令累加后%edi作为参数的)

*
 * Ok, now we can initialize the rest of the tty devices and can count
 * on memory allocations, interrupts etc..
 */
int tty_init(void)
{
    if (sizeof(struct tty_struct) > PAGE_SIZE)
        panic("size of tty structure > PAGE_SIZE!");

/*
     * dev_tty_driver and dev_console_driver are actually magic
     * devices which get redirected at open time.  Nevertheless,
     * we register them so that register_chrdev is called
     * appropriately.
     */
    memset(&dev_tty_driver, 0, sizeof(struct tty_driver));
    dev_tty_driver.magic = TTY_DRIVER_MAGIC;
    dev_tty_driver.name = "tty";
    dev_tty_driver.name_base = 0;
    dev_tty_driver.major = TTY_MAJOR;
    dev_tty_driver.minor_start = 0;
    dev_tty_driver.num = 1;
    
    if (tty_register_driver(&dev_tty_driver))
        panic("Couldn't register /dev/tty driver\n");
        
        
(gdb) disassemble
Dump of assembler code for function tty_init:
0x0013ff5c <tty_init+0>:    push   %edi
0x0013ff5d <tty_init+1>:    sub    $0x14,%esp
0x0013ff60 <tty_init+4>:    mov    $0x16bb40,%edi
0x0013ff65 <tty_init+9>:    xor    %eax,%eax
0x0013ff67 <tty_init+11>:    mov    $0x27,%ecx
0x0013ff6c <tty_init+16>:    cld    
0x0013ff6d <tty_init+17>:    rep stos %eax,%es:(%edi)
0x0013ff6f <tty_init+19>:    movl   $0x5402,0x16bb40
0x0013ff79 <tty_init+29>:    movl   $0x1567ed,0x16bb44
0x0013ff83 <tty_init+39>:    movl   $0x0,0x16bb48
0x0013ff8d <tty_init+49>:    movw   $0x4,0x16bb4c
0x0013ff96 <tty_init+58>:    movw   $0x0,0x16bb4e
0x0013ff9f <tty_init+67>:    movw   $0x1,0x16bb50
0x0013ffa8 <tty_init+76>:    push   %edi
0x0013ffa9 <tty_init+77>:    call   0x13fec4 <tty_register_driver>

注:%edi被stos又作为tty_register_driver参数,显然不对,这应该是gcc 4.2.4的bug

a gcc 4.2.4 bug(被stos指令累加后%edi作为参数的)的更多相关文章

  1. rep stos dword ptr es:[edi]

    本文链接:https://blog.csdn.net/ypist/article/details/8467163今天读代码时,忽然跳出如下一条指令==>>汇编代码: rep stos dw ...

  2. stos指令

    mov ecx,30mov eax,0cccccccchrep stos dword prt es:[edi]stos指令,它的功能是将eax中的数据放入的edi所指的地址中,同时,edi会增加4个字 ...

  3. rep stos ptr dword es:[edi]

    今天读代码时,忽然跳出如下一条指令==>>汇编代码: rep stos dword ptr es:[edi] 在网上查了相关资料显示:/************************** ...

  4. rep stos 指令(Intel汇编)

    今天读代码时,忽然跳出如下一条指令==>> 汇编代码: rep stos dword ptr es:[edi] 在网上查了相关资料显示: /************************ ...

  5. gcc limits.h的bug定位看include_next和默认搜索路径

    手编的交叉编译工具链经常报一堆宏未定义,例如下面是编译gtest的时候报_POSIX_PATH_MAX宏未定义,有时还会上报SSIZE_MAX等宏未定义: googletest/src/gtest-f ...

  6. [Bug FIX]安装 account_check_writing模块后采购收据打印报错的问题

    大写金额没填报错 修改:report_check.xml文件,把<span t-esc="fill_stars(o.amount_in_word)"/>一行替换为 &l ...

  7. 微信公共平台注册 bug: 验证码不应该输入后,就立即检查其有效性

    本文链接: https://www.cnblogs.com/hchengmx/p/10793037.html 刚刚想注册个微信公众号,就发现了这个问题,在这里记录一下. 已经发到testhome了,链 ...

  8. 翻页bug 在接口文档中应规范参数的取值区间

    <?php$a=array("red","green","blue","yellow","brown&q ...

  9. 翻页bug 在接口文档中应规范参数的取值区间 接口规范

    <?php$a=array("red","green","blue","yellow","brown&q ...

随机推荐

  1. Python3 tkinter基础 Listbox Scrollbar 创建垂直滚动条

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  2. Python3基础 list in/not in 判断一个变量是否在列表中存在

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  3. CentOS 安装 Redis 笔记

    Redis 安装 yum install redis -y 在启动 redis-server 之前,你需要修改配置文件/etc/redis.conf: 找到 bind 127.0.0.1,将其注释,这 ...

  4. FJUT 聪明的商人(树上倍增)题解

    思路:求树上两点的距离,显然是dep[u] + dep[v] - 2 * dep[lca],用树上倍增去写. 参考:树上倍增的写法和应用(详细讲解,新手秒懂) 代码: #include<set& ...

  5. (转)mblog解读(二)

    (二期)12.开源博客项目mblog解读(二) [课程12]freema...模板.xmind77.9KB [课程12]hibernat...arch.xmind0.1MB freemarker模板技 ...

  6. P3159 [CQOI2012]交换棋子

    思路 相当神奇的费用流拆点模型 最开始我想到把交换黑色棋子看成一个流流动的过程,流从一个节点流向另一个节点就是交换两个节点,然后把一个位置拆成两个点限制流量,然后就有了这样的建图方法 S向所有初始是黑 ...

  7. 给大家分享两套WordPress收费主题

    主题一:No.7 – 极简 by 大当家 1.主题网址:http://qzhai.net/2016-03-546.html 2.主题预览:http://qzhai.net/000/?theme=No. ...

  8. Ubuntu下codeblocks不能自动缩进的问题

    如果在codeblocks中设置了自动缩进但是没有效果的话,在终端中执行sudo apt-get install codeblocks-contrib命令.

  9. JS相关重点知识 (概况)

    1.value和innerHTML没有联系,只是value是表单的一个特有属性,而innerHTML是通用的. 2.当从外部引入js文件时,该外部文件里面可以有多个方法,   html页面中的oncl ...

  10. 【Python】【IO】

    # [[IO]] # [文件读写] '''读写文件是最常见的IO操作.Python内置了读写文件的函数,用法和C是兼容的.读写文件前,我们先必须了解一下,在磁盘上读写文件的功能都是由操作系统提供的,现 ...