a gcc 4.2.4 bug(被stos指令累加后%edi作为参数的)
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作为参数的)的更多相关文章
- rep stos dword ptr es:[edi]
本文链接:https://blog.csdn.net/ypist/article/details/8467163今天读代码时,忽然跳出如下一条指令==>>汇编代码: rep stos dw ...
- stos指令
mov ecx,30mov eax,0cccccccchrep stos dword prt es:[edi]stos指令,它的功能是将eax中的数据放入的edi所指的地址中,同时,edi会增加4个字 ...
- rep stos ptr dword es:[edi]
今天读代码时,忽然跳出如下一条指令==>>汇编代码: rep stos dword ptr es:[edi] 在网上查了相关资料显示:/************************** ...
- rep stos 指令(Intel汇编)
今天读代码时,忽然跳出如下一条指令==>> 汇编代码: rep stos dword ptr es:[edi] 在网上查了相关资料显示: /************************ ...
- gcc limits.h的bug定位看include_next和默认搜索路径
手编的交叉编译工具链经常报一堆宏未定义,例如下面是编译gtest的时候报_POSIX_PATH_MAX宏未定义,有时还会上报SSIZE_MAX等宏未定义: googletest/src/gtest-f ...
- [Bug FIX]安装 account_check_writing模块后采购收据打印报错的问题
大写金额没填报错 修改:report_check.xml文件,把<span t-esc="fill_stars(o.amount_in_word)"/>一行替换为 &l ...
- 微信公共平台注册 bug: 验证码不应该输入后,就立即检查其有效性
本文链接: https://www.cnblogs.com/hchengmx/p/10793037.html 刚刚想注册个微信公众号,就发现了这个问题,在这里记录一下. 已经发到testhome了,链 ...
- 翻页bug 在接口文档中应规范参数的取值区间
<?php$a=array("red","green","blue","yellow","brown&q ...
- 翻页bug 在接口文档中应规范参数的取值区间 接口规范
<?php$a=array("red","green","blue","yellow","brown&q ...
随机推荐
- c++map用法
#include<iostream> #include<algorithm> #include<map> using namespace std; void fun ...
- SpringBoot 解决HttpServletRequest只能读取一次
业务逻辑,通过filter读取请求的request,获取token,并将token传递后面流程使用 BodyReaderHttpServletRequestWrapper: public class ...
- BZOJ4893: 项链分赃 && BZOJ4895: 项链分赃(增强版)
Solution 神仙题.jpg 切一刀简单啊,维护一个前缀和. 切两刀简单啊,拿个队列维护中间那一段. 切三刀,这tm什么毒瘤题. 于是打开题解:"保证不会答案不会超过宝石种类" ...
- GC 垃圾收集
算法: 没有使用引用计数算法.使用的是GC Roots 可达性算法. 复制算法:新生代,老年代. 标记-整理算法:一般会对对象标记几次才会清理掉.然后从新整理物理内存空间. 分代收集算法:更加对象存活 ...
- Docker save & load
docker save Estimated reading time: 1 minute Description Save one or more images to a tar archive (s ...
- python时间
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import time import datetime line="Wed 11/2 ...
- Jdk在window环境下的安装与配置详解
本文为博主原创,转载请注明出处: 1.2 Java程序开发环境的配置 java开发工具包:java开发工具:记事本 IDE,这个只能写小程序,写大程序需要集成开发工具:反编译工具(我们可以在网上找一 ...
- 2、Python函数详解(0601)
函数的基础概念 1.函数是python为了代码最大程度的重用和最小化代码冗余而提供的基本程序结构: 2.函数是一种设计工具,它能让程序员将复杂的系统分解为可管理的部件: 3.函数用于将相关功能打包并参 ...
- Create and format Word documents using R software and Reporters package
http://www.sthda.com/english/wiki/create-and-format-word-documents-using-r-software-and-reporters-pa ...
- 转 lightmap
小记一下用法与问题,时更 surface shader就不用操心了,自带lightmap计算 主要是vertex fragment shader部分 Unity5 bake light map有三种情 ...