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 ...
随机推荐
- markdown的流程图实现和代码语法着色
用flowchart为markdown添加流程图 举个例子如下,根据这个例子大家就能看懂我到底是怎么实现的 <!DOCTYPE html> <html> <head> ...
- 测试浏览器对HTML5标签的支持
使用相应的浏览器打开链接 https://html5test.com/即可在该页面查看到测试结果.
- centos 编译lantrn
github上的安装指导: Custom fork of Go is currently required. We'll eventually switch to Go 1.7 which suppo ...
- nohup 让进程在后台可靠运行的几种方法
1. nohup nohup 无疑是我们首先想到的办法.顾名思义,nohup 的用途就是让提交的命令忽略 hangup 信号. nohup 的使用是十分方便的,只需在要处理的命令前加上 nohup 即 ...
- addEventListener在一个节点上添加多个相同的事件
<button id='btn'>attachEvent</button> window.onload=function(){ var Obtn = document.getE ...
- Linux 下终端 C 语言控制光标的技巧
// 清除屏幕 #define CLEAR() printf("\033[2J") // 上移光标 #define MOVEUP(x) printf("\033[%dA& ...
- 1、iptables-netfilter基础
.iptables: 包过滤型防火墙功能.四表五链 .iptables规则.规则管理工具.iptables命令 .iptables链管理.规则管理.查看等 .iptables匹配条件.目标.显式扩展. ...
- 消息队列之ActiveMQ简单环境搭建
准备: 环境:win7,Eclipse,jdk1.8 ActiveMQ版本:ActiveMQ 5.9.0 Release下载地址:http://activemq.apache.org/download ...
- 51nod 1055 最长等差数列
http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1055 题意: 思路:先固定一个位置,然后从该中心点出发向两边扫,确实很难 ...
- 33 Python 详解命令解析 - argparse--更加详细--转载
https://blog.csdn.net/lis_12/article/details/54618868 Python 详解命令行解析 - argparse Python 详解命令行解析 - arg ...