什么包含.foo:{(。*)*}意味着链接脚本? [英] What does .foo : { *(.*) } mean in a linker script?

查看:135
本文介绍了什么包含.foo:{(。*)*}意味着链接脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一个启动程序,它是512个字节,我要坚持的0xAA55将在最后2个字节我的512字节编程形象。所以我做到了。现在我的链接脚本,应该是pretty简单。我只是好奇,什么这个语法手段

I'm writing a bootable program that is 512 bytes, and I have to stick the 0xAA55 in the last 2 bytes of my 512 byte program image. So I've done that. Now my linker script, should be pretty simple. I was just curious about what this syntax means

.foo : { *(.*) }

我得到了它作为一个例子。没有.foo段,而在这之前,我改变了程序计数器

I was given it as an example. There is no .foo section, and before that, I change the program counter to

. = 0x1000 //To account for the elf header which I will strip later

所以经过这个指令

So after this directive is

.foo : { *(.*) }

这是什么呢?

推荐答案

它存储在第包含.foo 所有code,数据,BSS,rodata,等等(第二个 * 从所有目标文件(第一个)* )的尚未分配给任何previously定义的部分。

It stores in section .foo all code, data, bss, rodata, etcetera (the second *) from all object files (the first *) that aren't yet assigned to any previously defined section.

这篇关于什么包含.foo:{(。*)*}意味着链接脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆