Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我刚刚看到一个带有 =0 的部分定义,即
.init : { KEEP (*(.init)) } =0
最后那个=0是什么意思,它的意义是什么?
我刚刚发现,在节定义末尾的=0指定了填充表达式,即该节中任何未使用的内存都将用值 0 填充,必要时重复。这种未使用内存的一个例子是由于输入部分的对齐要求而留下的间隙。此初始化不必为 0,我们可以使用任何数字或有效的 LD 表达式来填充未使用的内存。