What does this error means?
section .data can't be allocated in segment 2
This is for a bare metal GCC cross toolchain for Xtensa. I feel that this has nothing to do with the segment size.
What does this error means?
section .data can't be allocated in segment 2
This is for a bare metal GCC cross toolchain for Xtensa. I feel that this has nothing to do with the segment size.
The SECTIONS command tells the linker how to map input sections into output sections, and how to place the output sections in memory. The format of the SECTIONS command is:
SECTIONS
{
sections-command
sections-command
...
}
We can include explicit bytes of data in an output section by using BYTE, SHORT, LONG, QUAD, or SQUAD as an output section command.
When using a 64 bit host or target, QUAD and SQUAD are the same; they both store an 8 byte, or 64 bit, value. When both host and target are 32 bits, an expression is computed as 32 bits. In this case QUAD stores a 32 bit value zero extended to 64 bits, and SQUAD stores a 32 bit value sign extended to 64 bits.
If the object file format of the output file has an explicit endianness, which is the normal case, the value will be stored in that endianness. When the object file format does not have an explicit endianness, as is true of, for example, S-records, the value will be stored in the endianness of the first input object file.
Note—these commands only work inside a section description and not between them, so the following will produce an error from the linker:
SECTIONS { .text : { *(.text) } LONG(1) .data : { *(.data) } }
whereas this will work:
SECTIONS { .text : { *(.text) ; LONG(1) } .data : { *(.data) } }
I hope now you can work out with your error!!!