This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

question about output section LMA


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

Attachment: link.xn
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]