关于GRUB中boot.s源代码中"."的作用

boshaobb 2015-09-20 05:55:46
146. . = _start + GRUB_BOOT_MACHINE_BPB_START
147. . = _start + 4
请问此处的两个“.”是什么意思,有什么作用呢,查AT&T汇编好像没有定义。谢谢了
...全文
90 4 点赞 打赏 收藏 举报
写回复
4 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
nswcfd 2015-09-21
这不是汇编指令吧?这是ld script的语法。 info ld ile: ld.info, Node: Location Counter, Next: Operators, Prev: Orphan Sections, Up: Expressions 3.10.5 The Location Counter --------------------------- The special linker variable "dot" `.' always contains the current output location counter. Since the `.' always refers to a location in an output section, it may only appear in an expression within a `SECTIONS' command. The `.' symbol may appear anywhere that an ordinary symbol is allowed in an expression.
  • 打赏
  • 举报
回复
nswcfd 2015-09-21
两个上下文都是当前位置的意思,搞混了,不好意思。
  • 打赏
  • 举报
回复
nswcfd 2015-09-21
不好意思,猜错了,那就info as. File: as.info, Node: Dot, Next: Symbol Attributes, Prev: Symbol Names, Up: Symbols 5.4 The Special Dot Symbol ========================== The special symbol `.' refers to the current address that `as' is assembling into. Thus, the expression `melvin: .long .' defines `melvin' to contain its own address. Assigning a value to `.' is treated the same as a `.org' directive. Thus, the expression `.=.+4' is the same as saying `.space 4'.
  • 打赏
  • 举报
回复
boshaobb 2015-09-21
jmp LOCAL(after_BPB) nop . = _start + GRUB_BOOT_MACHINE_BPB_START . = _start + 4 但他前面和后面都有汇编语句。哪编译器会怎样处理这两条语句呢?
  • 打赏
  • 举报
回复
相关推荐
发帖
Linux_Kernel
创建于2007-08-27

4156

社区成员

Linux/Unix社区 内核源代码研究区
申请成为版主
帖子事件
创建了帖子
2015-09-20 05:55
社区公告
暂无公告