I'm a newb with #GNU #binutils linker scripts, and am confused why
. = ALIGN((1<<LOG2CEIL(.-__logical_binary_start))/8);
.data : {
…
allows `.data` to be *before* the value that `.` gets set to; `ld --print-map` shows:
.rel.dyn 0x20007104 0x0
.rel.iplt 0x20007104 0x0 CMakeFiles/vpu_objs.dir/vpu.c.o
0x20008000 . = ALIGN (((0x1 << LOG2CEIL ((. - __logical_binary_start))) / 0x8))
.data 0x20007110 0x5dc
0x20007110 __data_start__ = .
I see how it gets 0x20007110 from 0x20007104--an input section in .data has alignment of 16. But I don't understand why it ignores the 0x20008000?
I can make it do what I want by doing
.data ALIGN((1<<LOG2CEIL(.-__logical_binary_start))/8) : {
but I'd like to understand why setting `.` doesn't do what I want.

Hacker News