This is the mail archive of the binutils@sources.redhat.com 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]

NOLOAD, s-record and other questions


I use h8s 2633 in mode 6, with the following memory

MEMORY
{
       rom_vect : ORIGIN = 0x00000000, LENGTH = 1K
       rom      : ORIGIN = 1K,         LENGTH = 256K - 1K
       ext_ram  : ORIGIN = 0x00420000, LENGTH = 131072
       ram      : ORIGIN = 0x00FFB000, LENGTH = 16320
       ram1     : ORIGIN = 0x00FFFFC0, LENGTH = 64
}

OUTPUT_ARCH(h8300s)
SECTIONS
{
       .vects :
       {
       } > rom_vect
       .text :
       {
               *(.text)
               etext = .;
       } > rom
       .init :
       {
               *(.init)
       } > rom
       .fini :
       {
               *(.fini)
       } > rom
       .got :
       {
               *(.got)
               *(.got.plt)
       } > rom
       .rodata :
       {
               *(.rodata)
               *(.rodata.*)
               _erodata = .;
       } > rom
       .eh_frame_hdr :
       {
               *(.eh_frame_hdr)
       } > rom
       .eh_frame :
       {
               *(.eh_frame)
       } > rom
       .jcr :
       {
               *(.jcr)
       } > rom
       .tors :
       {
               __CTOR_LIST__ = .;
               ___ctors = .;
               *(.ctors)
               ___ctors_end = .;
               __CTOR_END__ = .;
               __DTOR_LIST__ = .;
               ___dtors = .;
               *(.dtors)
               ___dtors_end = .;
               __DTOR_END__ = .;
               _mdata = .;
       } > rom
       .external :
       {
               *(.external)
       } > ext_ram
       .data : AT (_mdata)
       {
               _data = .;
               *(.data)
               _edata = .;
       } > ram
       .gcc_exc :
       {
               *(.gcc_exc)
       } > ram
       .bss :
       {
               _bss = .;
               *(.bss)
               *(COMMON)
               _ebss = .;
               _end = .;
       } > ram
       .stack 0x00FFEFC0 :
       {
               _stack = .;
       }
}

as you can see I have 128KB of external sram located at 0x420000.

when I convert the elf output from linker into s-record (mot) format I
notice that in that mot file there are a lot of record s2 that refers
to the addresses in the exernal ram. All datas are 0.

To avoid this i tried the NOLOAD type in this way:
       .external (NOLOAD):
       {
               *(.external)
       } > ext_ram

using NOLOAD the external-ram addresses are no longer present in mot
file (and I think in the elf too), but I wonder if the NOLOAD has some
unwanted side effect.

I also found in the documentation the /DISCARD/ section name 
http://sources.redhat.com/binutils/docs-2.15/ld/Output-Section-Discarding.html#Output%20Section%20Discarding
but there is no example.
How is used and what are the effects of /DISCARD/ section name?

finally: I wonder if mot file produced from elf with obj-copy, could
have the addresses in the s1 or s2 record without an order.

All my mot file are sorted.
Since I'm writing an s-record file interpreter to program the micro
flash, I need to know if the s-record file specifications allows the
unsorted records s1, s2 or s3.

thanks

-- 
Massimiliano Cialdi
cialdi@gmail.com
m.cialdi@oksys.it


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