ALIGN in Linker Scripts

后端 未结 3 981
梦如初夏
梦如初夏 2021-02-04 05:12

What does the ALIGN keyword do in linker scripts? I read many tutorials about linker scripts but I cant understand what really ALIGN do. Can any one explain it simply. Thanks!

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-04 06:05

    . = ALIGN(8)

    Corresponds to the following (working link script example using operators):

    data = .;
    
    . = ((data + 0x8 - 1) & ~(0x8 - 1)) - data;
    

提交回复
热议问题