This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

I have a problem.. help..



  Hi.
  I can't find where to post this mail.
  If I have wrong, sorry. but please help me.
  I am novice in using GNU tools.
  And I have a linkage problem.
  As I read at Ld info page, I have defined LMA using
  ld script command below. I checked final elf
  object using "objdump -h". The result is that VMA
  is equal to LMA. I converted final elf object file
  to s-record format using "objcopy -O srec final.o final.hex"
  In that final.hex, s-record address is started from 0x00010000.
  After a block started from 0x00010000, a block started from
  0xfff00000 existed. In map file, I can see the message that
  load address of .data output section is 0xfff13600".

  And I have ld warning messages below. What is the meaning..
      "powerpc-linux-ld: warning: no memory region specified for section
`.data'"
      "powerpc-linux-ld: bug860.o: warning: allocated section `.text'
not in segment"

  Woo-Seung, Yeo
  wsyeo@dmc.htc.hanwha.co.kr

  Here is ld command.
=======================
powerpc-linux-ld -T rom.ld -Map bug860.map -o bug860.o \
   --start-group <object files...> ./stubs/libstub.a -lc --end-group


  Here is output of objdump.
=======================
  6 .data         00001650  00010000  00010000  00040000  2**4
                  CONTENTS, ALLOC, LOAD, DATA
  9 .sdata        00000040  00011c38  00011c38  00041c38  2**3
                  CONTENTS, ALLOC, LOAD, DATA


  Here is map file output.
=======================
    .
    .
.sdata2         0xfff13600        0x0
 *(.sdata2)
                0x00010000                .=0x10000

.data           0x00010000     0x1650 load address 0xfff13600
 *(.data)
    .
    .
.sdata          0x00011c38       0x40 load address 0xfff14c50
 *(.sdata)
    .
    .


  Here is ld script file.
=======================

OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
              "elf32-powerpc")
OUTPUT_ARCH(powerpc)
ENTRY(_start)

MEMORY
{
    rom (rx) :   org = 0xFFF00000, len = 0x000FFFF0
    ram (!rx) :   org = 0x00010000, len = 0x0000FFF0
}

PHDRS
{
 headers PT_PHDR PHDRS ;
 interp PT_INTERP ;
 text PT_LOAD FILEHDR PHDRS ;
 data PT_LOAD ;
 dynamic PT_DYNAMIC ;
}

SECTIONS
{
 /* . = 0xFFF00000 + SIZEOF_HEADERS; */
 . = 0xFFF00000;
 .text : { *(.text) } = 0
 .init : { *(.init) } = 0
 .fini : { *(.fini) } = 0
 .eini : { *(.eini) } = 0
 .rodata : { *(.rodata) }
 .sdata2 : { *(.sdata2) }
 _etext = .;

 . = 0x00010000;
 .data  : AT ( ADDR (.sdata2) + SIZEOF (.sdata2) ) { *(.data) }
 .sdata : AT ( ADDR (.sdata2) + SIZEOF (.sdata2) + SIZEOF (.data) ) {
*(.sdata) }
 .sbss  : { *(.sbss) }
 .bss   : { *(.bss) *(COMMON) }
 _end = .;
}

__HEAP_START    = ADDR(.bss) + SIZEOF(.bss);
__SP_INIT       = 0x10000 + 0xFFF0 - 4; /* save 4 bytes for memtest4 */
__HEAP_END      = __SP_INIT - 0x1000;
__SP_END        = __HEAP_END;
__DATA_ROM      = ADDR(.sdata2) + SIZEOF(.sdata2);
__DATA_RAM      = ADDR(.data);
__DATA_END      = ADDR(.sdata) + SIZEOF(.sdata);
__BSS_START     = ADDR(.sbss);
__BSS_END       = ADDR(.bss) + SIZEOF(.bss);

/* special equates for monitor memory/stack overflow checking */
__TEXT_START = ADDR(.text);
__TEXT_END = ADDR(.text)+SIZEOF(.text);


  LD warning message
=======================
powerpc-linux-ld: warning: no memory region specified for section
`.data'
powerpc-linux-ld: warning: no memory region specified for section
`.fixup'
powerpc-linux-ld: warning: no memory region specified for section
`.got2'
powerpc-linux-ld: warning: no memory region specified for section
`.sdata'
powerpc-linux-ld: warning: no memory region specified for section
`.sbss'
powerpc-linux-ld: warning: no memory region specified for section `.bss'

powerpc-linux-ld: bug860.o: warning: allocated section `.text' not in
segment
powerpc-linux-ld: bug860.o: warning: allocated section `.init' not in
segment
powerpc-linux-ld: bug860.o: warning: allocated section `.fini' not in
segment
powerpc-linux-ld: bug860.o: warning: allocated section `.rodata' not in
segment
powerpc-linux-ld: bug860.o: warning: allocated section `.sdata2' not in
segment
powerpc-linux-ld: bug860.o: warning: allocated section `.data' not in
segment
powerpc-linux-ld: bug860.o: warning: allocated section `.fixup' not in
segment
powerpc-linux-ld: bug860.o: warning: allocated section `.got2' not in
segment
powerpc-linux-ld: bug860.o: warning: allocated section `.sdata' not in
segment
powerpc-linux-ld: bug860.o: warning: allocated section `.sbss' not in
segment
powerpc-linux-ld: bug860.o: warning: allocated section `.bss' not in
segment




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