链接描述文件中*(.data),*(.data *)和*(.data.*)之间的差异 [英] Difference between *(.data), *(.data*) and *(.data.*) in linker script

查看:258
本文介绍了链接描述文件中*(.data),*(.data *)和*(.data.*)之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想知道这些构造之间的区别是什么(对于文本数据 rodata bss 等)在链接描述文件中:

Just curious to know what is the difference between such constructions (for text, data, rodata, bss etc) in linker script:

.data :
{
    *(.data)
}


.data :
{
    *(.data*)
}


.data :
{
    *(.data.*)
}

在所有情况下,我们都从所有目标文件中收集数据部分,但细节在于细节.

In all cases we gather data sections from all object files, but the devil is in the detail.

快速测试表明, map 文件中的地址不同,从而影响了可执行文件的大小.

Fast test showed that addresses in map file differ and in turn it influences the size of executable file.

我试图在 ld 中找到该信息文档,但什么也没发现(或只是错过了).

I tried to find the information in ld documentation but found nothing (or just missed it).

我想这应该是非常简单的事情(所谓的显而易见的).

I guess that it should be something very simple (so called obvious).

任何想法都将受到高度赞赏.

Any ideas will be highly appreciated.

推荐答案

在任何可以使用特定文件或节名称的地方,也可以使用通配符模式.

In any place where you may use a specific file or section name, you may also use a wildcard pattern.

它像常规模式一样工作

  • *(.data)-.data节,示例: .data
  • *(.data*)-.data *部分,示例: .dataTEST
  • *(.data.*)-.data.*部分,示例: .data.TEST
  • *(.data) - .data sections, Example: .data
  • *(.data*)- .data* section, Example: .dataTEST
  • *(.data.*) - .data.* section, Example: .data.TEST

在此处查找更多信息

这篇关于链接描述文件中*(.data),*(.data *)和*(.data.*)之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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