I am using the GNU linker script in which the bss sections variables are getting non 4 byte aligned address and this is big problem as the variable address is being used by hardware,which needs word aligned address.
Instead of using align attribute of single one of them, lets if I have 10 variables or I would like to have linker generate word aligned address for each variables in a particular section how can I do it ?
I have tried using ALIGN() with no effect.
This is the example:
.bss.a 9cdf8 0x1
.bss.b 9cdf9 0x1
For .bss.b I would like to to get 0x9cdf8 + 4 and so for all the variables.
How can I achieve this ?
SORT_BY_ALIGNMENT,SORT_BY_NAME, alternatively you can specify each file..bss { foo.o(.bss); . = ALIGN(4); bar.o(.bss); }. TheALIGNjust aligns the current output address. - artless noise