This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos 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]

Why .text section does not change while changin the target.ld file?thanks (linker script problem)


Hi all:
   First the target.ld file looks like:

     .fixed_vectors  0x20 :        {  . = .; KEEP (*(.fixed_vectors)) }
> ram
     .rom_vectors  0x2f000 :        { __rom_vectors_vma = ABSOLUTE(.);
. = .; KEEP (*(.vectors)) }     > ram     __rom_vectors_lma =
LOADADDR(.rom_vectors);
     .text  0x2ff00 :        { _stext = ABSOLUTE(.);     PROVIDE (__stext =
ABSOLUTE(.));     *(.text*) *(.gnu.warning) *(.gnu.linkonce.t.*) *(.init)
*(.glue_7) *(.glue_7t)      } > ram     _etext = .; PROVIDE (__etext = .);
     .fini  ALIGN (0x4) :        {  . = .; *(.fini) }     > ram


when compile the app with arm-elf-gcc -g -I/ecoswork/xxx_install/include
hello.c -L/ecoswork/xxx_install/lib -Ttarget.ld -nosdtlib

arm-elf-objdump -h  a.out

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         000103c0  00030000  00030000  00008000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .fini         00000000  000403c0  000403c0  00019398  2**0
                  CONTENTS

 13 .fixed_vectors 00000140  00000020  00000020  0012a3e0  2**5
                  CONTENTS
 14 .rom_vectors  00000040  0002f000  0002f000  00007000  2**0
                  CONTENTS, ALLOC, LOAD, CODE
 15 .fixup        00000000  0002f040  0002f040  0012a520  2**0
                  CONTENTS


why here .text section is 0x30000 not the one set in the target.ld file
0x2ff00? and rom_vectors is 0x2f000 is the same as in target.ld .


when I change the target.ld file as:

     .debug_aranges  0 : { *(.debug_aranges) }       .debug_pubnames 0 : {
*(.debug_pubnames) }      .debug_info     0 : { *(.debug_info) }
.debug_abbrev   0 : { *(.debug_abbrev) }        .debug_line     0 : {
*(.debug_line) }          .debug_frame    0 : { *(.debug_frame) }
.debug_str      0 : { *(.debug_str) }           .debug_loc      0 : {
*(.debug_loc) }           .debug_macinfo  0 : { *(.debug_macinfo) }
     .fixed_vectors  0x20 :        {  . = .; KEEP (*(.fixed_vectors)) }
> ram
     .rom_vectors  0x2f000 :        { __rom_vectors_vma = ABSOLUTE(.);
. = .; KEEP (*(.vectors)) }     > ram     __rom_vectors_lma =
LOADADDR(.rom_vectors);
     .text  0x500000 :        { _stext = ABSOLUTE(.);     PROVIDE (__stext =
ABSOLUTE(.));     *(.text*) *(.gnu.warning) *(.gnu.linkonce.t.*) *(.init)
*(.glue_7) *(.glue_7t)      } > ram     _etext = .; PROVIDE (__etext = .);
     .fini  ALIGN (0x4) :        {  . = .; *(.fini) }     > ram


after compiling by arm-elf-gcc xxxxx

arm-elf-objdump -h output:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         000103c0  00030000  00030000  00008000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .fini         00000000  000403c0  000403c0  00019398  2**0
                  CONTENTS
  2 .rodata       00000514  000403c0  000403c0  000183c0  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .rodata1      00000000  000408d4  000408d4  00019398  2**0

.text section still at 0x30000 why? even when I set it to 0x00 but the
section information output is still 0x30000 always, why?

Thanks a lot




-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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