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 ...
随机推荐
- CentOS Yum 源搭建
创建yum源服务,主要用到了两个软件createrepo和httpd.前者是创建yum源索引的工具,后者是提供文件在线流浪的功能,当然,除了httpd之外,你也可以使用nginx替代. creater ...
- SpringBoot 使用validation数据校验
后端对数据进行验证 添加包 hibernate-validator <!-- https://mvnrepository.com/artifact/org.hibernate.validator ...
- HDU 5607 graph(矩阵乘法)
题意 在一个 \(n\) 个节点 \(m\) 条边的有向图上随机游走,有 \(Q\) 个询问,每次给定一个起点 \(u\) 和步数 \(K\) ,每次回答最后停在每个节点的概率. \(1 \leq n ...
- Using git-flow to automate your git branching workflow
Using git-flow to automate your git branching workflow Vincent Driessen’s branching model is a git b ...
- Kubernetes工作流之Pods二
Init Containers This feature has exited beta in 1.6. Init Containers can be specified in the PodSpec ...
- Linux命令2——b
badblocks:检查磁盘设备中损坏的区块 -b:指定磁盘的区块大小,单位:字节 -c:一次检查几个区块 -i:由文件总读取已知的损坏区块,检查时会忽略这些区块 -o:检查的结果写入指定的输出文件. ...
- ARM MOV PC加8
缘由 今天在分析ARM伪指令ADR,书上说ADR通常会被一条ADD或SUB指令替代实现相同功能.我反汇编了一下确实如此会基于PC相对偏移的地址量读取到寄存器中,可是计算却发现对不上 如上图所示,ADR ...
- windows特殊文件或文件夹
考了很多文章,搜集了很多资料整理而成.好的用途可以用来隐藏个人资料,防止误删,病毒免疫等等.至于坏的方面,当然也可用来隐藏木马等等,就看你怎么用了.还有一个没有搞明白,资料上也没找到,请知道的指点一下 ...
- dhcp、tftp及pxe简介
DHCP: 全称:Dynamic Host Configuration Protocol 动态主机配置协议 DHCP配置内容: IP/Netmask Gateway DNS Server bootp ...
- Leetcode_Easy_14
编写一个函数来查找字符串数组中的最长公共前缀. 如果不存在公共前缀,返回空字符串 "". class Solution { public String longestCommonP ...