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 ...
随机推荐
- uniGUI出新版本了,0.97.0.1081
uniGUI出新版本了,0.97.0.1081,试用版0.97.0.1075,支持Delphi2006~XE7.下载地址是: http://www.unigui.com/downloads 已在XE6 ...
- Python3 tkinter基础 Button command 单击按钮 在console中打印文本
Python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 Conda ...
- bzoj1566: [NOI2009]管道取珠 DP
题目链接 https://www.lydsy.com/JudgeOnline/problem.php?id=1566 思路 n个球,第i个球颜色为ai,对于颜色j,对答案的贡献为颜色为j的球的个数的平 ...
- loj#2305. 「NOI2017」游戏 2-sat
链接 https://loj.ac/problem/2305 https://www.luogu.org/problemnew/show/P3825 思路 3-sat神马的就不要想了,NP问题 除去x ...
- 洛谷1968美元汇率 dp
P1968 美元汇率 dp 题目描述 在以后的若干天里戴维将学习美元与德国马克的汇率.编写程序帮助戴维何时应买或卖马克或美元,使他从100美元开始,最后能获得最高可能的价值. 输入输出格式 输入格式: ...
- hosts文件介绍
在Window系统中有个Hosts文件(没有后缀名),在Windows98系统下该文件在Windows目录,在Windows2000/XP系统中位于C:\Winnt\System32\Drivers\ ...
- facebook api之Access Tokens
Access Tokens When someone connects with an app using Facebook Login and approves the reqest for per ...
- Codeforces-Anastasia and pebbles
这是一道很有意思的(水)题. 地址戳:http://codeforces.com/problemset/problem/789/A 题目的大意呢,就是一个可爱的大姐姐的故事.说是啊,她每天都带着两个一 ...
- MVC ---- 怎删改查
using Modelsop; using System; using System.Collections.Generic; using System.Linq; using System.Web; ...
- select2 使用方法总结
官网:http://select2.github.io/ 调用 <link href="~/Content/select2.min.css" rel="styles ...