[patch,avr] PR21472: Upgrade emulation avrxmega3 so it has .rodata in flash instead of in SRAM.

Georg-Johann Lay avr@gjlay.de
Mon May 8 11:41:00 GMT 2017


ATtiny416, ATtiny417, ATtiny816, ATtiny817 are devices which implement 
avrxmega2 ISA with the additional feature that flash memory is visible 
in the SRAM address range (starting at 0x8000).  In order to optimally 
support this feature, an according linker description file should be 
used per default, i.e. we want a new emulation which comes with this 
liker description file.

The patch uses avrxmega3 for this.  Actually, avrxmega3 is an already 
existing emulation, but one containing no devices so far, and one which 
avr-gcc doesn't even generate a multilib variant for.

Besides optimal support by a linker description file, the compiler might 
come up with different code for these devices.  For example, referencing 
__do_copy_data is no more needed for stuff in .rodata.  This is a second 
reason for why we wand a separate emulation for these devices.

As there are currently no devices in this emulation, the patch doesn't 
break anything existing, is just makes use of code that was dead so far.

The relevant portion of avrxmega3.x is the handling of .rodata which 
reads similar to the avrtiny.x (PR20849):


__RODATA_PM_OFFSET__= DEFINED(__RODATA_PM_OFFSET__) ? 
__RODATA_PM_OFFSET__: 0x8000;


   .text   :
   {
      ...
   }  > text
   .rodata ADDR(.text) + SIZEOF (.text) + __RODATA_PM_OFFSET__:
   {
     *(.rodata)
     *(.rodata*)
     *(.gnu.linkonce.r*)
   } AT> text
   .data :
   {
      ...

Ok for master?

If approved, please someone with commit privileges apply the patch.


Johann


ld/
	Upgrade the currently unused emulation avrxmega3 to one which
	supports avrxmega2 devices with flash memory visible in the
	SRAM address range.

	PR21472
	* scripttempl/avr_rodata.sc: New file.
	* emulparams/avrxmega3.sh (SCRIPT_NAME): Use avr_rodata.
	(RODATA_PM_OFFSET): Set to 0x8000.

gas/
	PR21472
	* config/tc-avr.c (mcu_types): Add entries for: attiny416,
	attiny417, attiny816, attiny817.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: binutils-avrxmega3.diff
Type: text/x-patch
Size: 10384 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20170508/83b326c2/attachment.bin>


More information about the Binutils mailing list