warning: allocated section `.data_nosave' not in segment

Segher Boessenkool segher at kernel.crashing.org
Tue Sep 29 10:29:31 EST 2009


> Here is the ld -M output for the "bad" compile:
>
> .data_nosave    0xc0376790      0x870 load address 0x00376790
>                 0xc0377000                . = ALIGN (0x1000)
>  *fill*         0xc0376790      0x870 00

Ah right.  Having the ALIGN() inside the output section causes the linker
to put some filler in there, which makes it a non-empty section, but this
section isn't assigned to a segment so you get a warning from the linker.

I think the proper way to do this is to not put the ALIGN() before the
output section, nor inside it, but _on_ it, like

.data_nosave : ALIGN(0x1000) { .... }


Segher



More information about the Linuxppc-dev mailing list