question about output section LMA
loody
miloody@gmail.com
Wed Nov 11 14:00:00 GMT 2009
Dear all:
when I link the script as I attached, the linker will complain that
.data section overlaps .rodata.str1.4 and .rodata.cst8 as below:
mips2_fp_le-ld -T ./link.xn -o TestCode.elf -Map TestCode.map
--oformat elf32-tradlittlemips init.o reset.o atexit.o -static
-nostdlib -L/media/sdb1/newlib-1.17.0/mipsel/newlib -lc
mips2_fp_le-ld: section .data [00000000800090c0 -> 00000000800093d7]
overlaps section .rodata.str1.4 [00000000800090c0 -> 0000000080009143]
mips2_fp_le-ld: section .rodata.cst8 [0000000080009148 ->
0000000080009197] overlaps section .data [00000000800090c0 ->
00000000800093d7]
but if I mark LMA part in .data section as below:
.data :
/* AT( _etext_init ) */
{
_fdata = ABSOLUTE(.); /* Start of initialised data */
*(.rodata)
*(.data)
. = ALIGN(8);
*(.lit8)
*(.lit4)
*(.sdata)
. = ALIGN(8);
_edata = ABSOLUTE(.); /* End of initialised data */
}
it will be fine.
from document, LMA is used to tell linker where it has to put the
following section, .data for my example, such that I can move it to
some place at later time. It will not effect the total length, content
or order of that section, right?
but why linker will tell me sections are overlapped when I use LMA?
If I am wrong, please let me know.
appreciate your help,
miloody
-------------- next part --------------
A non-text attachment was scrubbed...
Name: link.xn
Type: application/octet-stream
Size: 1188 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20091111/2504a99c/attachment.obj>
More information about the Binutils
mailing list