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]

Linker script for H8.


Hi,

Can I submit a patch to somehow incorporate new names for data
sections in the linker scripts for the h8300 port?  Namely one for the
beginning of data section initial data and another one for the
beginning of the actual data section?

In turn, this allows us to put a data section initialization routine
in newlib.  The idea is, if every user has to write their own linker
script and initializer, why not put them in the official tree?  Even
though a linker script and crt0 is really board dependent, data
section initialization is faily common on any board.

The following is a part of the linker script that I am using.

.data : AT (ADDR (.tors) + SIZEOF (.tors)) {
	_data_rom = ADDR (.tors) + SIZEOF (.tors);
	_data_ram = . ;
	*(.data)
	 _edata = . ; 
	}  > ram

If the above is acceptable, what names should I use?  _data?
_data_rom? data_ram?

Even if the above is acceptable, another patch to add data-section
initializer may not be accpetable although it's hardly harmless. (One
can avoid executing that code if two data section addresses happen to
be the same, that is, running on RAM.  Plus, that code takes only a
few assembly instructions.)

By the way, if the above is acceptable, I have to make similar changes
to all the targets.

p.s.
Before I noticed that the vanilla crt0 did not have the initialization
routine, it took me days to figure out. :-)

Thanks,

Kazu Hirata


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