I just saw a section 开发者_开发技巧definition with =0 at the end i.e
.init :
{
KEEP (*(.init))
} =0
What does that =0 at the end means and what is its significance?
I just found out that =0 at the end of the section definition specifies the fill expression i.e any unused memory within this section will be filled with the value 0, repeated as necessary. An example of such unused memory is gaps left due to alignment requirements of input sections. This initialization doesn't have to be 0, we can use any number or valid LD expression to fill the unused memory.
精彩评论