关于静态链接程序的 MMU 和 gcc 的默认链接器文件

Regarding MMU and default linker file of gcc for statically linked programs

这是引用自 ARM ARM® Cortex™-A 系列,版本:4.0,程序员指南,第 9-1 页。

"The MMU enables tasks or applications to be written in a way that requires them to have no knowledge of the physical memory map of the system, or about other programs that might be running simultaneously."

我的问题与我们通过 gcc 编译的 linux 程序有关。我不想进行动态 linking,所以请考虑程序是静态 linked。 我曾经是一名嵌入式系统程序员,大多数情况下我们只有一个 linker 文件用于整个项目。基于 linker 文件 code/data 被放入 RAM。 但是如果 Linux 当我编译和 link 使用 gcc 的任何 c 应用程序(静态 linked),我不提供任何 linker 文件。

问题是 Linux 如何决定 place/load 我的程序在内存中的位置。它是否具有适用于所有应用程序的默认 linker 文件?

当然,GNU LD 有默认的链接描述文件。你甚至可以看到它。只需供应

-Wl,--verbose

到您的 GCC 命令行。