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. Eclipse中一个项目调用另一个项目的资源

    如果一个项目A想要引用另一个项目B的资源的话,按照一下步骤进行设置: 右键点击项目A---->>>Build Path--->>>Configure Build P ...

  2. oracle a:=100 和 b=:c 区别

    a:=100  是赋值语句 b=:c  :c是一个整体,表示一个参数.

  3. Nginx 基础知识学习

    资料 基础 掘金-前端开发者必备的Nginx知识 介绍的比较综合,正向代理反向代理的区别.负载均衡等知识,都有介绍 静默虚空-Nginx 简易教程 博客园上的一篇推荐文章 简书-全面了解Nginx到底 ...

  4. 关于link标签的用法, 不声明rel=stylesheet则无效? 在ff中必须声明rel属性!

    void 无效的, 空的; invalid: 无效的, void 和 invalid 在表示无效的时候, 是一样的, 等同的 the treaty (条约) was declared invalid ...

  5. 算法总结(转自CS-Notes)

    转载地址: 注意要点: 1.希尔排序:实际是将元素按步距h分为几组,每组元素没有关系,是组里每个元素跨步距h得到的一组元素是有序的,那么剩下的问题就是组内有序,再处理好组间边界即可.实际解决的方式是不 ...

  6. 查看kubernets上的image信息

    # 查看pods所使用的image kubectl describe pods $podsname -n $namespace #获取containers.$containername.image i ...

  7. 在C#中理解和实现策略模式的绝对入门教程

    介绍 本文的目的是理解战略模式的基础知识,并试图了解何时可以使用,并有一个基本的实现,以便更好地理解.在现实世界的应用中,这是无法实施战略模式的,所采用的例子也远没有实际可行.这篇文章的想法只是为了说 ...

  8. HDU 4859 海岸线(最小割+最大独立点权变形)

    http://acm.hdu.edu.cn/showproblem.php?pid=4859 题意: 欢迎来到珠海!由于土地资源越来越紧张,使得许多海滨城市都只能依靠填海来扩展市区以求发展.作为Z市的 ...

  9. 聚类算法——KMEANS算法

    聚类概念 无监督问题:我们手里没有标签 聚类:相似的东西分到一组 难点:如何评估,如何调参 基本概念 要得到簇的个数,需要指定K值 质心:均值,即向量各维取平均即可 距离的度量:常用欧几里得距离和余弦 ...

  10. Node前后端分离基本概括

    首先从一个重要的概念“模板”说起. 广义上来说,web中的模板就是填充数据后可以生成文件的页面. 严格意义上来说,应该是模板引擎利用特定格式的文件和所提供的数据编译生成页面.模板大致分为前端模板(如e ...